Documentation
¶
Index ¶
- type SQLiteAdapter
- func (a *SQLiteAdapter) BeginTx(ctx context.Context, opts *sql.TxOptions) (thing.Tx, error)
- func (a *SQLiteAdapter) Builder() thing.SQLBuilder
- func (a *SQLiteAdapter) Close() error
- func (a *SQLiteAdapter) DB() *sql.DB
- func (a *SQLiteAdapter) DialectName() string
- func (a *SQLiteAdapter) Exec(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
- func (a *SQLiteAdapter) Get(ctx context.Context, dest interface{}, query string, args ...interface{}) error
- func (a *SQLiteAdapter) GetCount(ctx context.Context, tableName string, where string, args []interface{}) (int64, error)
- func (a *SQLiteAdapter) Select(ctx context.Context, dest interface{}, query string, args ...interface{}) error
- type SQLiteDialector
- type SQLiteIntrospector
- type SQLiteTx
- func (t *SQLiteTx) Commit() error
- func (t *SQLiteTx) Exec(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
- func (t *SQLiteTx) Get(ctx context.Context, dest interface{}, query string, args ...interface{}) error
- func (t *SQLiteTx) Rollback() error
- func (t *SQLiteTx) Select(ctx context.Context, dest interface{}, query string, args ...interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SQLiteAdapter ¶
type SQLiteAdapter struct {
// contains filtered or unexported fields
}
SQLiteAdapter implements the thing.DBAdapter interface for SQLite.
func NewSQLiteAdapter ¶
func NewSQLiteAdapter(dsn string) (*SQLiteAdapter, error)
NewSQLiteAdapter creates a new SQLite database adapter. Implements the public DBAdapter interface.
func (*SQLiteAdapter) Builder ¶
func (a *SQLiteAdapter) Builder() thing.SQLBuilder
func (*SQLiteAdapter) Close ¶
func (a *SQLiteAdapter) Close() error
Close closes the database connection pool.
func (*SQLiteAdapter) DB ¶
func (a *SQLiteAdapter) DB() *sql.DB
DB returns the underlying *sql.DB for advanced use cases.
func (*SQLiteAdapter) DialectName ¶
func (a *SQLiteAdapter) DialectName() string
func (*SQLiteAdapter) Exec ¶
func (a *SQLiteAdapter) Exec(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
Exec executes a query that doesn't return rows (INSERT, UPDATE, DELETE). Uses standard sql.DB.ExecContext
func (*SQLiteAdapter) Get ¶
func (a *SQLiteAdapter) Get(ctx context.Context, dest interface{}, query string, args ...interface{}) error
Get retrieves a single row and scans it into the destination struct. Uses QueryContext and prepares scan destinations based on returned columns.
type SQLiteDialector ¶
type SQLiteDialector struct{}
SQLiteDialector implements the sqlbuilder.Dialector interface for SQLite.
func (SQLiteDialector) Placeholder ¶
func (d SQLiteDialector) Placeholder(_ int) string
func (SQLiteDialector) Quote ¶
func (d SQLiteDialector) Quote(identifier string) string
type SQLiteIntrospector ¶
SQLiteIntrospector implements schema.Introspector for SQLite.
func (*SQLiteIntrospector) GetTableInfo ¶
func (si *SQLiteIntrospector) GetTableInfo(ctx context.Context, tableName string) (*schema.TableInfo, error)
GetTableInfo introspects the given table and returns its schema info (SQLite).
type SQLiteTx ¶
type SQLiteTx struct {
// contains filtered or unexported fields
}
SQLiteTx wraps a standard sql.Tx to implement the interfaces.Tx interface.
func (*SQLiteTx) Get ¶
func (t *SQLiteTx) Get(ctx context.Context, dest interface{}, query string, args ...interface{}) error
Get retrieves a single row within the transaction. Uses QueryContext and prepares scan destinations based on returned columns.