Skip to content

Releases: piyushkumar96/generic-orm

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

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

Release v1.1.0 Added multi-schema support, update mocks, and fix examples

Choose a tag to compare

@piyushkumar96 piyushkumar96 released this 27 Dec 05:21

feat: Add multi-schema support, update mocks, and fix examples

  • Add multi-schema/multi-tenant functionality with context-based schema switching
  • Create comprehensive multi-schema example with 6 detailed demos
  • Regenerate mocks using mockery v3.2.2 with updated configuration
  • Fix compilation errors in examples using build tags
  • Add Makefile and documentation for improved developer experience
  • Update README with multi-schema API documentation and usage examples

Examples now support PostgreSQL schema-based tenant isolation and can be built independently using make targets.

Generic ORM version v1.0.0

Choose a tag to compare

@piyushkumar96 piyushkumar96 released this 22 Sep 17:13

Generic ORM

A comprehensive, high-level ORM wrapper for Go built on top of GORM that provides a generic interface for database operations with PostgreSQL and other SQL databases.

Full Changelog: https://github.com/piyushkumar96/generic-orm/commits/v1.0.0