sqlite

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2026 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MapperCache = tldb.MapperCache

Functions

This section is empty.

Types

type Adapter

type Adapter = tldb.Adapter

type Ext

type Ext = tldb.Ext

type QueryLogger

type QueryLogger = querylogger.QueryLogger

type SQLiteAdapter

type SQLiteAdapter struct {
	DBURL string
	// contains filtered or unexported fields
}

SQLiteAdapter provides support for SQLite.

func (*SQLiteAdapter) Close

func (adapter *SQLiteAdapter) Close() error

Close the database.

func (*SQLiteAdapter) Create

func (adapter *SQLiteAdapter) Create() error

Create the database if necessary.

func (*SQLiteAdapter) DBX

func (adapter *SQLiteAdapter) DBX() Ext

DBX returns the underlying Sqlx DB or Tx.

func (*SQLiteAdapter) Find

func (adapter *SQLiteAdapter) Find(ctx context.Context, dest interface{}) error

Find finds a single entity based on the EntityID()

func (*SQLiteAdapter) Get

func (adapter *SQLiteAdapter) Get(ctx context.Context, dest interface{}, qstr string, args ...interface{}) error

Get wraps sqlx.Get

func (*SQLiteAdapter) Insert

func (adapter *SQLiteAdapter) Insert(ctx context.Context, ent interface{}) (int, error)

Insert builds and executes an insert statement for the given entity.

func (*SQLiteAdapter) MultiInsert

func (adapter *SQLiteAdapter) MultiInsert(ctx context.Context, ents []interface{}) ([]int, error)

MultiInsert inserts multiple entities.

func (*SQLiteAdapter) Open

func (adapter *SQLiteAdapter) Open() error

Open the database.

func (*SQLiteAdapter) Select

func (adapter *SQLiteAdapter) Select(ctx context.Context, dest interface{}, qstr string, args ...interface{}) error

Select wraps sqlx.Select

func (*SQLiteAdapter) Sqrl

func (adapter *SQLiteAdapter) Sqrl() sq.StatementBuilderType

Sqrl returns a properly configured Squirrel StatementBuilder.

func (*SQLiteAdapter) SupportsSpatialFunctions added in v1.3.0

func (adapter *SQLiteAdapter) SupportsSpatialFunctions() bool

SupportsSpatialFunctions returns false as SQLite does not support PostGIS spatial functions.

func (*SQLiteAdapter) TableExists

func (adapter *SQLiteAdapter) TableExists(t string) (bool, error)

TableExists returns true if the requested table exists

func (*SQLiteAdapter) Tx

func (adapter *SQLiteAdapter) Tx(cb func(Adapter) error) error

Tx runs a callback inside a transaction.

func (*SQLiteAdapter) Update

func (adapter *SQLiteAdapter) Update(ctx context.Context, ent interface{}, columns ...string) error

Update a single record.

Jump to

Keyboard shortcuts

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