Releases: Serajian/go-query-builder
Releases · Serajian/go-query-builder
v1.0.1
qb v1.0.0
Highlights
- Placeholder styles: DollarN (Postgres) / QuestionMark (MySQL/SQLite)
- SELECT/INSERT/UPDATE/DELETE; JOIN, GROUP BY/HAVING, ORDER BY
- RETURNING for INSERT/UPDATE/DELETE (Postgres, SQLite ≥ 3.35)
- ON CONFLICT: DO NOTHING / DO UPDATE SET (Postgres/SQLite), with Excluded("col")
- Guards: safe UPDATE/DELETE (adds WHERE 1=0) unless .Unsafe()
- IN([]) → (1=0), NOT IN([]) → (1=1) (explicit, predictable semantics)
- Deterministic arg order for INSERT/UPDATE (sorted keys)
- INSERT with no values: DEFAULT VALUES (PG/SQLite) or () VALUES () (MySQL)
- Tests + CI, MIT license
Compatibility Notes
- MySQL generally doesn’t support RETURNING or ON CONFLICT; these are omitted when using QuestionMark placeholders.
- For Postgres/SQLite, RETURNING and ON CONFLICT are rendered when DollarN is used.
Install
go get github.com/Serajian/query-builder-GO@v1.0.0
Thanks for trying qb — PRs and issues welcome!