Documentation
¶
Index ¶
- Constants
- func CloseRows(rows *stdsql.Rows, action string, err error) error
- func CollectRows(rows *stdsql.Rows) (driver.Result, error)
- func DisplayRow(values []any) []*string
- func GlobToLike(pattern string) string
- func SanitizeDisplay(input string) string
- func ValidateColumnAttributeChange(changeAttributes *string, currentAttributes string) error
- func ValidateColumnChange(change driver.ColumnChange) error
- func ValidateColumnDef(col driver.ColumnDef) error
- func ValidateForeignKeyChange(change driver.ForeignKeyChange) error
- func ValidateIndexChange(change driver.IndexChange) error
- func ValidateStatement(input string) error
- type ColumnChange
- type ColumnInfo
- type Factory
- type Result
- type SchemaObject
- type Service
- func (s *Service) AddColumn(ctx context.Context, table string, col plugindriver.ColumnDef) error
- func (s *Service) AlterColumn(ctx context.Context, table string, change plugindriver.ColumnChange) error
- func (s *Service) BrowseTable(ctx context.Context, name string, options plugindriver.BrowseOptions) (plugindriver.Result, error)
- func (s *Service) Close() error
- func (s *Service) CreateForeignKey(ctx context.Context, table string, change plugindriver.ForeignKeyChange) error
- func (s *Service) CreateIndex(ctx context.Context, table string, change plugindriver.IndexChange) error
- func (s *Service) DeleteRow(ctx context.Context, table string, key []plugindriver.RowValue) (plugindriver.Result, error)
- func (s *Service) DropColumn(ctx context.Context, table, name string) error
- func (s *Service) DropForeignKey(ctx context.Context, table, previous string) error
- func (s *Service) DropIndex(ctx context.Context, table, name string) error
- func (s *Service) Execute(ctx context.Context, statement string) (result plugindriver.Result, err error)
- func (s *Service) ExecuteReadOnly(ctx context.Context, statement string) (result plugindriver.Result, err error)
- func (s *Service) Info() plugindriver.DatabaseInfo
- func (s *Service) InsertRow(ctx context.Context, table string, values []plugindriver.RowValue) (plugindriver.Result, error)
- func (s *Service) ListForeignKeys(ctx context.Context, table string) ([]plugindriver.ForeignKeyInfo, error)
- func (s *Service) ListForeignKeysAll(ctx context.Context) (map[string][]plugindriver.ForeignKeyInfo, error)
- func (s *Service) ListIndexes(ctx context.Context, table string) ([]plugindriver.IndexInfo, error)
- func (s *Service) ListIndexesAll(ctx context.Context) (map[string][]plugindriver.IndexInfo, error)
- func (s *Service) ListReferencingForeignKeys(ctx context.Context, table string) ([]plugindriver.ReferencingForeignKeyInfo, error)
- func (s *Service) ListSchema(ctx context.Context) ([]plugindriver.SchemaObject, error)
- func (s *Service) ReplaceForeignKey(ctx context.Context, table, previous string, ...) error
- func (s *Service) ReplaceIndex(ctx context.Context, table, previous string, change plugindriver.IndexChange) error
- func (s *Service) TableInfo(ctx context.Context, name string) ([]plugindriver.ColumnInfo, error)
- func (s *Service) UpdateRow(ctx context.Context, table string, key []plugindriver.RowValue, ...) (plugindriver.Result, error)
- func (s *Service) Validate(ctx context.Context, statement string) error
- func (s *Service) WriteCapabilities() plugindriver.WriteCapabilities
Constants ¶
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 DisplayRow ¶ added in v0.11.0
func GlobToLike ¶ added in v0.11.0
func SanitizeDisplay ¶
func ValidateColumnAttributeChange ¶ added in v0.11.0
func ValidateColumnChange ¶ added in v0.11.0
func ValidateColumnChange(change driver.ColumnChange) error
func ValidateColumnDef ¶ added in v0.11.0
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
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) BuildTarget(_ context.Context, values driver.FormValues) (driver.BuildTargetResult, error)
func (Factory) Capabilities ¶ added in v0.11.0
func (Factory) Capabilities() driver.Capabilities
type Result ¶
type Result = plugindriver.Result
type SchemaObject ¶
type SchemaObject = plugindriver.SchemaObject
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
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) 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 (*Service) DropForeignKey ¶
func (*Service) ExecuteReadOnly ¶
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 (*Service) ListIndexesAll ¶
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 ¶
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.