database

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const SqlMarketsInsertTemplate = "INSERT INTO markets (market_id, exchange_name, base, quote) VALUES ('%s', '%s', '%s', '%s')"

SqlMarketsInsertTemplate inserts into the markets table

View Source
const SqlQueryDailyValuesTemplate = "" /* 187-byte string literal not displayed */

SqlQueryDailyValuesTemplate queries the trades table to get the values for a given day

View Source
const SqlQueryMarketsById = "SELECT market_id, exchange_name, base, quote FROM markets WHERE market_id = $1 LIMIT 1"
queries

SqlQueryMarketsById queries the markets table

View Source
const SqlTradesInsertTemplate = "" /* 173-byte string literal not displayed */

SqlTradesInsertTemplate inserts into the trades table

Variables

This section is empty.

Functions

func ConnectInitializedDatabase

func ConnectInitializedDatabase(postgresDbConfig *postgresdb.Config) (*sql.DB, error)

ConnectInitializedDatabase creates a database with the required metadata tables

func QueryDbVersion

func QueryDbVersion(db *sql.DB) (uint32, error)
query helper functions

QueryDbVersion queries for the version of the database

Types

type UpgradeScript

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

UpgradeScript encapsulates a script to be run to upgrade the database from one version to the next

Jump to

Keyboard shortcuts

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