Documentation ¶
Index ¶
Constants ¶
const ( SELECT = "select" CREATE = "create" INSERT = "insert" UPDATE = "update" DELETE = "delete" WHERE = "where" FIND = "find" )
Standard data manipulation operations
Variables ¶
This section is empty.
Functions ¶
func CoalesceQueryBuilder ¶
CoalesceQueryBuilder will wrap the incoming stmt and query attributes in COALESCE with the default types per each attribute. This will avoid errors when null data is found when using find/where Uses all types and names of attributes from passed in model
func PointerAttributes ¶
Reflect the attributes from given reflect.Value and passed back slice of pointers to found attributes Generally to be used for destructuring a reflect.Slice type
Types ¶
type Query ¶
type Query struct { Err error Query string Args []any TableName string Attributes []string // contains filtered or unexported fields }
func QueryBuilder ¶
Generates SQL query from given model. All attributes of the model are passed back as arguments to the calling function Name of model is lowercased, then snake cased to adhere to SQL naming conventions. A table is expected to exist with the given model name. Used for Create, Update, and Delete