Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
Dialect dialect
)
Functions ¶
This section is empty.
Types ¶
type DeleteModApply ¶
type DeleteModApply = sq.QueryModApply[tag.DeleteTag]
type DeleteQuery ¶
func Delete ¶
func Delete(mods ...DeleteMod) DeleteQuery
func DeleteRaw ¶ added in v0.8.1
func DeleteRaw(rawQuery string, args ...any) DeleteQuery
func DeleteRawExpr ¶ added in v0.8.1
func DeleteRawExpr(e litsql.Expression) DeleteQuery
type InsertModApply ¶
type InsertModApply = sq.QueryModApply[tag.InsertTag]
type InsertQuery ¶
func Insert ¶
func Insert(mods ...InsertMod) InsertQuery
func InsertRaw ¶ added in v0.8.1
func InsertRaw(rawQuery string, args ...any) InsertQuery
func InsertRawExpr ¶ added in v0.8.1
func InsertRawExpr(e litsql.Expression) InsertQuery
type SelectModApply ¶
type SelectModApply = sq.QueryModApply[tag.SelectTag]
type SelectQuery ¶
func Select ¶
func Select(mods ...SelectMod) SelectQuery
Example (LiteralJoin) ¶
Output: SELECT orders.id AS order_id, orders.date, u.id AS user_id, u.name AS user_name FROM orders INNER JOIN users AS u ON orders.user_id = u.id WHERE u.age > $1 AND u.deleted_at IS NOT NULL ORDER BY orders.date DESC, u.name ASC === [32]
Example (LiteralSimple) ¶
Output: SELECT u.id, u.name, u.created_at, u.updated_at FROM users AS u WHERE u.age > $1 AND u.city_id = $2 AND u.deleted_at IS NOT NULL ORDER BY u.name ASC, u.age DESC === [40 66]
Example (LiteralSimpleInvalid) ¶
Output: SELECT u.id, u.name of user FROM users AND NOT users WHERE CREATE TABLE users
Example (LiteralWith) ¶
Output: WITH regional_sales AS ( SELECT region, SUM(amount) AS total_sales FROM orders GROUP BY region ), top_regions AS ( SELECT region FROM regional_sales WHERE total_sales > ( SELECT SUM(total_sales)/10 FROM regional_sales ) ) SELECT region, product, SUM(quantity) AS product_units, SUM(amount) AS product_sales FROM orders WHERE region IN ( SELECT region FROM top_regions ) GROUP BY region, product
func SelectRaw ¶ added in v0.8.1
func SelectRaw(rawQuery string, args ...any) SelectQuery
func SelectRawExpr ¶ added in v0.8.1
func SelectRawExpr(e litsql.Expression) SelectQuery
type UpdateModApply ¶
type UpdateModApply = sq.QueryModApply[tag.UpdateTag]
type UpdateQuery ¶
func Update ¶
func Update(mods ...UpdateMod) UpdateQuery
func UpdateRaw ¶ added in v0.8.1
func UpdateRaw(rawQuery string, args ...any) UpdateQuery
func UpdateRawExpr ¶ added in v0.8.1
func UpdateRawExpr(e litsql.Expression) UpdateQuery
Directories
¶
Path | Synopsis |
---|---|
Code generated by "litsql-dialectgen"; DO NOT EDIT.
|
Code generated by "litsql-dialectgen"; DO NOT EDIT. |
Code generated by "litsql-dialectgen"; DO NOT EDIT.
|
Code generated by "litsql-dialectgen"; DO NOT EDIT. |
Code generated by "litsql-dialectgen"; DO NOT EDIT.
|
Code generated by "litsql-dialectgen"; DO NOT EDIT. |
Code generated by "litsql-dialectgen"; DO NOT EDIT.
|
Code generated by "litsql-dialectgen"; DO NOT EDIT. |
Click to show internal directories.
Click to hide internal directories.