u/nikita-volkov

🔥 Hot ▲ 93 r/SQL+2 crossposts

My 14-Year Journey Away from ORMs: a Stream of Insights Leading to Creation of a SQL-First Code Generator

Blog post about how I went from shipping a popular ORM in 2012… to throwing it all away… to realizing that the database itself should be the single source of truth.

nikita-volkov.github.io
u/nikita-volkov — 8 days ago
▲ 12 r/java

"postgresql-codecs" - driver-agnostic, type-safe codec lib for almost all PostgreSQL data types

I'm releasing postgresql-codecs.java - a tiny, zero-dependency library that provides complete, lossless Codec<A> implementations for most standard PostgreSQL types.

It supports scalars, enums, domains, JSONB, geometric/network types, arrays of any depth, ranges/multiranges, composites, hstore, tsvector, and more — in both text and binary formats. Fully roundtrip-tested against real PostgreSQL.

Why it exists

Standard JDBC and R2DBC drivers have weak support for PostgreSQL's advanced types. Composites, nested arrays, and multiranges usually mean manual PGobject work and brittle converters.

postgresql-codecs.java gives you clean, composable, type-safe codecs with minimal boilerplate.

How it came to be

While building a Java generator for pGenie (SQL to Java compiler) I needed reliable, exact representations of composites, multiranges, and other advanced types. Existing Java libraries fell short, so I ported my Haskell library postgresql-types to pure Java.

For JDBC users

Pair it with postgresql-jdbc.java for a batteries included integration.

Both libs are on Maven Central and MIT-licensed.

Feedback and PRs welcome!

Links:

u/nikita-volkov — 9 days ago