sqlite

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Column

type Column struct {
	FieldOrdinal int     // field_ordinal
	ColumnName   string  // column_name
	DataType     string  // data_type
	NotNull      bool    // not_null
	DefaultValue *string // default_value
	IsPrimaryKey bool    // pk_col_index

	Alias string
}

Column struct

type DB

type DB struct {
	*sql.DB
}

DB is a connection

func New

func New(db *sql.DB) *DB

New DB

func Open

func Open(path string) (*DB, error)

Open the database

func (*DB) Generate

func (s *DB) Generate(imp *importer.Importer, schemas []string) (vfs.FileSystem, error)

Generate the filesystem

func (*DB) Introspect

func (d *DB) Introspect(schemaName string) (*schema.Schema, error)

Introspect a sqlite database TODO: support views

type ForeignKey

type ForeignKey struct {
	ColumnName    string  // column_name
	RefIndexName  string  // ref_index_name
	RefTableName  string  // ref_table_name
	RefColumnName *string // ref_column_name
	KeyID         int     // key_id
	SeqNo         int     // seq_no
	OnUpdate      string  // on_update
	OnDelete      string  // on_delete
	Match         string  // match
}

ForeignKey struct

type Index

type Index struct {
	IndexName string // index_name
	IsUnique  bool   // is_unique
	SeqNo     int    // seq_no
	Origin    string // origin
	IsPartial bool   // is_partial
}

Index struct

type IndexColumn

type IndexColumn struct {
	SeqNo      int    // seq_no
	Cid        int    // cid
	ColumnName string // column_name
}

IndexColumn struct

type Table

type Table struct {
	Name    string // tbl_name
	Virtual bool
}

Table struct

Jump to

Keyboard shortcuts

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