Documentation ¶
Overview ¶
Package dbqs provides helper functions that are shared between various tools provided by this module.
Index ¶
Constants ¶
const ( SQLQueriesRead string = "read" SQLQueriesNew string = "new" SQLQueriesWrite string = "write" SQLQueriesIndex string = "index" )
Queries used to retrieve data from MySQL database and manage local SQLite database
Variables ¶
This section is empty.
Functions ¶
func PrepareSQLiteDB ¶
PrepareSQLiteDB prepares a SQLite database for incoming data from the source database. As of the current version, this includes dropping tables and recreating them along with optional indexes, if enabled.
func VerifyDBConn ¶
func VerifyDBConn(ctx context.Context, db *sql.DB, retries int, retryDelay time.Duration, timeout time.Duration) error
VerifyDBConn is used to verify connectivity to a specified database. If the initial verification fails, a specified number of further attempts are made before an error is returned to signal that a database connection is unavailable.
Types ¶
type SQLQueries ¶
SQLQueries is a map of maps representing a collection of tables and the queries used to read from a source database and write to a SQLite database. Example: queries["virtual_domains"]["read"] = "SELECT * FROM virtual_domains"
type SQLQuerySet ¶
SQLQuerySet is a map of query type to query. Each entry is used to read from a source database table, create, write to or update indexes for a new database table in the generated SQLite database.