v0.0.0 -> v0.1.0
Summary
Initial release of go-sqlite, a lightweight SQLite ORM built on sqlite3 driver and database/sql, featuring connection pool management, schema builder, and a fluent query builder API consistent with go-mysql.
Changes
FEAT
- Add connection pool management with configurable lifetime and automatic key derivation from path
- Add Schema Builder with
Create()method supporting columns, primary keys, auto-increment, unique constraints, defaults, and foreign keys - Add Insert methods:
Insert(),InsertContext(),InsertReturningID(),InsertContextReturningID() - Add conflict handling strategies:
InsertConflict()with IGNORE/REPLACE/ABORT/FAIL/ROLLBACK modes - Add
ON CONFLICT DO UPDATEsupport for upsert operations - Add Select query builder:
Select(),Where(),OrWhere(),Join(),LeftJoin(),OrderBy(),Limit(),Offset() - Add query execution methods:
Get(),GetContext()returning*sql.Rows - Add convenience methods:
First(),FirstContext(),Count(),CountContext() - Add
Total()with window function (COUNT(*) OVER()) for pagination with total count - Add Update methods:
Update(),UpdateContext()with map-based data - Add column modifiers:
Increase(),Decrease(),Toggle()for atomic updates - Add raw query wrappers:
Database.Query(),Database.QueryContext(),Database.Exec(),Database.ExecContext()
REFACTOR
- Split single-file structure into modular components: instance.go, builder.go, insert.go, select.go, select_ext.go, select_where.go, select_or_where.go, update.go, utils.go
- Extract column validation and quoting logic into utils.go with
validateColumn()andquote() - Unify ForeignKey as struct type (
Foreign) for cleaner API - Add automatic Builder state clearing after query execution via
builderClear() - Remove test main function and strengthen nil checks with ping verification on connection
Files Changed
| File | Status | Tag |
|---|---|---|
instance.go |
Added | FEAT |
builder.go |
Added | FEAT |
insert.go |
Added | FEAT |
select.go |
Added | FEAT |
select_ext.go |
Added | FEAT |
select_where.go |
Added | FEAT |
select_or_where.go |
Added | FEAT |
update.go |
Added | FEAT |
utils.go |
Added | REFACTOR |
main_test.go |
Added | TEST |
README.md |
Added | DOC |
.gitignore |
Modified | CHORE |
main.go |
Deleted | REMOVE |
©️ 2026 邱敬幃 Pardn Chiu
Top comments (0)