db

package
v0.0.0-...-1b820a2 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BigQuery

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

BigQuery DB

func (*BigQuery) Init

func (bq *BigQuery) Init(config map[string]interface{}) (err error)

Init DB interface implementation.

func (*BigQuery) Run

func (bq *BigQuery) Run(ctx context.Context, query string) (result []byte, err error)

Run DB interface implementation.

type DB

type DB interface {
	// Init makes the DB backend ready to query by create the connection, etc.
	Init(config map[string]interface{}) error
	// Run executes the query in the DB then returns with a JSON (byte slice) for the HTTP response or an error.
	Run(ctx context.Context, query string) (result []byte, err error)
}

DB interface defines that a database backend have to implement.

func GetDb

func GetDb(name string) (DB, error)

GetDb returns the DB with the given name or an error if not found.

type PostgreSQL

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

PostgreSQL struct

func (*PostgreSQL) Init

func (psql *PostgreSQL) Init(config map[string]interface{}) (err error)

Init DB interface implementation.

func (*PostgreSQL) Run

func (psql *PostgreSQL) Run(ctx context.Context, query string) (result []byte, err error)

Run DB interface implementation.

type SQLite

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

SQLite struct

func (*SQLite) Init

func (sqlt *SQLite) Init(config map[string]interface{}) (err error)

Init DB interface implementation.

func (*SQLite) Run

func (sqlt *SQLite) Run(ctx context.Context, query string) (result []byte, err error)

Run DB interface implementation.

Jump to

Keyboard shortcuts

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