Documentation
¶
Overview ¶
Demonstration of ALL go-sqlkit features. Run: go run ./cmd/demo
Sections:
- Basic CRUD — Open, Register, Create, Insert, Query, Update, Delete, Replace
- Expressions — all expr constructors with execution
- GroupBy / Having / Distinct / Limit / Offset / Cap
- Builder Nuances — state accumulation, All() vs Where(), reuse
- Explicit JOIN: Inner / Left / Right / Full
- Auto-Join FromAuto
- Many-to-Many Through
- Composite PK & Composite Indexes
- Field & Tag Mechanics — default, check, fk with actions, old>new, IdentSQL, SQLType
- Upsert — OnConflictDoNothing / OnConflictDoUpdate
- Set Operations — Union / UnionAll / Intersect / Except
- Lock Modes — ForUpdate / ForShare / Nowait / SkipLocked
- Nested Transactions — savepoints, rollback, double commit
- Migration — column rename, risky change, dry-run, down
- Custom Types — RegisterCustomType, type=, driver.Valuer / sql.Scanner
- RETURNING (Postgres-only, show SQL)
- Database Reflection — TableFor, TableByName, Tables, GetTable
- Dialect Features — cross-dialect SQL generation
- Error Handling — ErrNoRows, ErrMoreThanRequested, ErrTableNotFound
- Database Options
Click to show internal directories.
Click to hide internal directories.