Documentation ¶
Overview ¶
Package data handles all the data and application structures handling for Lex Library
Index ¶
- func BeginTx(trnFunc func(tx *sql.Tx) error) error
- func Init(cfg Config) error
- func Teardown() error
- type Config
- type Query
- func (q *Query) Debug(args ...sql.NamedArg) string
- func (q *Query) DebugPrint(args ...sql.NamedArg)
- func (q *Query) Exec(args ...sql.NamedArg) (sql.Result, error)
- func (q *Query) Query(args ...sql.NamedArg) (*sql.Rows, error)
- func (q *Query) QueryRow(args ...sql.NamedArg) *sql.Row
- func (q *Query) Statement() string
- func (q *Query) String() string
- func (q *Query) Tx(tx *sql.Tx) *Query
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BeginTx ¶
BeginTx begins a transaction on the database If the function passed in returns an error, the transaction rolls back If it returns a nil error, then the transaction commits
Types ¶
type Config ¶
type Config struct { DatabaseFile string SearchFile string DatabaseType string DatabaseURL string SSLCert string SSLKey string SSLRootCert string MaxIdleConnections int MaxOpenConnections int MaxConnectionLifetime string AllowSchemaRollback bool }
Config is the data layer configuration used to determine how to initialize the data layer
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns the default configuration for the data layer
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
Query is a templated query that can run across multiple database backends
func (*Query) Debug ¶
Debug runs the passed in query and returns a string of the results in a tab delimited format, with columns listed in the first row meant for debugging use. Will panic instead of throwing an error
func (*Query) DebugPrint ¶
DebugPrint prints out the debug query to the screen