Documentation
¶
Overview ¶
Package sqlite provides the SQLite driver for the SQL executor.
Index ¶
- type SQLiteDriver
- func (d *SQLiteDriver) AcquireAdvisoryLock(_ context.Context, _ *sql.DB, _ string) (func() error, error)
- func (d *SQLiteDriver) BuildInsertQuery(table string, columns []string, rowCount int, ...) string
- func (d *SQLiteDriver) Connect(ctx context.Context, cfg *sqlexec.Config) (*sql.DB, func() error, error)
- func (d *SQLiteDriver) ConvertNamedParams(query string, params map[string]any) (string, []any, error)
- func (d *SQLiteDriver) Name() string
- func (d *SQLiteDriver) PlaceholderFormat() string
- func (d *SQLiteDriver) QuoteIdentifier(name string) string
- func (d *SQLiteDriver) SupportsAdvisoryLock() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SQLiteDriver ¶
type SQLiteDriver struct {
// contains filtered or unexported fields
}
SQLiteDriver implements the Driver interface for SQLite.
func (*SQLiteDriver) AcquireAdvisoryLock ¶
func (d *SQLiteDriver) AcquireAdvisoryLock(_ context.Context, _ *sql.DB, _ string) (func() error, error)
AcquireAdvisoryLock is not supported for SQLite.
func (*SQLiteDriver) BuildInsertQuery ¶
func (d *SQLiteDriver) BuildInsertQuery(table string, columns []string, rowCount int, onConflict, conflictTarget string, updateColumns []string) string
BuildInsertQuery generates a multi-row INSERT statement for SQLite. Note: SQLite uses INSERT OR IGNORE/REPLACE which doesn't need conflictTarget or updateColumns, but we accept these parameters for interface compatibility with PostgreSQL.
func (*SQLiteDriver) Connect ¶
func (d *SQLiteDriver) Connect(ctx context.Context, cfg *sqlexec.Config) (*sql.DB, func() error, error)
Connect establishes a connection to SQLite.
func (*SQLiteDriver) ConvertNamedParams ¶
func (d *SQLiteDriver) ConvertNamedParams(query string, params map[string]any) (string, []any, error)
ConvertNamedParams converts named parameters to SQLite positional format.
func (*SQLiteDriver) PlaceholderFormat ¶
func (d *SQLiteDriver) PlaceholderFormat() string
PlaceholderFormat returns the SQLite placeholder format.
func (*SQLiteDriver) QuoteIdentifier ¶
func (d *SQLiteDriver) QuoteIdentifier(name string) string
QuoteIdentifier quotes a table or column name for SQLite. This handles reserved words and special characters by wrapping in double quotes.
func (*SQLiteDriver) SupportsAdvisoryLock ¶
func (d *SQLiteDriver) SupportsAdvisoryLock() bool
SupportsAdvisoryLock returns false as SQLite doesn't support advisory locks.