Forge

Changelog

Release history.

GitHub

0.5.0

  • DynamoDB backend (dbswitch/dynamodb) built on AWS SDK v2. Direct GetItem/PutItem/UpdateItem/DeleteItem for primary-key ("id") access; a Scan + FilterExpression fallback for arbitrary equality conditions on Find/List/Count/Update/Delete; in-memory sort/cursor/offset emulation for List.
  • Duplicate-"id" inserts and not-found lookups map to the same *dbswitch.DuplicateError / dbswitch.ErrNotFound as 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 as Find/List, for PostgreSQL and MongoDB. Added the BuildCount query builder.
  • ListOptions.Offset — page-based pagination (page N = (N-1) * Limit) alongside the existing keyset After cursor.

0.3.0

  • List operation on the Store interface — filtered, sorted, limited reads with keyset cursor pagination (ListOptions with Filter / SortBy / SortDir / Limit / After), implemented for both PostgreSQL and MongoDB.
  • Added the BuildList query builder and the SortDirection type (Ascending / Descending).

0.2.0

  • MongoDB backend (dbswitch/mongo) built on the official Go driver — mongo.Open(ctx, uri, dbName); tables map to collections, Unique columns to unique indexes, PrimaryKey/id to _id.
  • dbswitch.Store interface — a common contract implemented by both *postgres.DB and *mongo.Store, so the same CRUD code runs against either backend. Compile-time asserted with var _ dbswitch.Store = ….
  • Unified errors (ErrNotFound / ErrDuplicate) now work identically across PostgreSQL and MongoDB.
  • Reorganized runnable demos under cmd/demo/postgres and cmd/demo/mongo.

0.1.1

  • Added the LICENSE file and a documentation link in the README. No code or API changes — fully compatible with 0.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/Delete refuse an empty condition.
  • Shared error values: ErrNotFound, ErrDuplicate, and DuplicateError (with the constraint name).
  • Pure query builders (BuildCreateTable / BuildInsert / BuildSelect / BuildUpdate / BuildDelete) behind a Dialect interface.
  • PostgreSQL backend (dbswitch/postgres) built on jackc/pgx.
  • Dependency-light core (no third-party imports).

On this page