query

package
v0.0.0-...-424504c Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2015 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DB *sqlx.DB
)

Functions

func Columns

func Columns(table string) []string

Columns returns a slice of strings listing the names of columns expected given the struct registered with name table.

func Connect

func Connect(db *sqlx.DB)

Connect sets the query package's *sqlx.DB. Fallaciously, it does not actually establish the connection.

func Delete

func Delete(table string) string

Insert returns a templated DELETE query for the given table name based on the field names in the corresponding struct using the SQLx Named(Query|ExecStmt) bindvar syntax.

func Get

func Get(table string) string

Insert returns a templated SELECT ... LIMIT 1 query for the given table name based on the field names in the corresponding struct using the SQLx Named(Query|ExecStmt) bindvar syntax.

func Insert

func Insert(table string) string

Insert returns a templated INSERT query for the given table name based on the field names in the corresponding struct using the SQLx Named(Query|ExecStmt) bindvar syntax.

func Register

func Register(model interface{})

Register adds models (aka structs) to the reflection cache. Registration does not actually take place until Connect has been called.

func Select

func Select(table string) string

Insert returns a templated SELECT query for the given table name based on the field names in the corresponding struct using the SQLx Named(Query|ExecStmt) bindvar syntax.

func Update

func Update(table string) string

Insert returns a templated UPDATE query for the given table name based on the field names in the corresponding struct using the SQLx Named(Query|ExecStmt) bindvar syntax.

Types

This section is empty.

Jump to

Keyboard shortcuts

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