Documentation
¶
Index ¶
- func SanitizeDisplay(input string) string
- type ColumnChange
- type ColumnInfo
- type Result
- type SchemaObject
- type Service
- func (s *Service) AddColumn(ctx context.Context, table string, col sharedsql.ColumnDef) error
- func (s *Service) AlterColumn(ctx context.Context, table string, change sharedsql.ColumnChange) error
- func (s *Service) BrowseTable(ctx context.Context, name string, options sharedsql.BrowseOptions) (sharedsql.Result, error)
- func (s *Service) Close() error
- func (s *Service) CreateForeignKey(ctx context.Context, table string, change sharedsql.ForeignKeyChange) error
- func (s *Service) CreateIndex(ctx context.Context, table string, change sharedsql.IndexChange) error
- func (s *Service) DeleteRow(ctx context.Context, table string, key []sharedsql.RowValue) (sharedsql.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 sharedsql.Result, err error)
- func (s *Service) ExecuteReadOnly(ctx context.Context, statement string) (result sharedsql.Result, err error)
- func (s *Service) Info() sharedsql.DatabaseInfo
- func (s *Service) InsertRow(ctx context.Context, table string, values []sharedsql.RowValue) (sharedsql.Result, error)
- func (s *Service) ListForeignKeys(ctx context.Context, table string) ([]sharedsql.ForeignKeyInfo, error)
- func (s *Service) ListForeignKeysAll(ctx context.Context) (map[string][]sharedsql.ForeignKeyInfo, error)
- func (s *Service) ListIndexes(ctx context.Context, table string) ([]sharedsql.IndexInfo, error)
- func (s *Service) ListIndexesAll(ctx context.Context) (map[string][]sharedsql.IndexInfo, error)
- func (s *Service) ListReferencingForeignKeys(ctx context.Context, table string) ([]sharedsql.ReferencingForeignKeyInfo, error)
- func (s *Service) ListSchema(ctx context.Context) ([]sharedsql.SchemaObject, error)
- func (s *Service) ReplaceForeignKey(ctx context.Context, table, previous string, change sharedsql.ForeignKeyChange) error
- func (s *Service) ReplaceIndex(ctx context.Context, table, previous string, change sharedsql.IndexChange) error
- func (s *Service) TableInfo(ctx context.Context, name string) ([]sharedsql.ColumnInfo, error)
- func (s *Service) UpdateRow(ctx context.Context, table string, key []sharedsql.RowValue, ...) (sharedsql.Result, error)
- func (s *Service) Validate(ctx context.Context, statement string) error
- func (s *Service) WriteCapabilities() sharedsql.WriteCapabilities
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SanitizeDisplay ¶
Types ¶
type ColumnChange ¶
type ColumnChange = sharedsql.ColumnChange
type ColumnInfo ¶
type ColumnInfo = sharedsql.ColumnInfo
type SchemaObject ¶
type SchemaObject = sharedsql.SchemaObject
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) AlterColumn ¶
func (*Service) BrowseTable ¶
func (*Service) CreateForeignKey ¶
func (*Service) CreateIndex ¶
func (*Service) DeleteRow ¶
func (s *Service) DeleteRow(ctx context.Context, table string, key []sharedsql.RowValue) (sharedsql.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() sharedsql.DatabaseInfo
func (*Service) InsertRow ¶
func (s *Service) InsertRow(ctx context.Context, table string, values []sharedsql.RowValue) (sharedsql.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 (*Service) ListForeignKeysAll ¶
func (s *Service) ListForeignKeysAll(ctx context.Context) (map[string][]sharedsql.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 (*Service) ListSchema ¶
func (*Service) ReplaceForeignKey ¶
func (*Service) ReplaceIndex ¶
func (*Service) UpdateRow ¶
func (s *Service) UpdateRow(ctx context.Context, table string, key []sharedsql.RowValue, values []sharedsql.RowValue) (sharedsql.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() sharedsql.WriteCapabilities
WriteCapabilities reports the SQL row-write capability; the sqlite driver has no document store.