sqlite3

package
v0.0.0-...-cf0f022 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSqlite3Plugin

func NewSqlite3Plugin() *engine.Plugin

Types

type DateTimeString

type DateTimeString string

DateTimeString is a custom type that stores datetime values as plain strings without any parsing or formatting. This is needed because SQLite stores datetime values as TEXT and we want to preserve the exact format.

func (*DateTimeString) Scan

func (ds *DateTimeString) Scan(value interface{}) error

Scan implements sql.Scanner interface to read datetime values as strings

func (DateTimeString) Value

func (ds DateTimeString) Value() (driver.Value, error)

Value implements driver.Valuer interface to write datetime values as strings

type SQLiteSQLBuilder

type SQLiteSQLBuilder struct {
	*gorm_plugin.SQLBuilder
}

SQLiteSQLBuilder embeds the generic SQLBuilder and overrides methods for SQLite-specific syntax.

func NewSQLiteSQLBuilder

func NewSQLiteSQLBuilder(db *gorm.DB, plugin gorm_plugin.GormPluginFunctions) *SQLiteSQLBuilder

NewSQLiteSQLBuilder creates a new SQL builder for SQLite.

func (*SQLiteSQLBuilder) PragmaQuery

func (sb *SQLiteSQLBuilder) PragmaQuery(pragma, table string) (string, error)

PragmaQuery builds a SQLite PRAGMA query.

type Sqlite3Plugin

type Sqlite3Plugin struct {
	gorm_plugin.GormPlugin
	// contains filtered or unexported fields
}

func (*Sqlite3Plugin) ConvertRawToRows

func (p *Sqlite3Plugin) ConvertRawToRows(rows *sql.Rows) (*engine.GetRowsResult, error)

ConvertRawToRows overrides the parent to handle SQLite datetime columns specially This maintains backward compatibility for non-STRICT tables

func (*Sqlite3Plugin) ConvertStringValue

func (p *Sqlite3Plugin) ConvertStringValue(value, columnType string) (interface{}, error)

ConvertStringValue overrides the base GORM implementation to preserve datetime strings

func (*Sqlite3Plugin) ConvertStringValueDuringMap

func (p *Sqlite3Plugin) ConvertStringValueDuringMap(value, columnType string) (interface{}, error)

func (*Sqlite3Plugin) CreateSQLBuilder

func (p *Sqlite3Plugin) CreateSQLBuilder(db *gorm.DB) gorm_plugin.SQLBuilderInterface

CreateSQLBuilder creates a SQLite-specific SQL builder.

func (*Sqlite3Plugin) DB

func (p *Sqlite3Plugin) DB(config *engine.PluginConfig) (*gorm.DB, error)

func (*Sqlite3Plugin) FormTableName

func (p *Sqlite3Plugin) FormTableName(schema string, storageUnit string) string

func (*Sqlite3Plugin) GetAllSchemas

func (p *Sqlite3Plugin) GetAllSchemas(config *engine.PluginConfig) ([]string, error)

func (*Sqlite3Plugin) GetAllSchemasQuery

func (p *Sqlite3Plugin) GetAllSchemasQuery() string

func (*Sqlite3Plugin) GetColTypeQuery

func (p *Sqlite3Plugin) GetColTypeQuery() string

func (*Sqlite3Plugin) GetColumnConstraints

func (p *Sqlite3Plugin) GetColumnConstraints(config *engine.PluginConfig, schema string, storageUnit string) (map[string]map[string]interface{}, error)

GetColumnConstraints retrieves column constraints for SQLite tables

func (*Sqlite3Plugin) GetCreateTableQuery

func (p *Sqlite3Plugin) GetCreateTableQuery(db *gorm.DB, schema string, storageUnit string, columns []engine.Record) string

func (*Sqlite3Plugin) GetDatabases

func (p *Sqlite3Plugin) GetDatabases(config *engine.PluginConfig) ([]string, error)

func (*Sqlite3Plugin) GetGraphQueryDB

func (p *Sqlite3Plugin) GetGraphQueryDB(db *gorm.DB, schema string) *gorm.DB

func (*Sqlite3Plugin) GetPlaceholder

func (p *Sqlite3Plugin) GetPlaceholder(index int) string

func (*Sqlite3Plugin) GetPrimaryKeyColQuery

func (p *Sqlite3Plugin) GetPrimaryKeyColQuery() string

func (*Sqlite3Plugin) GetRows

func (p *Sqlite3Plugin) GetRows(config *engine.PluginConfig, schema string, storageUnit string, where *model.WhereCondition, sort []*model.SortCondition, pageSize, pageOffset int) (*engine.GetRowsResult, error)

GetRows overrides the base GORM implementation to handle SQLite datetime quirks

func (*Sqlite3Plugin) GetSchemaTableQuery

func (p *Sqlite3Plugin) GetSchemaTableQuery() string

func (*Sqlite3Plugin) GetSupportedColumnDataTypes

func (p *Sqlite3Plugin) GetSupportedColumnDataTypes() mapset.Set[string]

func (*Sqlite3Plugin) GetSupportedOperators

func (p *Sqlite3Plugin) GetSupportedOperators() map[string]string

func (*Sqlite3Plugin) GetTableInfoQuery

func (p *Sqlite3Plugin) GetTableInfoQuery() string

func (*Sqlite3Plugin) GetTableNameAndAttributes

func (p *Sqlite3Plugin) GetTableNameAndAttributes(rows *sql.Rows, db *gorm.DB) (string, []engine.Record)

func (*Sqlite3Plugin) IsTableStrict

func (p *Sqlite3Plugin) IsTableStrict(db *gorm.DB, tableName string) bool

IsTableStrict checks if a table is STRICT using PRAGMA table_list Returns false if detection fails or SQLite version doesn't support STRICT tables

func (*Sqlite3Plugin) RawExecute

func (p *Sqlite3Plugin) RawExecute(config *engine.PluginConfig, query string) (*engine.GetRowsResult, error)

Jump to

Keyboard shortcuts

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