{"modulePath":"github.com/BitlyTwiser/tinyORM","version":"v1.0.6","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package sqlbuilder\n\n## Constants\n\n```go\nconst (\n\tSELECT = \"select\"\n\tCREATE = \"create\"\n\tINSERT = \"insert\"\n\tUPDATE = \"update\"\n\tDELETE = \"delete\"\n\tWHERE  = \"where\"\n\tFIND   = \"find\"\n)\n```\nStandard data manipulation operations\n\n## Functions\n\n```go\nfunc CoalesceQueryBuilder(model reflect.Type) string\n```\nCoalesceQueryBuilder 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\n\n```go\nfunc IsPointer(model any) bool\n```\n\n```go\nfunc PointerAttributes(model reflect.Value) []any\n```\nReflect 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\n\n## Types\n\n```go\ntype Query struct {\n\tErr       error\n\tQuery     string\n\tArgs      []any\n\tTableName string\n\n\tAttributes []string\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc QueryBuilder(queryType string, model any, databaseType string) Query\n```\nGenerates 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\n\n```go\nfunc (q *Query) GetModelID() any\n```\n\n```go\nfunc (q *Query) ModelAttributes() []any\n```\n\n","path":"github.com/BitlyTwiser/tinyORM/pkg/sqlbuilder","name":"sqlbuilder","synopsis":"","isRedistributable":true}
