Documentation ¶
Index ¶
- Constants
- type Driver
- type MSSQL
- func (db *MSSQL) Connect(urlstr string) error
- func (db *MSSQL) DeleteRecord(database, table, primaryKeyColumnName, primaryKeyValue string) error
- func (db *MSSQL) ExecuteDMLStatement(query string) (string, error)
- func (db *MSSQL) ExecutePendingChanges(changes []models.DBDMLChange) error
- func (db *MSSQL) ExecuteQuery(query string) ([][]string, error)
- func (db *MSSQL) GetConstraints(database, table string) ([][]string, error)
- func (db *MSSQL) GetDatabases() ([]string, error)
- func (db *MSSQL) GetForeignKeys(database, table string) ([][]string, error)
- func (db *MSSQL) GetIndexes(database, table string) ([][]string, error)
- func (db *MSSQL) GetPrimaryKeyColumnNames(database, table string) ([]string, error)
- func (db *MSSQL) GetProvider() string
- func (db *MSSQL) GetRecords(database, table, where, sort string, offset, limit int) ([][]string, int, error)
- func (db *MSSQL) GetTableColumns(database, table string) ([][]string, error)
- func (db *MSSQL) GetTables(database string) (map[string][]string, error)
- func (db *MSSQL) SetProvider(provider string)
- func (db *MSSQL) TestConnection(urlstr string) error
- func (db *MSSQL) UpdateRecord(database, table, column, value, primaryKeyColumnName, primaryKeyValue string) error
- type MySQL
- func (db *MySQL) Connect(urlstr string) (err error)
- func (db *MySQL) DeleteRecord(database, table, primaryKeyColumnName, primaryKeyValue string) error
- func (db *MySQL) ExecuteDMLStatement(query string) (result string, err error)
- func (db *MySQL) ExecutePendingChanges(changes []models.DBDMLChange) (err error)
- func (db *MySQL) ExecuteQuery(query string) (results [][]string, err error)
- func (db *MySQL) GetConstraints(database, table string) (results [][]string, err error)
- func (db *MySQL) GetDatabases() ([]string, error)
- func (db *MySQL) GetForeignKeys(database, table string) (results [][]string, err error)
- func (db *MySQL) GetIndexes(database, table string) (results [][]string, err error)
- func (db *MySQL) GetPrimaryKeyColumnNames(database, table string) (primaryKeyColumnName []string, err error)
- func (db *MySQL) GetProvider() string
- func (db *MySQL) GetRecords(database, table, where, sort string, offset, limit int) (paginatedResults [][]string, totalRecords int, err error)
- func (db *MySQL) GetTableColumns(database, table string) (results [][]string, err error)
- func (db *MySQL) GetTables(database string) (map[string][]string, error)
- func (db *MySQL) SetProvider(provider string)
- func (db *MySQL) TestConnection(urlstr string) (err error)
- func (db *MySQL) UpdateRecord(database, table, column, value, primaryKeyColumnName, primaryKeyValue string) error
- type Postgres
- func (db *Postgres) Connect(urlstr string) error
- func (db *Postgres) DeleteRecord(database, table, primaryKeyColumnName, primaryKeyValue string) error
- func (db *Postgres) ExecuteDMLStatement(query string) (result string, err error)
- func (db *Postgres) ExecutePendingChanges(changes []models.DBDMLChange) error
- func (db *Postgres) ExecuteQuery(query string) ([][]string, error)
- func (db *Postgres) GetConstraints(database, table string) ([][]string, error)
- func (db *Postgres) GetDatabases() ([]string, error)
- func (db *Postgres) GetForeignKeys(database, table string) ([][]string, error)
- func (db *Postgres) GetIndexes(database, table string) ([][]string, error)
- func (db *Postgres) GetPrimaryKeyColumnNames(database, table string) ([]string, error)
- func (db *Postgres) GetProvider() string
- func (db *Postgres) GetRecords(database, table, where, sort string, offset, limit int) ([][]string, int, error)
- func (db *Postgres) GetTableColumns(database, table string) ([][]string, error)
- func (db *Postgres) GetTables(database string) (map[string][]string, error)
- func (db *Postgres) SetProvider(provider string)
- func (db *Postgres) SwitchDatabase(database string) error
- func (db *Postgres) TestConnection(urlstr string) error
- func (db *Postgres) UpdateRecord(database, table, column, value, primaryKeyColumnName, primaryKeyValue string) error
- type SQLite
- func (db *SQLite) Connect(urlstr string) (err error)
- func (db *SQLite) DeleteRecord(_, table, primaryKeyColumnName, primaryKeyValue string) error
- func (db *SQLite) ExecuteDMLStatement(query string) (result string, err error)
- func (db *SQLite) ExecutePendingChanges(changes []models.DBDMLChange) (err error)
- func (db *SQLite) ExecuteQuery(query string) (results [][]string, err error)
- func (db *SQLite) GetConstraints(_, table string) (results [][]string, err error)
- func (db *SQLite) GetDatabases() ([]string, error)
- func (db *SQLite) GetForeignKeys(_, table string) (results [][]string, err error)
- func (db *SQLite) GetIndexes(_, table string) (results [][]string, err error)
- func (db *SQLite) GetPrimaryKeyColumnNames(database, table string) (primaryKeyColumnName []string, err error)
- func (db *SQLite) GetProvider() string
- func (db *SQLite) GetRecords(_, table, where, sort string, offset, limit int) (paginatedResults [][]string, totalRecords int, err error)
- func (db *SQLite) GetTableColumns(_, table string) (results [][]string, err error)
- func (db *SQLite) GetTables(database string) (map[string][]string, error)
- func (db *SQLite) SetProvider(provider string)
- func (db *SQLite) TestConnection(urlstr string) (err error)
- func (db *SQLite) UpdateRecord(_, table, column, value, primaryKeyColumnName, primaryKeyValue string) error
Constants ¶
View Source
const ( DriverMySQL string = "mysql" DriverPostgres string = "postgres" DriverSqlite string = "sqlite3" DriverMSSQL string = "sqlserver" )
Drivers
View Source
const (
DefaultRowLimit = 300
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Driver ¶ added in v0.1.3
type Driver interface { Connect(urlstr string) error TestConnection(urlstr string) error GetDatabases() ([]string, error) GetTables(database string) (map[string][]string, error) GetTableColumns(database, table string) ([][]string, error) GetConstraints(database, table string) ([][]string, error) GetForeignKeys(database, table string) ([][]string, error) GetIndexes(database, table string) ([][]string, error) GetRecords(database, table, where, sort string, offset, limit int) ([][]string, int, error) UpdateRecord(database, table, column, value, primaryKeyColumnName, primaryKeyValue string) error DeleteRecord(database, table string, primaryKeyColumnName, primaryKeyValue string) error ExecuteDMLStatement(query string) (string, error) ExecuteQuery(query string) ([][]string, error) ExecutePendingChanges(changes []models.DBDMLChange) error SetProvider(provider string) // NOTE: This is used to get the primary key from the database table until i find a better way to do it. See ResultsTable.go GetPrimaryKeyValue function GetProvider() string GetPrimaryKeyColumnNames(database, table string) ([]string, error) }
type MSSQL ¶ added in v0.3.3
func (*MSSQL) DeleteRecord ¶ added in v0.3.3
func (*MSSQL) ExecuteDMLStatement ¶ added in v0.3.3
func (*MSSQL) ExecutePendingChanges ¶ added in v0.3.3
func (db *MSSQL) ExecutePendingChanges(changes []models.DBDMLChange) error
func (*MSSQL) ExecuteQuery ¶ added in v0.3.3
func (*MSSQL) GetConstraints ¶ added in v0.3.3
func (*MSSQL) GetDatabases ¶ added in v0.3.3
func (*MSSQL) GetForeignKeys ¶ added in v0.3.3
func (*MSSQL) GetIndexes ¶ added in v0.3.3
func (*MSSQL) GetPrimaryKeyColumnNames ¶ added in v0.3.3
func (*MSSQL) GetProvider ¶ added in v0.3.3
func (*MSSQL) GetRecords ¶ added in v0.3.3
func (*MSSQL) GetTableColumns ¶ added in v0.3.3
func (*MSSQL) SetProvider ¶ added in v0.3.3
func (*MSSQL) TestConnection ¶ added in v0.3.3
func (*MSSQL) UpdateRecord ¶ added in v0.3.3
type MySQL ¶ added in v0.1.3
func (*MySQL) DeleteRecord ¶ added in v0.1.3
func (*MySQL) ExecuteDMLStatement ¶ added in v0.1.3
func (*MySQL) ExecutePendingChanges ¶ added in v0.1.3
func (db *MySQL) ExecutePendingChanges(changes []models.DBDMLChange) (err error)
func (*MySQL) ExecuteQuery ¶ added in v0.1.3
func (*MySQL) GetConstraints ¶ added in v0.1.3
func (*MySQL) GetDatabases ¶ added in v0.1.3
func (*MySQL) GetForeignKeys ¶ added in v0.1.3
func (*MySQL) GetIndexes ¶ added in v0.1.3
func (*MySQL) GetPrimaryKeyColumnNames ¶ added in v0.3.1
func (*MySQL) GetProvider ¶ added in v0.1.3
func (*MySQL) GetRecords ¶ added in v0.1.3
func (*MySQL) GetTableColumns ¶ added in v0.1.3
func (*MySQL) SetProvider ¶ added in v0.1.3
func (*MySQL) TestConnection ¶ added in v0.1.3
func (*MySQL) UpdateRecord ¶ added in v0.1.3
type Postgres ¶ added in v0.1.3
type Postgres struct { Connection *sql.DB Provider string CurrentDatabase string PreviousDatabase string Urlstr string }
func (*Postgres) DeleteRecord ¶ added in v0.1.3
func (*Postgres) ExecuteDMLStatement ¶ added in v0.1.3
func (*Postgres) ExecutePendingChanges ¶ added in v0.1.3
func (db *Postgres) ExecutePendingChanges(changes []models.DBDMLChange) error
func (*Postgres) ExecuteQuery ¶ added in v0.1.3
func (*Postgres) GetConstraints ¶ added in v0.1.3
func (*Postgres) GetDatabases ¶ added in v0.1.3
func (*Postgres) GetForeignKeys ¶ added in v0.1.3
func (*Postgres) GetIndexes ¶ added in v0.1.3
func (*Postgres) GetPrimaryKeyColumnNames ¶ added in v0.3.1
func (*Postgres) GetProvider ¶ added in v0.1.3
func (*Postgres) GetRecords ¶ added in v0.1.3
func (*Postgres) GetTableColumns ¶ added in v0.1.3
func (*Postgres) SetProvider ¶ added in v0.1.3
func (*Postgres) SwitchDatabase ¶ added in v0.2.2
func (*Postgres) TestConnection ¶ added in v0.1.3
func (*Postgres) UpdateRecord ¶ added in v0.1.3
type SQLite ¶ added in v0.1.3
func (*SQLite) DeleteRecord ¶ added in v0.1.3
func (*SQLite) ExecuteDMLStatement ¶ added in v0.1.3
func (*SQLite) ExecutePendingChanges ¶ added in v0.1.3
func (db *SQLite) ExecutePendingChanges(changes []models.DBDMLChange) (err error)
func (*SQLite) ExecuteQuery ¶ added in v0.1.3
func (*SQLite) GetConstraints ¶ added in v0.1.3
func (*SQLite) GetDatabases ¶ added in v0.1.3
func (*SQLite) GetForeignKeys ¶ added in v0.1.3
func (*SQLite) GetIndexes ¶ added in v0.1.3
func (*SQLite) GetPrimaryKeyColumnNames ¶ added in v0.3.1
func (*SQLite) GetProvider ¶ added in v0.1.3
func (*SQLite) GetRecords ¶ added in v0.1.3
func (*SQLite) GetTableColumns ¶ added in v0.1.3
func (*SQLite) SetProvider ¶ added in v0.1.3
func (*SQLite) TestConnection ¶ added in v0.1.3
func (*SQLite) UpdateRecord ¶ added in v0.1.3
Click to show internal directories.
Click to hide internal directories.