qbd

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const CommaSpace = ", "

CommaSpace is the separation

Variables

This section is empty.

Functions

This section is empty.

Types

type MySQLQueryBuilder

type MySQLQueryBuilder struct {
	// contains filtered or unexported fields
}

MySQLQueryBuilder is the SQL build

func (*MySQLQueryBuilder) And

func (qb *MySQLQueryBuilder) And(cond string) QueryBuilder

And join the and ternary

func (*MySQLQueryBuilder) Asc

func (qb *MySQLQueryBuilder) Asc() QueryBuilder

Asc join the asc

func (*MySQLQueryBuilder) Delete

func (qb *MySQLQueryBuilder) Delete(tables ...string) QueryBuilder

Delete join the Delete tables

func (*MySQLQueryBuilder) Desc

func (qb *MySQLQueryBuilder) Desc() QueryBuilder

Desc join the desc

func (*MySQLQueryBuilder) ForUpdate

func (qb *MySQLQueryBuilder) ForUpdate() QueryBuilder

ForUpdate add the FOR UPDATE clause

func (*MySQLQueryBuilder) From

func (qb *MySQLQueryBuilder) From(tables ...string) QueryBuilder

From join the tables

func (*MySQLQueryBuilder) GroupBy

func (qb *MySQLQueryBuilder) GroupBy(fields ...string) QueryBuilder

GroupBy join the Group by fields There is an injection risk here

func (*MySQLQueryBuilder) Having

func (qb *MySQLQueryBuilder) Having(cond string) QueryBuilder

Having join the Having ternary There is an injection risk here

func (*MySQLQueryBuilder) In

func (qb *MySQLQueryBuilder) In(vLen int) QueryBuilder

In join the IN (vals)

func (*MySQLQueryBuilder) InSQL

func (qb *MySQLQueryBuilder) InSQL(sql string) QueryBuilder

InSQL join the IN (sql) Deprecate There is an injection risk here, recommended segmented execution

func (*MySQLQueryBuilder) InnerJoin

func (qb *MySQLQueryBuilder) InnerJoin(table string) QueryBuilder

InnerJoin INNER JOIN the table

func (*MySQLQueryBuilder) InsertInto

func (qb *MySQLQueryBuilder) InsertInto(table string, fields ...string) QueryBuilder

InsertInto join the insert SQL

func (*MySQLQueryBuilder) LeftJoin

func (qb *MySQLQueryBuilder) LeftJoin(table string) QueryBuilder

LeftJoin LEFT JOIN the table

func (*MySQLQueryBuilder) Limit

func (qb *MySQLQueryBuilder) Limit(limit int) QueryBuilder

Limit join the limit num

func (*MySQLQueryBuilder) Offset

func (qb *MySQLQueryBuilder) Offset(offset int) QueryBuilder

Offset join the offset num

func (*MySQLQueryBuilder) On

func (qb *MySQLQueryBuilder) On(cond string) QueryBuilder

On join with on ternary

func (*MySQLQueryBuilder) Or

func (qb *MySQLQueryBuilder) Or(cond string) QueryBuilder

Or join the or ternary

func (*MySQLQueryBuilder) OrderBy

func (qb *MySQLQueryBuilder) OrderBy(fields ...string) QueryBuilder

OrderBy join the Order by fields There is an injection risk here

func (*MySQLQueryBuilder) RightJoin

func (qb *MySQLQueryBuilder) RightJoin(table string) QueryBuilder

RightJoin RIGHT JOIN the table

func (*MySQLQueryBuilder) Select

func (qb *MySQLQueryBuilder) Select(fields ...string) QueryBuilder

Select will join the fields

func (*MySQLQueryBuilder) Set

func (qb *MySQLQueryBuilder) Set(kv ...string) QueryBuilder

Set join the set kv

func (*MySQLQueryBuilder) String

func (qb *MySQLQueryBuilder) String(multiplex ...bool) string

String join all tokens

func (*MySQLQueryBuilder) Subquery

func (qb *MySQLQueryBuilder) Subquery(sub string, alias string) string

Subquery join the sub as alias

func (*MySQLQueryBuilder) Update

func (qb *MySQLQueryBuilder) Update(tables ...string) QueryBuilder

Update join the update table

func (*MySQLQueryBuilder) Values

func (qb *MySQLQueryBuilder) Values(vals ...string) QueryBuilder

Values join the Values(vals)

func (*MySQLQueryBuilder) Where

func (qb *MySQLQueryBuilder) Where(cond string) QueryBuilder

Where join the Where ternary

type PostgresQueryBuilder

type PostgresQueryBuilder struct {
	// contains filtered or unexported fields
}

PostgresQueryBuilder is the SQL build

func (*PostgresQueryBuilder) And

And join the and ternary

func (*PostgresQueryBuilder) Asc

Asc join the asc

func (*PostgresQueryBuilder) Delete

func (qb *PostgresQueryBuilder) Delete(tables ...string) QueryBuilder

Delete join the Delete tables

func (*PostgresQueryBuilder) Desc

Desc join the desc

func (*PostgresQueryBuilder) ForUpdate

func (qb *PostgresQueryBuilder) ForUpdate() QueryBuilder

ForUpdate add the FOR UPDATE clause

func (*PostgresQueryBuilder) From

func (qb *PostgresQueryBuilder) From(tables ...string) QueryBuilder

From join the tables

func (*PostgresQueryBuilder) GroupBy

func (qb *PostgresQueryBuilder) GroupBy(fields ...string) QueryBuilder

GroupBy join the Group by fields

func (*PostgresQueryBuilder) Having

func (qb *PostgresQueryBuilder) Having(cond string) QueryBuilder

Having join the Having ternary

func (*PostgresQueryBuilder) In

func (qb *PostgresQueryBuilder) In(vLen int) QueryBuilder

In join the IN (vals)

func (*PostgresQueryBuilder) InSQL

func (qb *PostgresQueryBuilder) InSQL(sql string) QueryBuilder

InSQL join the IN (sql) @WARNING There is an injection risk here, recommended segmented execution

func (*PostgresQueryBuilder) InnerJoin

func (qb *PostgresQueryBuilder) InnerJoin(table string) QueryBuilder

InnerJoin INNER JOIN the table

func (*PostgresQueryBuilder) InsertInto

func (qb *PostgresQueryBuilder) InsertInto(table string, fields ...string) QueryBuilder

InsertInto join the insert SQL

func (*PostgresQueryBuilder) LeftJoin

func (qb *PostgresQueryBuilder) LeftJoin(table string) QueryBuilder

LeftJoin LEFT JOIN the table

func (*PostgresQueryBuilder) Limit

func (qb *PostgresQueryBuilder) Limit(limit int) QueryBuilder

Limit join the limit num

func (*PostgresQueryBuilder) Offset

func (qb *PostgresQueryBuilder) Offset(offset int) QueryBuilder

Offset join the offset num

func (*PostgresQueryBuilder) On

On join with on ternary

func (*PostgresQueryBuilder) Or

Or join the or ternary

func (*PostgresQueryBuilder) OrderBy

func (qb *PostgresQueryBuilder) OrderBy(fields ...string) QueryBuilder

OrderBy join the Order by fields

func (*PostgresQueryBuilder) RightJoin

func (qb *PostgresQueryBuilder) RightJoin(table string) QueryBuilder

RightJoin RIGHT JOIN the table

func (*PostgresQueryBuilder) Select

func (qb *PostgresQueryBuilder) Select(fields ...string) QueryBuilder

Select will join the fields

func (*PostgresQueryBuilder) Set

func (qb *PostgresQueryBuilder) Set(kv ...string) QueryBuilder

Set join the set kv

func (*PostgresQueryBuilder) String

func (qb *PostgresQueryBuilder) String(multiplex ...bool) string

String join all tokens

func (*PostgresQueryBuilder) Subquery

func (qb *PostgresQueryBuilder) Subquery(sub string, alias string) string

Subquery join the sub as alias

func (*PostgresQueryBuilder) Update

func (qb *PostgresQueryBuilder) Update(tables ...string) QueryBuilder

Update join the update table

func (*PostgresQueryBuilder) Values

func (qb *PostgresQueryBuilder) Values(vals ...string) QueryBuilder

Values join the Values(vals)

func (*PostgresQueryBuilder) Where

func (qb *PostgresQueryBuilder) Where(cond string) QueryBuilder

Where join the Where ternary

type QueryBuilder

type QueryBuilder interface {
	Select(fields ...string) QueryBuilder
	ForUpdate() QueryBuilder
	From(tables ...string) QueryBuilder
	InnerJoin(table string) QueryBuilder
	LeftJoin(table string) QueryBuilder
	RightJoin(table string) QueryBuilder
	On(cond string) QueryBuilder
	Where(cond string) QueryBuilder
	And(cond string) QueryBuilder
	Or(cond string) QueryBuilder
	In(vLen int) QueryBuilder
	InSQL(sql string) QueryBuilder
	OrderBy(fields ...string) QueryBuilder
	Asc() QueryBuilder
	Desc() QueryBuilder
	Limit(limit int) QueryBuilder
	Offset(offset int) QueryBuilder
	GroupBy(fields ...string) QueryBuilder
	Having(cond string) QueryBuilder
	Update(tables ...string) QueryBuilder
	Set(kv ...string) QueryBuilder
	Delete(tables ...string) QueryBuilder
	InsertInto(table string, fields ...string) QueryBuilder
	Values(vals ...string) QueryBuilder
	Subquery(sub string, alias string) string
	String(multiplex ...bool) string
}

QueryBuilder is the Query builder interface

func NewQueryBuilder

func NewQueryBuilder(driver string) (qb QueryBuilder, err error)

NewQueryBuilder return the QueryBuilder

Jump to

Keyboard shortcuts

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