tsloughter/pg_types
65.1
Adequate · 2 October 2026
1.6k
lines of production code
Erlang
primary language
2
measurements over time
What this system is
This system is an Erlang library named pg\_types that provides an OTP-based interface for encoding and decoding PostgreSQL data types. It supports a wide range of basic, composite, and geometric types, including configurable handling for enums, JSON, and timestamps. The library manages type metadata via ETS tables and includes comprehensive test coverage for its codec implementations.
Features
Add pg\_types.hrl record definition for type metadata
The include directory now contains pg\_types.hrl, which defines the \#type\_info record used to store PostgreSQL type metadata. This record includes fields for OID, module, configuration, pool, name, send/receive functions, length, input/output functions, element OID, base OID, and component OIDs/types, providing the structural basis for type handling in the application.
include · high confidence
Initial support for encoding and decoding PostgreSQL data types
This release adds the core type-handling modules for the \pg\_types\ library, enabling the encoding and decoding of a wide range of PostgreSQL data types. The new modules cover basic types (int2, int4, int8, float4, float8, boolean, date, time, timestamp, timestamptz, interval, oid, name, bit\_string, macaddr), composite and complex types (array, record, range, hstore, json, jsonb, tsvector), and geometric types (point, line, line\_segment, path, polygon, circle). It also introduces support for infinity and NaN values in floating-point types, configurable enum encoding/decoding (including atom support), and configurable JSON library integration for json/jsonb types.
src · high confidence
Behavioural changes
Library renamed to pg\_types with new configuration and type support
The library has been renamed from epq\_datatypes to pg\_types and now provides an OTP-based interface for encoding and decoding PostgreSQL data types. Users can now configure enum handling to convert values to atoms (including existing atoms), return timestamps as Erlang system time, and use the new \pg\_types:update/3\ API to populate type information into an ETS table. The update also adds support for new data types including tsvector, tid, bit\_string, records/composite types, and geometric types (circle, line, line\_segment, path, polygon).
(repo-wide) · high confidence
Test coverage
Added property-based and unit tests for PostgreSQL data type codecs
Added comprehensive test coverage for the library's encoding and decoding logic across a wide range of PostgreSQL data types. The new test suite includes property-based tests (using the Proper library) for binary, boolean, float (including NaN and infinity), geometry (point, line, path, polygon, circle), hstore, IP addresses (IPv4/IPv6 and CIDR), integers (16/32/64-bit), JSON/JSONB (including custom compressed configurations), MAC addresses, names, time, timestamps, timestamp with time zones (including UTC offset handling), tsvector, and UUIDs (binary, string, and integer formats). Additionally, unit tests were added to verify specific timestamp with time zone offset conversions.
test · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 65 → 65 (+0.0)
- Rubric changed (rubric-2026.09.12 → rubric-2026.09.18) — scores are not directly comparable.
Lenses
- Code Health 98 → 98 (+0.0)
- Architecture 100 → 100 (+0.0)
- Maturity 47 → 47 (+0.0)
- Readiness 64 → 64 (+0.0)
- Security 100 → 100 (+0.0)
Resolved (2)
- Coverage not measured — no coverage collector is wired up
- Documentation: no architecture or design documentation (README.md)
New (1)
- Dependency hygiene PARTLY measured — rebar3 pinning read, dependency currency not (no rebar.lock-pinned Hex declaration to grade)
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
tsloughter/pg_types was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 2 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 0512be86d9a960f96e28778730ec92d230aa4858 — the exact code this score is about.
- Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-e569280dd5e2.