← All Insights

PRIMESHIFT INSIGHTS · May 8, 2026

MikroORM v7.2 (‘Unchained’) Decouples Knex, Drops Deps to Zero & Embeds Native Postgres RLS

After breaking free of Knex in March's MikroORM 7.0, versions 7.1 and 7.2 deliver entity-level PostgreSQL Row-Level Security, database triggers, and PGlite tests.

Isolated multi-region VPC security and cryptographic shield diagram
FRI, MAY 8, 2026·6 min read·Databases & ORMs·Release #23 · Software Releases
Release #23 · Key Impact: Zero core external runtime dependencies plus declarative multi-tenant Postgres RLS policies

Release Context & Why This Matters

In March 2026, MikroORM shipped its largest overhaul ever: v7.0 'Unchained' severed internal coupling to Knex, embraced native ESM, introduced polymorphic relations and table-per-type inheritance, and brought core runtime dependencies all the way down to zero.

Summer and autumn point releases—MikroORM 7.1 and 7.2—pushed PostgreSQL schema governance even further: teams can now declare PostgreSQL Row-Level Security (RLS) policies, partitioning clauses, and database triggers right alongside @Entity() metadata.

Technical Mechanics & Reference Code

Testing migration suites also became nearly instant thanks to built-in PGlite WASM driver integration, letting CI suites run full PostgreSQL migrations and RLS isolation tests in-memory without Docker-in-Docker lag.

@Entity()
@Policy({ name: 'tenant_isolation', using: "tenant_id = current_setting('app.tenant_id')::uuid" })
export class ClinicalOrder {
  @PrimaryKey({ type: 'uuid' }) id!: string;
  @Property({ type: 'uuid' }) tenantId!: string;
}

Verified Operational Benchmarks

Data architects building Unit-of-Work Identity Map microservices on PostgreSQL gain Kysely optional raw-SQL escape hatches without sacrificing strict transactional identity tracking.

  • Primary Delta: Zero core external runtime dependencies plus declarative multi-tenant Postgres RLS policies
  • Reliability Gate: Self-contained query builder with optional Kysely runner and native ESM packaging
  • Ownership Boundary: 100% client-owned infrastructure & upgrade tooling verified by Randeep Kaur

Adoption & Upgrade Checklist

  • Run PGlite integration specs for MikroORM 7.2 RLS policies inside every pull request.
  • Audit custom Knex raw migration hooks when upgrading repositories cleanly from MikroORM v6.
  • Leverage Kysely runner integration for multi-table analytical joins inside Unit-of-Work boundaries.
About the Author

Randeep Kaur

Lead Technical Editor & Engineering Research Correspondent

Lead Technical Editor directing systems architecture dispatches, AI deterministic evaluation research, regulated cloud compliance analyses, and weekly engineering briefings at PrimeShift Digital.

Read All Stories by Randeep Kaur →

In This Dispatch

Evaluating this architecture inside your production stack?

Our Principal Engineering Desk runs two-week topology audits directly inside your organization cloud & GitHub repos.