sqlite

package
v0.0.0-...-c7fac52 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecResult

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

ExecResult represents a SQLite execution result

func (*ExecResult) LastInsertId

func (er *ExecResult) LastInsertId() (int64, error)

LastInsertId returns the last insert ID

func (*ExecResult) RowsAffected

func (er *ExecResult) RowsAffected() (int64, error)

RowsAffected returns the number of rows affected

type PreparedStatement

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

PreparedStatement represents a SQLite prepared statement

func (*PreparedStatement) Close

func (ps *PreparedStatement) Close() error

Close closes the prepared statement

func (*PreparedStatement) Exec

func (ps *PreparedStatement) Exec(ctx context.Context, args ...interface{}) (types.ExecResult, error)

Exec executes the prepared statement with args

func (*PreparedStatement) Query

func (ps *PreparedStatement) Query(ctx context.Context, args ...interface{}) (types.QueryResult, error)

Query executes the prepared statement with args

func (*PreparedStatement) QueryRow

func (ps *PreparedStatement) QueryRow(ctx context.Context, args ...interface{}) (types.Row, error)

QueryRow executes the prepared statement with args and returns a single row

type Provider

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

Provider implements DatabaseProvider for SQLite

func NewProvider

func NewProvider(logger *logrus.Logger) *Provider

NewProvider creates a new SQLite database provider

func (*Provider) BeginTransaction

func (p *Provider) BeginTransaction(ctx context.Context) (types.Transaction, error)

BeginTransaction begins a new transaction

func (*Provider) Close

func (p *Provider) Close() error

Close closes the database connection

func (*Provider) Configure

func (p *Provider) Configure(config map[string]interface{}) error

Configure configures the SQLite provider

func (*Provider) Connect

func (p *Provider) Connect(ctx context.Context) error

Connect connects to the database

func (*Provider) Disconnect

func (p *Provider) Disconnect(ctx context.Context) error

Disconnect disconnects from the database

func (*Provider) Exec

func (p *Provider) Exec(ctx context.Context, query string, args ...interface{}) (types.ExecResult, error)

Exec executes a query without returning rows

func (*Provider) GetConnectionInfo

func (p *Provider) GetConnectionInfo() *types.ConnectionInfo

GetConnectionInfo returns connection information

func (*Provider) GetName

func (p *Provider) GetName() string

GetName returns the provider name

func (*Provider) GetStats

func (p *Provider) GetStats(ctx context.Context) (*types.DatabaseStats, error)

GetStats returns database statistics

func (*Provider) GetSupportedFeatures

func (p *Provider) GetSupportedFeatures() []types.DatabaseFeature

GetSupportedFeatures returns supported features

func (*Provider) HealthCheck

func (p *Provider) HealthCheck(ctx context.Context) error

HealthCheck performs a health check on the database

func (*Provider) IsConfigured

func (p *Provider) IsConfigured() bool

IsConfigured checks if the provider is configured

func (*Provider) IsConnected

func (p *Provider) IsConnected() bool

IsConnected checks if the database is connected

func (*Provider) Ping

func (p *Provider) Ping(ctx context.Context) error

Ping checks database connection

func (*Provider) Prepare

func (p *Provider) Prepare(ctx context.Context, query string) (types.PreparedStatement, error)

Prepare prepares a statement

func (*Provider) Query

func (p *Provider) Query(ctx context.Context, query string, args ...interface{}) (types.QueryResult, error)

Query executes a query that returns rows

func (*Provider) QueryRow

func (p *Provider) QueryRow(ctx context.Context, query string, args ...interface{}) (types.Row, error)

QueryRow executes a query that returns a single row

func (*Provider) WithTransaction

func (p *Provider) WithTransaction(ctx context.Context, fn func(types.Transaction) error) error

WithTransaction executes a function within a transaction

type QueryResult

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

QueryResult represents a SQLite query result

func (*QueryResult) Close

func (qr *QueryResult) Close() error

Close closes the result set

func (*QueryResult) Columns

func (qr *QueryResult) Columns() ([]string, error)

Columns returns the column names

func (*QueryResult) Err

func (qr *QueryResult) Err() error

Err returns any error that occurred during iteration

func (*QueryResult) Next

func (qr *QueryResult) Next() bool

Next advances to the next row

func (*QueryResult) Scan

func (qr *QueryResult) Scan(dest ...interface{}) error

Scan scans the current row into dest

type Row

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

Row represents a SQLite row

func (*Row) Err

func (r *Row) Err() error

Err returns any error that occurred during scanning

func (*Row) Scan

func (r *Row) Scan(dest ...interface{}) error

Scan scans the row into dest

type Transaction

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

Transaction represents a SQLite transaction

func (*Transaction) Commit

func (t *Transaction) Commit() error

Commit commits the transaction

func (*Transaction) Exec

func (t *Transaction) Exec(ctx context.Context, query string, args ...interface{}) (types.ExecResult, error)

Exec executes a query without returning rows within the transaction

func (*Transaction) Prepare

func (t *Transaction) Prepare(ctx context.Context, query string) (types.PreparedStatement, error)

Prepare prepares a statement within the transaction

func (*Transaction) Query

func (t *Transaction) Query(ctx context.Context, query string, args ...interface{}) (types.QueryResult, error)

Query executes a query within the transaction

func (*Transaction) QueryRow

func (t *Transaction) QueryRow(ctx context.Context, query string, args ...interface{}) (types.Row, error)

QueryRow executes a query that returns a single row within the transaction

func (*Transaction) Rollback

func (t *Transaction) Rollback() error

Rollback rolls back the transaction

Jump to

Keyboard shortcuts

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