Changelog
Release history.
0.5.0
- DynamoDB backend (
dbswitch/dynamodb) built on AWS SDK v2. DirectGetItem/PutItem/UpdateItem/DeleteItemfor primary-key ("id") access; aScan+FilterExpressionfallback for arbitrary equality conditions onFind/List/Count/Update/Delete; in-memory sort/cursor/offset emulation forList. - Duplicate-
"id"inserts and not-found lookups map to the same*dbswitch.DuplicateError/dbswitch.ErrNotFoundas PostgreSQL and MongoDB. - New runnable demo under
cmd/demo/dynamodb.
0.4.0
Store.Count— returns how many rows/documents match the same equality-filter shape asFind/List, for PostgreSQL and MongoDB. Added theBuildCountquery builder.ListOptions.Offset— page-based pagination (page N = (N-1) * Limit) alongside the existing keysetAftercursor.
0.3.0
Listoperation on theStoreinterface — filtered, sorted, limited reads with keyset cursor pagination (ListOptionswithFilter/SortBy/SortDir/Limit/After), implemented for both PostgreSQL and MongoDB.- Added the
BuildListquery builder and theSortDirectiontype (Ascending/Descending).
0.2.0
- MongoDB backend (
dbswitch/mongo) built on the official Go driver —mongo.Open(ctx, uri, dbName); tables map to collections,Uniquecolumns to unique indexes,PrimaryKey/idto_id. dbswitch.Storeinterface — a common contract implemented by both*postgres.DBand*mongo.Store, so the same CRUD code runs against either backend. Compile-time asserted withvar _ dbswitch.Store = ….- Unified errors (
ErrNotFound/ErrDuplicate) now work identically across PostgreSQL and MongoDB. - Reorganized runnable demos under
cmd/demo/postgresandcmd/demo/mongo.
0.1.1
- Added the
LICENSEfile and a documentation link in the README. No code or API changes — fully compatible with0.1.0.
0.1.0
Initial release.
- Explicit, reflection-free schema definition (
Table,Column,ColumnType,DefaultValue). - CRUD over
map[string]any:Insert,Find,FindOne,Update,Delete— always parameterized. - Equality-only, ANDed conditions;
Update/Deleterefuse an empty condition. - Shared error values:
ErrNotFound,ErrDuplicate, andDuplicateError(with the constraint name). - Pure query builders (
BuildCreateTable/BuildInsert/BuildSelect/BuildUpdate/BuildDelete) behind aDialectinterface. - PostgreSQL backend (
dbswitch/postgres) built onjackc/pgx. - Dependency-light core (no third-party imports).