Documentation ¶
Index ¶
- func Delete(s string) string
- func QueryBuilder(fns ...FString) string
- func StringMap(fn FString, ss ...string) []string
- type ColumnMutator
- type FString
- func AddForeignKey(name, refer, ontable string) FString
- func AlterTable(t string) FString
- func And(c, op string) FString
- func AndEq(c string) FString
- func Boolean(name string) FString
- func CreateConstraint(c string, fn FString) FString
- func CreateTable(name string) FString
- func DropConstraint(table, field, ctype string) FString
- func DropTable(t string) FString
- func Field(name, field string) FString
- func ForeignKey(refer, ontable string, fn FString) FString
- func From(t string) FString
- func InnerJoin(t string) FString
- func Insert(into string, columns ...string) FString
- func Int(name string) FString
- func NotNull(fn FString) FString
- func On(c1, c2 string) FString
- func Or(c, op string) FString
- func OrEq(c string) FString
- func Prepare(fn FString) FString
- func PrimaryKey(fn FString) FString
- func Real(name string) FString
- func Select(columns ...string) FString
- func Serial(name string) FString
- func Set(columns ...string) FString
- func SubQuery(fns ...FString) FString
- func TimeStamp(name string) FString
- func TimeStamps() FString
- func UUID() FString
- func Unique(fn FString) FString
- func Update(table string) FString
- func VarChar(name string, size int) FString
- func Where(c, op string) FString
- func WhereEq(c string) FString
- func WhereInSub(c string, subquery FString) FString
- func WithColumns(fns ...FString) FString
- func WithDefault(fn FString, v string) FString
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func QueryBuilder ¶ added in v0.2.0
QueryBuilder composes Or a functional query builder Example: QueryBuilder(Select("column1", "column2"), FTable("users"))
Types ¶
type ColumnMutator ¶ added in v0.2.1
ColumnMutator is a function type that defines a Mutator. In this case, Mutator is more akin to PRIMARY KEY and NOT NULL.
type FString ¶ added in v0.2.0
FString is a special function type for function composition
func AddForeignKey ¶ added in v0.4.2
AddForeignKey creates an AddForeignKey statement when altering a table
func AlterTable ¶ added in v0.4.2
AlterTable starts the Alter Table statement
func And ¶ added in v0.2.0
And inserts a where clause prefixed with "AND" It takes 2 arguments, the column and the operation, both as strings It returns a function suitable for composing
func AndEq ¶ added in v0.2.0
AndEq builds an OR clause with equals Helper function for And, which sets the operation to '='
func CreateConstraint ¶ added in v0.4.1
CreateConstraint adds a constraint to the end of a line
func CreateTable ¶ added in v0.2.1
CreateTable begins a new create table query
func DropConstraint ¶ added in v0.4.3
DropConstraint assists in drop constraints based on the format { table }_{ field }_{ constrainttype } Example: DropConstraint("roles", "user_id", "fkey")
func ForeignKey ¶ added in v0.4.1
ForeignKey helps in defining foreignkey constraints
func Or ¶ added in v0.2.0
Or inserts a where clause prefixed with "OR" It takes 2 arguments, the column and the operation, both as strings It returns a function suitable for composing
func OrEq ¶ added in v0.2.0
OrEq builds an OR clause with equals Helper function for Or, which sets the operation to '='
func PrimaryKey ¶ added in v0.2.1
PrimaryKey is a mutator that creates a primary key from a given string
func TimeStamps ¶ added in v0.2.1
func TimeStamps() FString
TimeStamps inserts a created_at and updated_at timestamp
func Where ¶ added in v0.2.0
Where inserts a where clause It takes 2 arguments, the column and the operation, both as strings It returns a function suitable for composing
func WhereEq ¶ added in v0.2.0
WhereEq set's a where clause Or equals Helper function for Where, which sets the operation to '='
func WhereInSub ¶ added in v0.4.4
WhereInSub builds an IN clause
func WithColumns ¶ added in v0.2.1
WithColumns builds columns through function composition
func WithDefault ¶ added in v0.2.2
WithDefault adds a default value. Value must always be as a string.