Documentation
¶
Index ¶
- type Column
- type Field
- type Query
- func AlterTable(table string) *Query
- func Analyze(query string) *Query
- func AttachDatabase(schema, name string) *Query
- func Begin(mode string) *Query
- func CreateIndex(name, table string, columns []string, unique bool) *Query
- func CreateTable(name string, columns []*Column, options ...string) *Query
- func CreateTrigger(name, table, when, event, actions string) *Query
- func CreateView(name, query string, temp bool, ifNotExists bool) *Query
- func DeleteFrom(table string) *Query
- func DetachDatabase(name string) *Query
- func DropIndex(name string) *Query
- func DropTable(table string) *Query
- func DropTrigger(name string) *Query
- func DropView(name string) *Query
- func Explain(query string) *Query
- func InsertInto(table string) *Query
- func Pragma(name, value string) *Query
- func ReleaseSavepoint(name string) *Query
- func Rollback(savepoint string) *Query
- func Savepoint(name string) *Query
- func Select(conditions ...string) *Query
- func Update(table, condition string) *Query
- func Vacuum(schema, file string) *Query
- func With(queries ...*WithQuery) *Query
- func (q *Query) AddColumn(column Column, options ...string) *Query
- func (q *Query) AlterTable(table string) *Query
- func (q *Query) Analyze(query string) *Query
- func (q *Query) And(condition string) *Query
- func (q *Query) Args(args ...any) *Query
- func (q *Query) Asc() *Query
- func (q *Query) AttachDatabase(schema, name string) *Query
- func (q *Query) Begin(mode string) *Query
- func (q *Query) Build() (string, []any)
- func (q *Query) Columns(columns ...string) *Query
- func (q *Query) Commit() *Query
- func (q *Query) CreateIndex(name, table string, columns []string, unique bool) *Query
- func (q *Query) CreateTable(name string, columns []*Column, options ...string) *Query
- func (q *Query) CreateTrigger(name, table, when, event, actions string) *Query
- func (q *Query) CreateView(name, query string, temp bool, ifNotExists bool) *Query
- func (q *Query) DeleteFrom(table string) *Query
- func (q *Query) Desc() *Query
- func (q *Query) DetachDatabase(name string) *Query
- func (q *Query) Do() *Query
- func (q *Query) DropColumn(columnName string) *Query
- func (q *Query) DropIndex(name string) *Query
- func (q *Query) DropTable(table string) *Query
- func (q *Query) DropTrigger(name string) *Query
- func (q *Query) DropView(name string) *Query
- func (q *Query) Explain(query string) *Query
- func (q *Query) From(tables ...string) *Query
- func (q *Query) FullJoin(table, condition string) *Query
- func (q *Query) GroupBy(conditions ...string) *Query
- func (q *Query) Having(condition string) *Query
- func (q *Query) In(values []any) *Query
- func (q *Query) IndexBy(name string) *Query
- func (q *Query) InsertInto(table string) *Query
- func (q *Query) Join(table, condition string) *Query
- func (q *Query) LeftJoin(table, condition string) *Query
- func (q *Query) Like(pattern string) *Query
- func (q *Query) Limit(limit int) *Query
- func (q *Query) Not() *Query
- func (q *Query) NotIndex() *Query
- func (q *Query) Nothing() *Query
- func (q *Query) Offset(offset int) *Query
- func (q *Query) OnConflict(columns ...string) *Query
- func (q *Query) Or(condition string) *Query
- func (q *Query) OrderBy(columns ...string) *Query
- func (q *Query) Paginate(page, pageSize int) *Query
- func (q *Query) Pragma(name, value string) *Query
- func (q *Query) Query() string
- func (q *Query) Raw(query string, args ...any) *Query
- func (q *Query) Reindex(name string) *Query
- func (q *Query) ReleaseSavepoint(name string) *Query
- func (q *Query) RenameColumn(oldName, newName string) *Query
- func (q *Query) RenameTo(newName string) *Query
- func (q *Query) Reset()
- func (q *Query) Returning(columns ...string) *Query
- func (q *Query) RightJoin(table, condition string) *Query
- func (q *Query) Rollback(savepoint string) *Query
- func (q *Query) Savepoint(name string) *Query
- func (q *Query) Select(conditions ...string) *Query
- func (q *Query) Set(fields []*Field) *Query
- func (q *Query) Union() *Query
- func (q *Query) UnionAll() *Query
- func (q *Query) Update(table, condition string) *Query
- func (q *Query) Vacuum(schema, file string) *Query
- func (q *Query) Values(values ...any) *Query
- func (q *Query) Where(expr string) *Query
- func (q *Query) With(queries ...*WithQuery) *Query
- type WithQuery
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Column ¶
type Column struct { Name string Type string PrimaryKey bool AutoIncrement bool Unique bool NotNull bool Check string Default string Collate string References string OnUpdate string OnDelete string }
Column is a struct representing a column in a CREATE TABLE statement
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
Query is a struct that represents a query
func AlterTable ¶
AlterTableName is a function that returns a RENAME TABLE query
func AttachDatabase ¶
AttachDatabase is a function that returns an ATTACH DATABASE query
func CreateIndex ¶
CreateIndex is a function that returns a CREATE INDEX query for the specified index and columns
func CreateTable ¶
CreateTable is a function that returns a CREATE TABLE query with the specified options
func CreateTrigger ¶
CreateTrigger is a function that returns a CREATE TRIGGER query for the specified trigger
func CreateView ¶
CreateView is a function that returns a CREATE VIEW query for the specified view and SQL statement
func DeleteFrom ¶
DeleteFrom is a function to start building a DELETE FROM query statement
func DetachDatabase ¶
DetachDatabase is a function that returns a DETACH DATABASE query
func DropTrigger ¶
DropTrigger is a function that returns a DROP TRIGGER query for the specified trigger
func InsertInto ¶
InsertInto is a function to start building an INSERT INTO query statement
func ReleaseSavepoint ¶
ReleaseSavepoint is a function that adds a RELEASE SAVEPOINT statement to the query for the specified savepoint name
func Savepoint ¶
Savepoint is a function that adds a SAVEPOINT statement to the query for the specified savepoint name
func Vacuum ¶
Vacuum is a function that returns a VACUUM statement for the specified schema and file
func (*Query) AlterTable ¶
AlterTableName builds the query string for a RENAME TABLE statement
func (*Query) And ¶
And is a function that returns an AND WHERE clause for the specified expression and value
func (*Query) Asc ¶
Asc is a function that specifies ascending sort order for the most recently specified column in the ORDER BY clause
func (*Query) AttachDatabase ¶
AttachDatabase is a function that returns an ATTACH DATABASE query
func (*Query) Begin ¶
Begin is a function that returns a BEGIN TRANSACTION query with the specified mode
func (*Query) Columns ¶
Columns builds the query string for the COLUMNS clause in an INSERT INTO statement
func (*Query) CreateIndex ¶
CreateIndex is a function that returns a CREATE INDEX query for the specified index and columns
func (*Query) CreateTable ¶
CreateTable is a function that returns a CREATE TABLE query with the specified options
func (*Query) CreateTrigger ¶
CreateTrigger is a function that returns a CREATE TRIGGER query for the specified trigger
func (*Query) CreateView ¶
CreateView is a function that returns a CREATE VIEW query for the specified view and SQL statement
func (*Query) DeleteFrom ¶
DeleteFrom is a method for the Query struct and builds the query string for a DELETE statement
func (*Query) Desc ¶
Desc is a function that specifies descending sort order for the most recently specified column in the ORDER BY clause
func (*Query) DetachDatabase ¶
DetachDatabase is a function that returns a DETACH DATABASE query
func (*Query) DropColumn ¶
DropColumn is a function that returns a DROP COLUMN query
func (*Query) DropIndex ¶
DropIndex is a function that returns a DROP INDEX query for the specified index
func (*Query) DropTable ¶
DropTable is a function that returns a DROP TABLE query for the specified table
func (*Query) DropTrigger ¶
DropTrigger is a function that returns a DROP TRIGGER query for the specified trigger
func (*Query) DropView ¶
DropView is a function that returns a DROP VIEW query for the specified view
func (*Query) FullJoin ¶
FullJoin is a function that returns a FULL JOIN clause for the specified tables
func (*Query) GroupBy ¶
GroupBy is a function that returns a GROUP BY clause for the specified columns
func (*Query) Having ¶
Having is a function that adds a HAVING clause to the query for the specified conditions
func (*Query) In ¶
In is a function that returns an IN WHERE clause for the specified column and values Values are automatically added as query arguments
func (*Query) IndexBy ¶
IndexBy is a function that returns an INDEX BY clause for the specified index
func (*Query) InsertInto ¶
InsertInto builds the query string for an INSERT INTO statement
func (*Query) LeftJoin ¶
LeftJoin is a function that returns a LEFT JOIN clause for the specified tables
func (*Query) Like ¶
Like is a function that returns a LIKE WHERE clause for the specified column and value
func (*Query) Not ¶
Not is a function that returns a NOT WHERE clause for the specified expression and value
func (*Query) Nothing ¶
Nothing is a function that returns a NOTHING clause for the specified fields
func (*Query) Offset ¶
Offset is a function that specifies the number of rows to skip before starting to return rows
func (*Query) OnConflict ¶
OnConflict builds the query string for the ON CONFLICT clause in an INSERT INTO statement
func (*Query) Or ¶
Or is a function that returns an OR WHERE clause for the specified expression and value
func (*Query) OrderBy ¶
OrderBy is a function that returns an ORDER BY clause for the specified columns and sort order
func (*Query) Paginate ¶
Paginate is a function that returns a LIMIT and OFFSET clause for the specified page and page size
func (*Query) ReleaseSavepoint ¶
ReleaseSavepoint is a function that adds a RELEASE SAVEPOINT statement to the query for the specified savepoint name
func (*Query) RenameColumn ¶
RenameColumn is a function that returns a RENAME COLUMN query
func (*Query) Reset ¶
func (q *Query) Reset()
Reset is a function that resets the query string and arguments
func (*Query) Returning ¶
Returning is a function that returns a RETURNING clause for the specified columns
func (*Query) RightJoin ¶
RightJoin is a function that returns a RIGHT JOIN clause for the specified tables
func (*Query) Savepoint ¶
Savepoint is a function that adds a SAVEPOINT statement to the query for the specified savepoint name
func (*Query) Select ¶
Select is a function that returns a SELECT query for the specified columns and tables, with optional conditions
func (*Query) UnionAll ¶
UnionAll is a function that returns a UNION ALL clause for the specified tables
func (*Query) Update ¶
Update is a function that returns an UPDATE query for the specified table and condition
func (*Query) Vacuum ¶
Vacuum is a function that returns a VACUUM statement for the specified schema and file
func (*Query) Values ¶
Values builds the query string for the VALUES clause in an INSERT INTO statement