Documentation ¶
Index ¶
- type IndexInfo
- type Sqlite
- func (ss *Sqlite) CompareEnums(remoteSchema *lib.Database, localSchema *lib.Database, tableName string) (sql string)
- func (ss *Sqlite) Connect() (server *lib.Server, e error)
- func (ss *Sqlite) CreateChangeSQL(localSchema *lib.Database, remoteSchema *lib.Database) (sql string, e error)
- func (ss *Sqlite) FetchDatabaseTables(server *lib.Server, databaseName string) (tables map[string]*lib.Table, e error)
- func (ss *Sqlite) FetchDatabases(server *lib.Server) (databases map[string]*lib.Database, e error)
- func (ss *Sqlite) FetchEnums(server *lib.Server) (enums map[string][]map[string]interface{})
- func (ss *Sqlite) FetchTableColumns(server *lib.Server, databaseName string, tableName string) (columns map[string]*lib.Column, e error)
- func (ss *Sqlite) FetchTableIndices(databaseName string, tableName string) []TableIndex
- func (ss *Sqlite) UseDatabase(server *lib.Server, databaseName string) (e error)
- type TableIndex
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Sqlite ¶
Sqlite contains functionality for interacting with a server
func (*Sqlite) CompareEnums ¶ added in v1.1.1
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 ¶
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 (*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:
- Ordinal
- Name of the index
- "1" if UNIQUE, "0" if not
- "c" = created by "CREATE INDEX", "u" if the index was created by "UNIQUE" constraint, "pk" if PRIMARY KEY constraint
- "1" if a partial index, "0" if not
Click to show internal directories.
Click to hide internal directories.