databasesImplementation

package
v0.0.0-...-d400e7b Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMySql

func NewMySql(connectionString string) (databases.Database, error)

func NewPostgres

func NewPostgres(connectionString string) (databases.Database, error)

Types

type BigQuery

type BigQuery struct {
	// contains filtered or unexported fields
}

func NewBigQuery

func NewBigQuery(ctx context.Context, projectID string, datasetID string) (BigQuery, error)

func (BigQuery) Close

func (b BigQuery) Close(ctx context.Context) error

func (BigQuery) ExecContext

func (b BigQuery) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)

func (BigQuery) ListColumns

func (b BigQuery) ListColumns(ctx context.Context, table string) ([]string, error)

func (BigQuery) ListTables

func (b BigQuery) ListTables(ctx context.Context) ([]string, error)

func (BigQuery) ListViews

func (b BigQuery) ListViews(ctx context.Context) ([]string, error)

func (BigQuery) QueryContext

func (b BigQuery) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)

func (BigQuery) ReturnFullPathRequirement

func (b BigQuery) ReturnFullPathRequirement(tableName string) string

func (BigQuery) SeedsCreateTableQuery

func (b BigQuery) SeedsCreateTableQuery(tableName string, columns []string) (string, error)

func (BigQuery) SeedsDropTableQuery

func (b BigQuery) SeedsDropTableQuery(tableName string) string

func (BigQuery) SeedsInsertIntoTableQuery

func (b BigQuery) SeedsInsertIntoTableQuery(tableName string, columns []string, values [][]string) (string, error)

type DuckDB

type DuckDB struct {
	DB *sql.DB
}

func NewDuckDB

func NewDuckDB(filePath string, params map[string]string) (*DuckDB, error)

func (*DuckDB) Close

func (db *DuckDB) Close(ctx context.Context) error

func (*DuckDB) ExecContext

func (db *DuckDB) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)

func (*DuckDB) ListColumns

func (db *DuckDB) ListColumns(ctx context.Context, table string) (columns []string, err error)

func (*DuckDB) ListTables

func (db *DuckDB) ListTables(ctx context.Context) (tables []string, err error)

ListTables implements the interface Database

func (*DuckDB) ListViews

func (db *DuckDB) ListViews(ctx context.Context) (views []string, err error)

ListViews implements the interface Database

func (*DuckDB) QueryContext

func (db *DuckDB) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)

func (*DuckDB) ReturnFullPathRequirement

func (db *DuckDB) ReturnFullPathRequirement(tableName string) string

func (*DuckDB) SeedsCreateTableQuery

func (db *DuckDB) SeedsCreateTableQuery(tableName string, columns []string) (string, error)

func (*DuckDB) SeedsDropTableQuery

func (db *DuckDB) SeedsDropTableQuery(tableName string) string

func (*DuckDB) SeedsInsertIntoTableQuery

func (db *DuckDB) SeedsInsertIntoTableQuery(tableName string, columns []string, values [][]string) (string, error)

type Mysql

type Mysql struct {
	// contains filtered or unexported fields
}

func (Mysql) Close

func (m Mysql) Close(ctx context.Context) error

func (Mysql) ExecContext

func (m Mysql) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)

func (Mysql) ListColumns

func (m Mysql) ListColumns(ctx context.Context, table string) ([]string, error)

func (Mysql) ListTables

func (m Mysql) ListTables(ctx context.Context) ([]string, error)

func (Mysql) ListViews

func (m Mysql) ListViews(ctx context.Context) ([]string, error)

func (Mysql) QueryContext

func (m Mysql) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)

func (Mysql) ReturnFullPathRequirement

func (m Mysql) ReturnFullPathRequirement(tableName string) string

func (Mysql) SeedsCreateTableQuery

func (m Mysql) SeedsCreateTableQuery(tableName string, columns []string) (string, error)

func (Mysql) SeedsDropTableQuery

func (m Mysql) SeedsDropTableQuery(tableName string) string

func (Mysql) SeedsInsertIntoTableQuery

func (m Mysql) SeedsInsertIntoTableQuery(tableName string, columns []string, values [][]string) (string, error)

type Postgres

type Postgres struct {
	// contains filtered or unexported fields
}

func (Postgres) Close

func (p Postgres) Close(ctx context.Context) error

func (Postgres) ExecContext

func (p Postgres) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)

func (Postgres) ListColumns

func (p Postgres) ListColumns(ctx context.Context, table string) ([]string, error)

func (Postgres) ListTables

func (p Postgres) ListTables(ctx context.Context) ([]string, error)

func (Postgres) ListViews

func (p Postgres) ListViews(ctx context.Context) ([]string, error)

func (Postgres) QueryContext

func (p Postgres) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)

func (Postgres) ReturnFullPathRequirement

func (p Postgres) ReturnFullPathRequirement(tableName string) string

func (Postgres) SeedsCreateTableQuery

func (p Postgres) SeedsCreateTableQuery(tableName string, columns []string) (string, error)

func (Postgres) SeedsDropTableQuery

func (p Postgres) SeedsDropTableQuery(tableName string) string

func (Postgres) SeedsInsertIntoTableQuery

func (p Postgres) SeedsInsertIntoTableQuery(tableName string, columns []string, values [][]string) (string, error)

type SQLLite

type SQLLite struct {
	DB *sql.DB
}

func NewSqlLite

func NewSqlLite(filePath string) (*SQLLite, error)

func NewSqlLiteInMemory

func NewSqlLiteInMemory() (*SQLLite, error)

NewSqlLiteInMemory returns an in-memory sqlite instance through the call of NewSqlLite

func (*SQLLite) Close

func (db *SQLLite) Close(ctx context.Context) error

func (*SQLLite) ExecContext

func (db *SQLLite) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)

func (*SQLLite) ListColumns

func (db *SQLLite) ListColumns(ctx context.Context, table string) (columns []string, err error)

func (*SQLLite) ListTables

func (db *SQLLite) ListTables(ctx context.Context) (tables []string, err error)

ListTables implements the interface Database

func (*SQLLite) ListViews

func (db *SQLLite) ListViews(ctx context.Context) (views []string, err error)

ListViews implements the interface Database

func (*SQLLite) QueryContext

func (db *SQLLite) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)

func (*SQLLite) ReturnFullPathRequirement

func (db *SQLLite) ReturnFullPathRequirement(tableName string) string

func (*SQLLite) SeedsCreateTableQuery

func (db *SQLLite) SeedsCreateTableQuery(tableName string, columns []string) (string, error)

func (*SQLLite) SeedsDropTableQuery

func (db *SQLLite) SeedsDropTableQuery(tableName string) string

func (*SQLLite) SeedsInsertIntoTableQuery

func (db *SQLLite) SeedsInsertIntoTableQuery(tableName string, columns []string, values [][]string) (string, error)

type Table

type Table struct {
	Name string `bigquery:"table_name"`
}

Directories

Path Synopsis
Package databaseImplementationBase provides a base class for the database implementations.
Package databaseImplementationBase provides a base class for the database implementations.

Jump to

Keyboard shortcuts

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