Documentation ¶
Overview ¶
Package database provides a high-level relational database interface with schema migration, connection pooling, prepared statement, and embedded query support, wrapping around zombiezen.com/go/sqlite's CGo-free sqlite interface
Index ¶
- func ExecuteDelete(conn *sqlite.Conn, query string, namedParams map[string]interface{}) error
- func ExecuteInsertion(conn *sqlite.Conn, query string, namedParams map[string]interface{}) error
- func ExecuteInsertionForID(conn *sqlite.Conn, query string, namedParams map[string]interface{}) (rowID int64, err error)
- func ExecuteSelection(conn *sqlite.Conn, query string, namedParams map[string]interface{}, ...) error
- func ExecuteUpdate(conn *sqlite.Conn, query string, namedParams map[string]interface{}) error
- type Config
- type DB
- func (db *DB) AcquireReader(ctx context.Context) (*sqlite.Conn, error)
- func (db *DB) AcquireWriter(ctx context.Context) (*sqlite.Conn, error)
- func (db *DB) Close() error
- func (db *DB) ExecuteDelete(ctx context.Context, query string, namedParams map[string]interface{}) error
- func (db *DB) ExecuteInsertion(ctx context.Context, query string, namedParams map[string]interface{}) error
- func (db *DB) ExecuteInsertionForID(ctx context.Context, query string, namedParams map[string]interface{}) (rowID int64, err error)
- func (db *DB) ExecuteSelection(ctx context.Context, query string, namedParams map[string]interface{}, ...) error
- func (db *DB) ExecuteUpdate(ctx context.Context, query string, namedParams map[string]interface{}) error
- func (db *DB) Migrate(ctx context.Context, schema sqlitemigration.Schema) error
- func (db *DB) Open() (err error)
- func (db *DB) ReleaseReader(conn *sqlite.Conn)
- func (db *DB) ReleaseWriter(conn *sqlite.Conn)
- type DBOption
- type DomainEmbeds
- type Embeds
- type MigrationFile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecuteDelete ¶
func ExecuteInsertion ¶
func ExecuteInsertionForID ¶ added in v0.3.0
func ExecuteSelection ¶
Types ¶
type DB ¶
type DB struct { Config Config // contains filtered or unexported fields }
func (*DB) ExecuteDelete ¶
func (*DB) ExecuteInsertion ¶
func (*DB) ExecuteInsertionForID ¶ added in v0.3.0
func (*DB) ExecuteSelection ¶
func (*DB) ExecuteUpdate ¶
func (*DB) ReleaseReader ¶
func (*DB) ReleaseWriter ¶
type DomainEmbeds ¶
type Embeds ¶
type Embeds struct { AppID int32 DomainEmbeds map[string]DomainEmbeds MigrationFiles []MigrationFile PrepareConnQueriesFS fs.FS }
func (Embeds) ReadDownMigrations ¶
func (Embeds) ReadUpMigrations ¶
type MigrationFile ¶
Click to show internal directories.
Click to hide internal directories.