sqlite

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BrowseFilterLike         = "LIKE"
	BrowseFilterNotLike      = "NOT LIKE"
	BrowseFilterPattern      = "PATTERN"
	BrowseFilterNotPattern   = "NOT PATTERN"
	BrowseFilterEqual        = "="
	BrowseFilterNotEqual     = "!="
	BrowseFilterLess         = "<"
	BrowseFilterLessEqual    = "<="
	BrowseFilterGreater      = ">"
	BrowseFilterGreaterEqual = ">="
	BrowseFilterIsNull       = "IS NULL"
	BrowseFilterIsNotNull    = "IS NOT NULL"
)

Variables

This section is empty.

Functions

func CloseRows added in v0.11.0

func CloseRows(rows *stdsql.Rows, action string, err error) error

func CollectRows added in v0.11.0

func CollectRows(rows *stdsql.Rows) (driver.Result, error)

func DisplayRow added in v0.11.0

func DisplayRow(values []any) []*string

func GlobToLike added in v0.11.0

func GlobToLike(pattern string) string

func SanitizeDisplay

func SanitizeDisplay(input string) string

func ValidateColumnAttributeChange added in v0.11.0

func ValidateColumnAttributeChange(changeAttributes *string, currentAttributes string) error

func ValidateColumnChange added in v0.11.0

func ValidateColumnChange(change driver.ColumnChange) error

func ValidateColumnDef added in v0.11.0

func ValidateColumnDef(col driver.ColumnDef) error

func ValidateForeignKeyChange added in v0.11.0

func ValidateForeignKeyChange(change driver.ForeignKeyChange) error

func ValidateIndexChange added in v0.11.0

func ValidateIndexChange(change driver.IndexChange) error

func ValidateStatement added in v0.11.0

func ValidateStatement(input string) error

Types

type ColumnChange

type ColumnChange = plugindriver.ColumnChange

type ColumnInfo

type ColumnInfo = plugindriver.ColumnInfo

type Factory added in v0.11.0

type Factory struct{}

Factory is the standalone SQLite plugin implementation exposed to server.Run.

func (Factory) BuildTarget added in v0.11.0

func (Factory) Capabilities added in v0.11.0

func (Factory) Capabilities() driver.Capabilities

func (Factory) Open added in v0.11.0

func (Factory) Open(ctx context.Context, target string) (driver.OpenResult, error)

type Result

type Result = plugindriver.Result

type SchemaObject

type SchemaObject = plugindriver.SchemaObject

type Service

type Service struct {
	// contains filtered or unexported fields
}

func Open

func Open(ctx context.Context, target string) (*Service, error)

func (*Service) AddColumn

func (s *Service) AddColumn(ctx context.Context, table string, col plugindriver.ColumnDef) error

func (*Service) AlterColumn

func (s *Service) AlterColumn(ctx context.Context, table string, change plugindriver.ColumnChange) error

func (*Service) BrowseTable

func (s *Service) BrowseTable(ctx context.Context, name string, options plugindriver.BrowseOptions) (plugindriver.Result, error)

func (*Service) Close

func (s *Service) Close() error

func (*Service) CreateForeignKey

func (s *Service) CreateForeignKey(ctx context.Context, table string, change plugindriver.ForeignKeyChange) error

func (*Service) CreateIndex

func (s *Service) CreateIndex(ctx context.Context, table string, change plugindriver.IndexChange) error

func (*Service) DeleteRow

func (s *Service) DeleteRow(ctx context.Context, table string, key []plugindriver.RowValue) (plugindriver.Result, error)

DeleteRow removes the row identified by key. NULL key values become IS NULL predicates so NULL primary-key parts still match.

func (*Service) DropColumn

func (s *Service) DropColumn(ctx context.Context, table, name string) error

func (*Service) DropForeignKey

func (s *Service) DropForeignKey(ctx context.Context, table, previous string) error

func (*Service) DropIndex

func (s *Service) DropIndex(ctx context.Context, table, name string) error

func (*Service) Execute

func (s *Service) Execute(ctx context.Context, statement string) (plugindriver.Result, error)

func (*Service) ExecuteReadOnly

func (s *Service) ExecuteReadOnly(ctx context.Context, statement string) (plugindriver.Result, error)

func (*Service) Info

func (s *Service) Info() plugindriver.DatabaseInfo

func (*Service) InsertRow

func (s *Service) InsertRow(ctx context.Context, table string, values []plugindriver.RowValue) (plugindriver.Result, error)

InsertRow inserts one row, binding values as parameters instead of quoting them by hand. ValueDefault columns are omitted so engine defaults and auto-increment apply; a row of pure defaults uses DEFAULT VALUES.

func (*Service) ListForeignKeys

func (s *Service) ListForeignKeys(ctx context.Context, table string) ([]plugindriver.ForeignKeyInfo, error)

func (*Service) ListForeignKeysAll

func (s *Service) ListForeignKeysAll(ctx context.Context) (map[string][]plugindriver.ForeignKeyInfo, error)

ListForeignKeysAll returns every foreign key in the database, keyed by the declaring table's name.

func (*Service) ListIndexes

func (s *Service) ListIndexes(ctx context.Context, table string) ([]plugindriver.IndexInfo, error)

func (*Service) ListIndexesAll

func (s *Service) ListIndexesAll(ctx context.Context) (map[string][]plugindriver.IndexInfo, error)

ListIndexesAll returns every index in the database, keyed by the indexed table's name. Every table gets an entry (empty when it has no indexes); rowid tables without a declared primary key get no PRIMARY entry, matching ListIndexes per table.

func (*Service) ListReferencingForeignKeys

func (s *Service) ListReferencingForeignKeys(ctx context.Context, table string) ([]plugindriver.ReferencingForeignKeyInfo, error)

func (*Service) ListSchema

func (s *Service) ListSchema(ctx context.Context) ([]plugindriver.SchemaObject, error)

func (*Service) ReplaceForeignKey

func (s *Service) ReplaceForeignKey(ctx context.Context, table, previous string, change plugindriver.ForeignKeyChange) error

func (*Service) ReplaceIndex

func (s *Service) ReplaceIndex(ctx context.Context, table, previous string, change plugindriver.IndexChange) error

func (*Service) TableInfo

func (s *Service) TableInfo(ctx context.Context, name string) ([]plugindriver.ColumnInfo, error)

func (*Service) UpdateRow

func (s *Service) UpdateRow(ctx context.Context, table string, key []plugindriver.RowValue, values []plugindriver.RowValue) (plugindriver.Result, error)

UpdateRow sets the given columns on the row identified by key. A ValueDefault update value is rejected: DEFAULT is an insert-only state.

func (*Service) Validate

func (s *Service) Validate(ctx context.Context, statement string) error

Validate prepares the statement against the open database without executing it, so syntax and schema errors surface without any side effects.

func (*Service) WriteCapabilities

func (s *Service) WriteCapabilities() plugindriver.WriteCapabilities

WriteCapabilities reports the SQL row-write capability; the sqlite driver has no document store.

Jump to

Keyboard shortcuts

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