Skip to content

Release v1.1.1 Batch transaction ops, standalone ORM, Mockery v3

Latest

Choose a tag to compare

@piyushkumar96 piyushkumar96 released this 05 Mar 14:43

Features

Batch operations in transactions

  • ExecuteDBTxn now supports:
    • CreateInBatches – insert slices in chunks (configurable BatchSize, default 1000)
    • UpsertInBatches – upsert slices in chunks (ON CONFLICT UPDATE)
    • DeleteInBatches – soft-delete slices in chunks
  • Chunking avoids PostgreSQL parameter limits (~65k params)

Schema-scoped transaction steps

  • Set DBTxn.SchemaName so individual transaction steps run in a specific schema (e.g. multi-tenant)

Standalone ORM implementation

  • Full in-repo implementation of SQLGORM and helpers (including sqlormHelper with chunking)
  • No dependency on AdsCommonPackages/orm

Config and client

  • Local GORMConfig and DBConnectionConfigurations (no external config package)
  • sqlclient.Init() now returns an error when db.DB() fails

Documentation

  • README: Transaction section documents all supported ops, chunking, and SchemaName; Quick Start uses DatabaseSchemas; new "Batch and chunked operations" section; API reference updated for ExecuteDBTxn
  • Examples: Transaction demo includes CreateInBatches, UpsertInBatches, and DeleteInBatches; examples README updated for batch transaction usage

Tooling / Mocks

  • Mockery v3: Added interfaces/.mockery.yaml; regenerated mock_IORMHandler.go; go generate uses mockery --config .mockery.yaml; removed invalid pkgname from config

Breaking changes

  • Config: Use DatabaseSchemas (comma-separated) instead of DatabaseSchema in DBConnectionConfigurations
  • Dependencies: No new go.mod deps; removes need for AdsCommonPackages at runtime