database

package module
v0.0.0-...-22a6399 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(host string, port string, database string, user string, password string,
	timezone string) *gorm.DB

Connect to a PostgreSQL database according to the passed parameters. @param host - The database server @param port - The port for the database server @param database - The database to use (must be manually created as of 1/14/22). @param user - The user to use for login @param password - The user's password for login @param timezone - The time zone where the program is executed, e.g. America/Chicago. @returns A pointer to the GORM database connection

func VerifyAndUpdateSchema

func VerifyAndUpdateSchema(db *gorm.DB)

Verify the current schema contains all the appropriate tables, and if not, create/update them according to the current models. @param db - The active database connection @returns Nothing

func VerifyMiner

func VerifyMiner(tx *gorm.DB, minerName string) uint64

Verify the miner exists in the database. If not, create it. @param tx - The active database session @param minerName - The name of the mining hardware @returns The ID associated with the miner.

Types

This section is empty.

Jump to

Keyboard shortcuts

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