Skip to content

Commit

Permalink
minor cleanup of unused items
Browse files Browse the repository at this point in the history
  • Loading branch information
brennanjl committed Nov 9, 2023
1 parent 484387a commit d15dff0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 49 deletions.
28 changes: 0 additions & 28 deletions internal/engine/execution/dependencies.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package execution
import (
"context"

"github.com/kwilteam/kwil-db/internal/engine/types"
sql "github.com/kwilteam/kwil-db/internal/sql"
)

Expand All @@ -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)

Expand Down
22 changes: 1 addition & 21 deletions internal/sql/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit d15dff0

Please sign in to comment.