Documentation ¶
Overview ¶
* Copyright (c) 2016 The ConnectorDB Contributors Licensed under the MIT license. *
Index ¶
- func ClearDatabase(dbtype, uri string) error
- func OpenDatabase(dbtype, uri string) (*sqlx.DB, error)
- func SetupDatabase(dbtype, uri string) error
- type SqlxMixin
- func (db *SqlxMixin) Exec(query string, args ...interface{}) (sql.Result, error)
- func (db *SqlxMixin) Get(dest interface{}, query string, args ...interface{}) error
- func (db *SqlxMixin) GetOrPrepare(query string) (*sqlx.Stmt, error)
- func (db *SqlxMixin) InitSqlxMixin(sqldb *sqlx.DB)
- func (db *SqlxMixin) Select(dest interface{}, query string, args ...interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearDatabase ¶
ClearDatabase removes all data from the database
func OpenDatabase ¶
OpenDatabase opens an alread-created database
func SetupDatabase ¶
SetupDatabase creates the ConnectorDB database schema
Types ¶
type SqlxMixin ¶
func (*SqlxMixin) Exec ¶
* This is a wrapper for the Exec done in sqlx, it does auto conversion to stored procedures executes them, and does conversion to the given query style for the given database. *
func (*SqlxMixin) Get ¶
* This is a wrapper for the Get done in sqlx, it does auto conversion to stored procedures executes them, and does conversion to the given query style for the given database.
Gets a single item from the DB, remember to add LIMIT 1 if the DB doesn't know about the query being for a unique item. *
func (*SqlxMixin) GetOrPrepare ¶
This function returns a prepared statement, or prepares one for the given query stores it and returns it
func (*SqlxMixin) InitSqlxMixin ¶
Initializes a sqlx mixin