Documentation
¶
Index ¶
- type IndexInfo
- type Sqlite
- func (ss *Sqlite) CompareEnums(remoteSchema *schema.Schema, localSchema *schema.Schema, tableName string) (sql string)
- func (ss *Sqlite) Connect() (server *schema.Server, e error)
- func (ss *Sqlite) CreateChangeSQL(localSchema *schema.Schema, remoteSchema *schema.Schema) *schema.SchemaComparison
- func (ss *Sqlite) FetchDatabaseTables(server *schema.Server, databaseName string) (tables map[string]*schema.Table, e error)
- func (ss *Sqlite) FetchDatabases(server *schema.Server) (databases map[string]*schema.Schema, e error)
- func (ss *Sqlite) FetchEnum(server *schema.Server, tableName string) (enums []map[string]interface{})
- func (ss *Sqlite) FetchEnums(server *schema.Server) (enums map[string][]map[string]interface{})
- func (ss *Sqlite) FetchTableColumns(server *schema.Server, databaseName string, tableName string) (columns map[string]*schema.Column, e error)
- func (ss *Sqlite) FetchTableIndices(databaseName string, tableName string) []TableIndex
- func (ss *Sqlite) UseDatabase(server *schema.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 ¶
type Sqlite struct {
// contains filtered or unexported fields
}
Sqlite contains functionality for interacting with a server
func NewSqlite ¶
func NewSqlite(config *lib.ConfigDatabase) *Sqlite
func (*Sqlite) CompareEnums ¶
func (*Sqlite) CreateChangeSQL ¶
func (ss *Sqlite) CreateChangeSQL(localSchema *schema.Schema, remoteSchema *schema.Schema) *schema.SchemaComparison
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 *schema.Server, databaseName string) (tables map[string]*schema.Table, e error)
FetchDatabaseTables fetches the complete set of tables from this database
func (*Sqlite) FetchDatabases ¶
func (ss *Sqlite) FetchDatabases(server *schema.Server) (databases map[string]*schema.Schema, 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 ¶
func (*Sqlite) FetchTableColumns ¶
func (ss *Sqlite) FetchTableColumns(server *schema.Server, databaseName string, tableName string) (columns map[string]*schema.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.