From d15dff0411726c9738d30d56c8523c1ac6af8439 Mon Sep 17 00:00:00 2001 From: brennan lamey Date: Wed, 8 Nov 2023 18:00:52 -0600 Subject: [PATCH] minor cleanup of unused items --- internal/engine/execution/dependencies.go | 28 ----------------------- internal/sql/common.go | 22 +----------------- 2 files changed, 1 insertion(+), 49 deletions(-) diff --git a/internal/engine/execution/dependencies.go b/internal/engine/execution/dependencies.go index 16ae319cf..e96b041b7 100644 --- a/internal/engine/execution/dependencies.go +++ b/internal/engine/execution/dependencies.go @@ -3,7 +3,6 @@ package execution import ( "context" - "github.com/kwilteam/kwil-db/internal/engine/types" sql "github.com/kwilteam/kwil-db/internal/sql" ) @@ -29,33 +28,6 @@ type Registry interface { List(ctx context.Context) ([]string, error) } -// MetadataStore is an interface for storing metadata. -type MetadataStore interface { - // StoreMetadata stores a key/value pair in the metadata store. - StoreMetadata(ctx context.Context, key []byte, value []byte, exec sql.Executor) error - - // GetMetadata retrieves a value from the metadata store. - GetMetadata(ctx context.Context, key []byte, exec sql.Executor) ([]byte, error) - - // CreateTable creates a table in the database. - CreateTable(ctx context.Context, table *types.Table, exec sql.Executor) error - - // ListTables lists the tables in the database. - ListTables(ctx context.Context, exec sql.Executor) ([]*types.Table, error) - - // StoreProcedure stores a procedure in the database. - StoreProcedure(ctx context.Context, proc *types.Procedure, exec sql.Executor) error - - // ListProcedures lists the procedures in the database. - ListProcedures(ctx context.Context, exec sql.Executor) ([]*types.Procedure, error) - - // StoreExtension stores an extension in the database. - StoreExtension(ctx context.Context, ext *types.Extension, exec sql.Executor) error - - // ListExtensions lists the extensions in the database. - ListExtensions(ctx context.Context, exec sql.Executor) ([]*types.Extension, error) -} - // NamespaceInitializer is a function that initializes a namespace. type NamespaceInitializer func(ctx context.Context, metadata map[string]string) (Namespace, error) diff --git a/internal/sql/common.go b/internal/sql/common.go index 42ef25393..cf0b7ad65 100644 --- a/internal/sql/common.go +++ b/internal/sql/common.go @@ -4,15 +4,6 @@ import ( "context" ) -type DataType uint8 - -const ( - DataTypeNull DataType = iota - DataTypeInt - DataTypeText - DataTypeBlob -) - // KVStore is a key-value store. type KVStore interface { // Set sets a key to a value. @@ -25,16 +16,10 @@ type KVStore interface { type ResultSetFunc func(ctx context.Context, stmt string, args map[string]any) (*ResultSet, error) -// Executor is an interface for executing statements. -type Executor interface { - // Execute executes a statement against the database. - Execute(ctx context.Context, stmt string, args map[string]any) (Result, error) -} - // Connection is a connection to a database. type Connection interface { KVStore - Executor + Execute(ctx context.Context, stmt string, args map[string]any) (Result, error) Close() error CreateSession() (Session, error) Savepoint() (Savepoint, error) @@ -46,11 +31,6 @@ type ReturnableConnection interface { Return() } -type Statement interface { - Execute(ctx context.Context, args map[string]any) ([]map[string]any, error) - Close() error -} - type Savepoint interface { Rollback() error Commit() error