sqlite

package
v0.0.0-...-8d06c80 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

func New

func New(db *sql.DB) DB

func (DB) Init

func (d DB) Init(ctx context.Context, list []meta.TableList) error

type Table

type Table struct {
	// Create holds the SQL code needed to create the table and all associated
	// triggers and constraints.
	Create string
	// Select holds the prepared statement that can be used to select the primary
	// key from the table.
	Select func() string
	// Insert holds the full prepared statement to insert a row into the table.
	Insert func() string
	// Fields gives the delta csv column names to use for inserting a row into the table.
	Fields []string
	// Nulls holds the set of columns that are allowed to be NULL in the table, an empty
	// string in the CSV field will indicate a NULL value should be passed into the row.
	Nulls []string
	// Unwrap can be used to build a linking table when a column has multiple fields
	Unwrap string
	// Remap can be used to overide a missing column
	Remap map[string][]string
}

func (Table) Columns

func (t Table) Columns(list meta.TableList) [][]any

Columns returns the expected rows for the given TableList.

func (t Table) Links(list meta.TableList, keys ...string) [][]any

Links returns the rows to insert into a Linking table for the given unwrapping column.

Jump to

Keyboard shortcuts

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