metadata

package
v0.6.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package metadata wraps a SQL connection with metadata operations. These operations are used to store and retrieve metadata about a database.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMetadataVersionMismatch = errors.New("metadata version mismatch. the database needs to run migrations")
)

Functions

func CreateTables

func CreateTables(ctx context.Context, tables []*types.Table, kv KV, exec sql.ResultSetFunc) error

CreateTables creates tables and stores them

func ListExtensions

func ListExtensions(ctx context.Context, kv KV) ([]*types.Extension, error)

ListExtensions lists all extensions in the database.

func ListProcedures

func ListProcedures(ctx context.Context, kv KV) ([]*types.Procedure, error)

ListProcedures lists all procedures in the database.

func ListTables

func ListTables(ctx context.Context, kv KV) ([]*types.Table, error)

ListTables lists all tables in the database.

func RunMigration

func RunMigration(ctx context.Context, kv KV) error

RunMigration runs a migration against the metadata store. This is used in case of an update to Kwil's schema structure. It will read out the current schema version, update them, and store them, all if necessary.

func StoreExtensions

func StoreExtensions(ctx context.Context, extensions []*types.Extension, kv KV) error

StoreExtension stores an extension in the metadata store.

func StoreProcedures

func StoreProcedures(ctx context.Context, procedures []*types.Procedure, kv KV) error

StoreProcedures stores a procedure in the metadata store.

Types

type KV

type KV interface {
	Set(ctx context.Context, key []byte, value []byte) error
	Get(ctx context.Context, key []byte) ([]byte, error)
}

KV is a key/value store.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL