sqlite

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SanitizeDisplay

func SanitizeDisplay(input string) string

Types

type ColumnChange

type ColumnChange = sharedsql.ColumnChange

type ColumnInfo

type ColumnInfo = sharedsql.ColumnInfo

type Result

type Result = sharedsql.Result

type SchemaObject

type SchemaObject = sharedsql.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 sharedsql.ColumnDef) error

func (*Service) AlterColumn

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

func (*Service) BrowseTable

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

func (*Service) Close

func (s *Service) Close() error

func (*Service) CreateForeignKey

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

func (*Service) CreateIndex

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

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 (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) (result sharedsql.Result, err error)

func (*Service) ExecuteReadOnly

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

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 (s *Service) ListForeignKeys(ctx context.Context, table string) ([]sharedsql.ForeignKeyInfo, error)

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 (s *Service) ListIndexes(ctx context.Context, table string) ([]sharedsql.IndexInfo, error)

func (*Service) ListIndexesAll

func (s *Service) ListIndexesAll(ctx context.Context) (map[string][]sharedsql.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) ([]sharedsql.ReferencingForeignKeyInfo, error)

func (*Service) ListSchema

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

func (*Service) ReplaceForeignKey

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

func (*Service) ReplaceIndex

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

func (*Service) TableInfo

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

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

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() sharedsql.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