package
0.1.2
Repository: https://github.com/graymeta/gmkit.git
Documentation: pkg.go.dev

# Functions

All provides a nil that indicates no Where clause is provided.
And joins multiple Whereable clauses with AND operations.
BulkInsert is a general bulk insert func that can be used to insert any valid Bulker type.
ByFieldEquals creates a `{field} = ?` argument for a Where clause.
ByFieldIn creates a `{field} = (?, ?, ...)` argument for a Where clause.
ByFieldNotEquals creates a `{field} = ?` argument for a Where clause.
ByID creates a `id = ?` argument for a Where clause.
ByIDsIn provides a where clause with the IN syntax, matching many rows potentially.
ByItemID creates a `id = ?` argument for a Where clause.
ByItemIDsIn provides a where clause with the IN syntax, matching many rows potentially.
ByLocationID creates a `location_id = ?` arugment for a Where clause.
Commit will attept to commit the provided resource.
Err creates a new PG error from a provided error.
IDsNotNull returns all any non Null row by id.
Like creates a where clause that uses a like matcher.
Limit returns a QueryOption that applies a LIMIT to the query.
NewTx creates a new database transaction with default isolation levels and passes a context to roll back a transaction in the case of a context cancellation.
Offset returns a QueryOption that applies an OFFSET to the query.
Or joins multiple Whereable clauses with OR operations.
OrderBy returns a QueryOption that applies an ORDER BY to the query.
Rollback undoes the supplied transaction.
SanitizeString removes \u0000 (null byte) characters, as PG cannot handle them.
ToNullFloat64 is a utility method to convert a float64 into an sql null float64.
ToNullInt64 is a utility method to convert a int64 into an sql null int64.
ToNullString is a utility method to convert a string into a sql null string.
ToWhereClause adds WHERE prefix to a whereable's clause output if the whereable is not nil.

# Constants

QueryOptionTypeLimit describes a limit option type.
QueryOptionTypeOffset describes an offset option type.
QueryOptionTypeOrderBy describes an order by option type.

# Structs

DatabaseErr provides meaningful behavior to the postgres error.
Equals is a struct used to represent a part of a where clause.
In is a struct used to represent an IN clause.
OrderPair is a type to declare a column to be ordered by and if it should be ASC or DESC.

# Interfaces

Bulker is an interface that defines the behavior a type needs to implement to be bulk insert/updated into PG.
CRUD is a ready to go type that implements most of the basic methods we use for 90%+ of our database calls.
Execer provides the exec behavior.
ExecRebinder is an interface that is agnostic for database transactions for the sql type, an execer can be a sqlx.DB, transactions for something custom.
GetRebinder provides the get and rebinding functionality.
Getter provides get functionality.
NameBinder preforms an operating that returns a pointer sql.Result.
NamedExecer preforms an operating that returns an sql.Result and error.
NamedGetBinder allows you to use the GetContext query.
NamedQuerier allows you to use the named query arguments with a query.
NamedRowQuerier allows you to use the named query arguments with a row query.
Preparer provides prepared statement behaviors.
Querier preforms an operating that returns a pointer sql.Rows and possible error.
QueryBinder preforms an operating that returns a pointer sql.Result.
QueryOption is an interface around query options that can be of and order By, Limit or Offset.
Rebinder preforms a strings altering operation.
RowQueryBinder preforms an operating that returns a pointer sql.Result.
SelectBinder preforms a query with a context.
Selecter performs select behavior with contexts.
SelectGetter combines Selecter and Getter interfaces.
Whereable is a way of creating a functional query statement for different lookups.

# Type aliases

Cube is a type that is used to work with the postgresql cube extension which enables the use of euclidian operators on a matrix of sorts.
QueryOptions provides a means to turn a collection of Query Options into a sql safe clause.