sqlite

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package sqlite provides the SQLite database driver implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSQLiteDriver

func NewSQLiteDriver() database.DatabaseDriver

NewSQLiteDriver creates a new SQLite driver.

Types

type SQLiteDriver

type SQLiteDriver struct {
	// contains filtered or unexported fields
}

SQLiteDriver implements the DatabaseDriver interface for SQLite.

func (*SQLiteDriver) BeginTx

BeginTx starts a new transaction.

func (*SQLiteDriver) Close

func (d *SQLiteDriver) Close() error

Close closes the database connection.

func (*SQLiteDriver) Connect

func (d *SQLiteDriver) Connect(ctx context.Context, dsn string) error

Connect establishes a connection to SQLite.

func (*SQLiteDriver) CreateTable

func (d *SQLiteDriver) CreateTable(schema database.TableSchema) (database.Query, error)

CreateTable generates and returns a CREATE TABLE query for SQLite.

func (*SQLiteDriver) Delete

func (d *SQLiteDriver) Delete(table string, where string, whereArgs ...interface{}) (database.Query, error)

Delete generates a DELETE query.

func (*SQLiteDriver) DropTable

func (d *SQLiteDriver) DropTable(tableName string) (database.Query, error)

DropTable generates a DROP TABLE query.

func (*SQLiteDriver) Exec

func (d *SQLiteDriver) Exec(ctx context.Context, query string, args ...interface{}) (sql.Result, error)

Exec executes a query without returning rows.

func (*SQLiteDriver) Insert

func (d *SQLiteDriver) Insert(table string, data map[string]interface{}) (database.Query, error)

Insert generates an INSERT query with RETURNING support (SQLite 3.35+).

func (*SQLiteDriver) MapType

func (d *SQLiteDriver) MapType(schemaType string) string

MapType maps schema types to SQLite types.

func (*SQLiteDriver) Ping

func (d *SQLiteDriver) Ping(ctx context.Context) error

Ping checks if the connection is alive.

func (*SQLiteDriver) Query

func (d *SQLiteDriver) Query(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)

Query executes a query that returns rows.

func (*SQLiteDriver) QueryRow

func (d *SQLiteDriver) QueryRow(ctx context.Context, query string, args ...interface{}) *sql.Row

QueryRow executes a query that returns at most one row.

func (*SQLiteDriver) Select

func (d *SQLiteDriver) Select(table string, columns []string, where string, whereArgs ...interface{}) (database.Query, error)

Select generates a SELECT query.

func (*SQLiteDriver) SupportsArrays

func (d *SQLiteDriver) SupportsArrays() bool

SupportsArrays returns false for SQLite.

func (*SQLiteDriver) SupportsLastInsertId

func (d *SQLiteDriver) SupportsLastInsertId() bool

SupportsLastInsertId returns true for SQLite.

func (*SQLiteDriver) SupportsReturning

func (d *SQLiteDriver) SupportsReturning() bool

SupportsReturning returns true for SQLite 3.35+.

func (*SQLiteDriver) TableExists

func (d *SQLiteDriver) TableExists(tableName string) (bool, error)

TableExists checks if a table exists.

func (*SQLiteDriver) Update

func (d *SQLiteDriver) Update(table string, data map[string]interface{}, where string, whereArgs ...interface{}) (database.Query, error)

Update generates an UPDATE query.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL