drivers

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 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 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(table string) ([][]string, error)
	GetForeignKeys(table string) ([][]string, error)
	GetIndexes(table string) ([][]string, error)
	GetRecords(table, where, sort string, offset, limit int) ([][]string, int, error)
	UpdateRecord(table, column, value, primaryKeyColumnName, primaryKeyValue string) error
	DeleteRecord(table string, primaryKeyColumnName, primaryKeyValue string) error
	ExecuteDMLStatement(query string) (string, error)
	ExecuteQuery(query string) ([][]string, error)
	ExecutePendingChanges(changes []models.DbDmlChange, inserts []models.DbInsert) error
	SetProvider(provider string)
	GetProvider() string
}

type MySQL added in v0.1.3

type MySQL struct {
	Connection *sql.DB
	Provider   string
}

func (*MySQL) Connect added in v0.1.3

func (db *MySQL) Connect(urlstr string) (err error)

func (*MySQL) DeleteRecord added in v0.1.3

func (db *MySQL) DeleteRecord(table, primaryKeyColumnName, primaryKeyValue string) error

TODO: Rewrites this logic to use the primary key instead of the id

func (*MySQL) ExecuteDMLStatement added in v0.1.3

func (db *MySQL) ExecuteDMLStatement(query string) (result string, err error)

func (*MySQL) ExecutePendingChanges added in v0.1.3

func (db *MySQL) ExecutePendingChanges(changes []models.DbDmlChange, inserts []models.DbInsert) (err error)

func (*MySQL) ExecuteQuery added in v0.1.3

func (db *MySQL) ExecuteQuery(query string) (results [][]string, err error)

func (*MySQL) GetConstraints added in v0.1.3

func (db *MySQL) GetConstraints(table string) (results [][]string, err error)

func (*MySQL) GetDatabases added in v0.1.3

func (db *MySQL) GetDatabases() ([]string, error)

func (*MySQL) GetForeignKeys added in v0.1.3

func (db *MySQL) GetForeignKeys(table string) (results [][]string, err error)

func (*MySQL) GetIndexes added in v0.1.3

func (db *MySQL) GetIndexes(table string) (results [][]string, err error)

func (*MySQL) GetProvider added in v0.1.3

func (db *MySQL) GetProvider() string

func (*MySQL) GetRecords added in v0.1.3

func (db *MySQL) GetRecords(table, where, sort string, offset, limit int) (paginatedResults [][]string, totalRecords int, err error)

func (*MySQL) GetTableColumns added in v0.1.3

func (db *MySQL) GetTableColumns(database, table string) (results [][]string, err error)

func (*MySQL) GetTables added in v0.1.3

func (db *MySQL) GetTables(database string) (map[string][]string, error)

func (*MySQL) SetProvider added in v0.1.3

func (db *MySQL) SetProvider(provider string)

func (*MySQL) TestConnection added in v0.1.3

func (db *MySQL) TestConnection(urlstr string) (err error)

func (*MySQL) UpdateRecord added in v0.1.3

func (db *MySQL) UpdateRecord(table, column, value, primaryKeyColumnName, primaryKeyValue string) error

TODO: Rewrites this logic to use the primary key instead of the id

type Postgres added in v0.1.3

type Postgres struct {
	Connection *sql.DB
	Provider   string
}

func (*Postgres) Connect added in v0.1.3

func (db *Postgres) Connect(urlstr string) (err error)

func (*Postgres) DeleteRecord added in v0.1.3

func (db *Postgres) DeleteRecord(table, primaryKeyColumnName, primaryKeyValue string) (err error)

func (*Postgres) ExecuteDMLStatement added in v0.1.3

func (db *Postgres) ExecuteDMLStatement(query string) (result string, err error)

func (*Postgres) ExecutePendingChanges added in v0.1.3

func (db *Postgres) ExecutePendingChanges(changes []models.DbDmlChange, inserts []models.DbInsert) (err error)

func (*Postgres) ExecuteQuery added in v0.1.3

func (db *Postgres) ExecuteQuery(query string) (results [][]string, err error)

func (*Postgres) GetConstraints added in v0.1.3

func (db *Postgres) GetConstraints(table string) (constraints [][]string, error error)

func (*Postgres) GetDatabases added in v0.1.3

func (db *Postgres) GetDatabases() (databases []string, err error)

func (*Postgres) GetForeignKeys added in v0.1.3

func (db *Postgres) GetForeignKeys(table string) (foreignKeys [][]string, error error)

func (*Postgres) GetIndexes added in v0.1.3

func (db *Postgres) GetIndexes(table string) (indexes [][]string, error error)

func (*Postgres) GetProvider added in v0.1.3

func (db *Postgres) GetProvider() string

func (*Postgres) GetRecords added in v0.1.3

func (db *Postgres) GetRecords(table, where, sort string, offset, limit int) (records [][]string, totalRecords int, err error)

func (*Postgres) GetTableColumns added in v0.1.3

func (db *Postgres) GetTableColumns(database, table string) (results [][]string, error error)

func (*Postgres) GetTables added in v0.1.3

func (db *Postgres) GetTables(database string) (tables map[string][]string, err error)

func (*Postgres) SetProvider added in v0.1.3

func (db *Postgres) SetProvider(provider string)

func (*Postgres) TestConnection added in v0.1.3

func (db *Postgres) TestConnection(urlstr string) error

func (*Postgres) UpdateRecord added in v0.1.3

func (db *Postgres) UpdateRecord(table, column, value, primaryKeyColumnName, primaryKeyValue string) (err error)

type SQLite added in v0.1.3

type SQLite struct {
	Connection *sql.DB
	Provider   string
}

func (*SQLite) Connect added in v0.1.3

func (db *SQLite) Connect(urlstr string) (err error)

func (*SQLite) DeleteRecord added in v0.1.3

func (db *SQLite) DeleteRecord(table, primaryKeyColumnName, primaryKeyValue string) error

func (*SQLite) ExecuteDMLStatement added in v0.1.3

func (db *SQLite) ExecuteDMLStatement(query string) (result string, err error)

func (*SQLite) ExecutePendingChanges added in v0.1.3

func (db *SQLite) ExecutePendingChanges(changes []models.DbDmlChange, inserts []models.DbInsert) (err error)

func (*SQLite) ExecuteQuery added in v0.1.3

func (db *SQLite) ExecuteQuery(query string) (results [][]string, err error)

func (*SQLite) GetConstraints added in v0.1.3

func (db *SQLite) GetConstraints(table string) (results [][]string, err error)

func (*SQLite) GetDatabases added in v0.1.3

func (db *SQLite) GetDatabases() ([]string, error)

func (*SQLite) GetForeignKeys added in v0.1.3

func (db *SQLite) GetForeignKeys(table string) (results [][]string, err error)

func (*SQLite) GetIndexes added in v0.1.3

func (db *SQLite) GetIndexes(table string) (results [][]string, err error)

func (*SQLite) GetProvider added in v0.1.3

func (db *SQLite) GetProvider() string

func (*SQLite) GetRecords added in v0.1.3

func (db *SQLite) GetRecords(table, where, sort string, offset, limit int) (paginatedResults [][]string, totalRecords int, err error)

func (*SQLite) GetTableColumns added in v0.1.3

func (db *SQLite) GetTableColumns(database, table string) (results [][]string, err error)

func (*SQLite) GetTables added in v0.1.3

func (db *SQLite) GetTables(database string) (map[string][]string, error)

func (*SQLite) SetProvider added in v0.1.3

func (db *SQLite) SetProvider(provider string)

func (*SQLite) TestConnection added in v0.1.3

func (db *SQLite) TestConnection(urlstr string) (err error)

func (*SQLite) UpdateRecord added in v0.1.3

func (db *SQLite) UpdateRecord(table, column, value, primaryKeyColumnName, primaryKeyValue string) error

Jump to

Keyboard shortcuts

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