sqlite

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IndexInfo

type IndexInfo struct {
	ColumnName string
	IndexRank  int64
}

type Sqlite

type Sqlite struct {
	Config *lib.Config
}

Sqlite contains functionality for interacting with a server

func (*Sqlite) CompareEnums added in v1.1.1

func (ss *Sqlite) CompareEnums(remoteSchema *lib.Database, localSchema *lib.Database, tableName string) (sql string)

func (*Sqlite) Connect

func (ss *Sqlite) Connect() (server *lib.Server, e error)

Connect connects to a server and returns a new server object

func (*Sqlite) CreateChangeSQL

func (ss *Sqlite) CreateChangeSQL(localSchema *lib.Database, remoteSchema *lib.Database) (sql string, e error)

CreateChangeSQL generates sql statements based off of comparing two database objects localSchema is authority, remoteSchema will be upgraded to match localSchema

func (*Sqlite) FetchDatabaseTables

func (ss *Sqlite) FetchDatabaseTables(server *lib.Server, databaseName string) (tables map[string]*lib.Table, e error)

FetchDatabaseTables fetches the complete set of tables from this database

func (*Sqlite) FetchDatabases

func (ss *Sqlite) FetchDatabases(server *lib.Server) (databases map[string]*lib.Database, e error)

FetchDatabases fetches a set of database names from the target server populating the Databases property with a map of Database objects

func (*Sqlite) FetchEnums added in v1.1.1

func (ss *Sqlite) FetchEnums(server *lib.Server) (enums map[string][]map[string]interface{})

func (*Sqlite) FetchTableColumns

func (ss *Sqlite) FetchTableColumns(server *lib.Server, databaseName string, tableName string) (columns map[string]*lib.Column, e error)

FetchTableColumns lists all of the columns in a table

func (*Sqlite) FetchTableIndices

func (ss *Sqlite) FetchTableIndices(databaseName string, tableName string) []TableIndex

Columns:

  1. Ordinal
  2. Name of the index
  3. "1" if UNIQUE, "0" if not
  4. "c" = created by "CREATE INDEX", "u" if the index was created by "UNIQUE" constraint, "pk" if PRIMARY KEY constraint
  5. "1" if a partial index, "0" if not

func (*Sqlite) UseDatabase

func (ss *Sqlite) UseDatabase(server *lib.Server, databaseName string) (e error)

UseDatabase switches the connection context to the passed in database

type TableIndex

type TableIndex struct {
	Name       string
	Unique     bool
	Partial    bool
	ColumnName string
	PrimaryKey bool
}

Jump to

Keyboard shortcuts

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