Help us shape the future of Go! Take the 2026 Go Developer Survey

sqlite

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: ISC Imports: 5 Imported by: 0

Documentation

Overview

Package sqlite is meta.Metadata on top of SQLite (ncruces/go-sqlite3: pure Go, no cgo).

It mirrors what the Java plug-in sees through xerial sqlite-jdbc (reference: 3.53):

  • query columns have no type before execution: java.lang.Object; precision/scale from the parentheses of the declared type, display is always 2147483647;
  • the real types come from getColumns: the declared type is classified by substrings;
  • getIndexInfo ignores the unique flag: unique == indexed;
  • auto-increment is only for columns with AUTOINCREMENT.

Verified with MetaDump.java on internal/meta/testdata/sqlite.txt.

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 Open

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

Open opens a file path or ":memory:".

func OpenReadOnly

func OpenReadOnly(filename string) (*DB, error)

OpenReadOnly opens the project database file: generation writes nothing and does not create an empty database on a typo in the path.

func (*DB) Close

func (db *DB) Close() error

func (*DB) Exec

func (db *DB) Exec(sql string) error

Exec is for setting up the schema in tests and dumps.

func (*DB) IdentifierQuote added in v1.1.2

func (db *DB) IdentifierQuote() string

IdentifierQuote: as getIdentifierQuoteString of xerial.

func (*DB) ImportedKeys

func (db *DB) ImportedKeys(table string) ([]meta.ImportedKey, error)

ImportedKeys: id of pragma_foreign_key_list counts the constraints backwards, so "id desc" is the order of declaration.

func (*DB) PKColNames

func (db *DB) PKColNames(tableRef string) ([]string, error)

func (*DB) RawOfJava

func (db *DB) RawOfJava(javaType string) string

func (*DB) SQLColumns

func (db *DB) SQLColumns(jdbcSQL string) ([]meta.Column, error)

func (*DB) SQLParams

func (db *DB) SQLParams(jdbcSQL string, typeCount int) (*meta.Params, error)

func (*DB) Table

func (db *DB) Table(tableRef string) (*meta.Table, error)

func (*DB) Tables

func (db *DB) Tables(includeViews bool) ([]string, error)

Tables: as xerial getTables: no sqlite_* tables, TABLE before VIEW, then by name.

Jump to

Keyboard shortcuts

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