Skip to content

Releases: turnerrainer/Resql

v0.1.0-alpha.2 — atomic /batch, native PG arrays, @transactional marker, Java-compat

Choose a tag to compare

@turnerrainer turnerrainer released this 05 Aug 09:03
d98f195

Second pre-release of Resql — significant correctness + compatibility improvements over alpha.1.

Images

Multi-arch (linux/amd64, linux/arm64), cosign-signed keyless via GHA OIDC.

  • docker.io/turnerrainer/resql:0.1.0-alpha.2 (pinned)
  • docker.io/turnerrainer/resql:alpha (rolling — moves forward with each alpha)
  • ghcr.io/turnerrainer/resql:0.1.0-alpha.2
  • ghcr.io/turnerrainer/resql:alpha

Manifest digest: sha256:ee5b85d93786c1c1107a1d465587a8d9449f1cc1adbfea651870a52f97546f1e

Headline changes

/batch is now atomic (task 007)

The batch endpoint runs all iterations inside one database transaction. Any failure rolls the entire batch back — no partial writes. Missing-parameter checks run against every set BEFORE the transaction opens for fail-fast.

# If iteration 2 violates a UNIQUE constraint, iterations 1 AND 3 are rolled back too.
curl -X POST http://localhost:8080/crm/users/create/batch \
     -H 'content-type: application/json' \
     -d '{\"queries\":[{\"login\":\"a\"},{\"login\":\"a\"},{\"login\":\"c\"}]}'
# → 400; subsequent SELECT sees zero of these rows.

Native Postgres array binding (task 007)

Homogeneous scalar JSON arrays now bind as native Postgres arrays (text[], int8[], float8[], bool[]) so a single SQL statement using unnest() handles the whole set in one round-trip.

-- one INSERT, N rows
INSERT INTO audit_log (actor, action)
SELECT unnest(:actors), unnest(:actions) RETURNING id;

Nulls inside a homogeneous array become SQL NULL elements. Mixed / nested / all-null / empty arrays fall back to JSONB. SQLite continues to bind arrays as JSON strings — use json_each() to unpack.

-- @transactional marker (task 003)

Any SQL file whose leading comment block contains -- @transactional now executes inside a transaction (commit on success, rollback on error). Applies to GET + POST; primary use is multi-statement POST files.

-- @transactional
INSERT INTO audit_log (actor, action) VALUES (:actor, :action);
UPDATE users SET last_seen = now() WHERE id = :user_id;

Java Resql compatibility layer

  • Reads Java-shape config files (application.yml, application-{prod,dev,test}.yml) at boot, translates Spring keys to Resql config, and logs diagnostics for anything unsupported.
  • Auto-discovers /app/resql.yaml, ./resql.yaml, ./application*.yml at boot — first hit wins.
  • /health and /datasources responses now use Java-canonical field names (jdbcUrl, driverClassName, packagingTime) so existing Spring-era dashboards keep working. Note: /health.version is v{MAJOR}.{MINOR}.{PATCH} (pre-release metadata stripped) to match Java's HeartBeatService; distinguish alpha releases via the Docker image tag.

Coverage

144 tests pass (up from 133 in alpha.1) — 76 unit + 68 integration including 24 Postgres integration tests exercising the new atomicity + array binding + transactional-marker paths.

Docs

Full changelog

https://github.com/turnerrainer/Resql/blob/dev/CHANGELOG.md#0102---2026-08-05

Known limitations (still)

v0.1.0-alpha.1 — initial pre-release

Pre-release

Choose a tag to compare

@turnerrainer turnerrainer released this 05 Aug 02:13

First public pre-release of Resql — a Rust rewrite of the Bürokratt Resql Spring Boot service. Interface-compatible: SQL files under sql/<project>/<GET|POST>/<name>.sql become REST endpoints at <METHOD> /<project>/<name>, :named parameters bind from JSON body / query string, results are snake→camel renamed.

Images

Multi-arch (linux/amd64, linux/arm64), cosign-signed keyless via GHA OIDC.

  • docker.io/turnerrainer/resql:0.1.0-alpha.1 (pinned)
  • docker.io/turnerrainer/resql:alpha (rolling — will move to alpha.2)
  • ghcr.io/turnerrainer/resql:0.1.0-alpha.1
  • ghcr.io/turnerrainer/resql:alpha

Manifest digest: sha256:bc61186507fed280684ff69304fd227cd6a8e06769e6e345fa2f8195383a60bc

Quick start

docker run --rm -p 8080:8080 turnerrainer/resql:0.1.0-alpha.1
curl http://localhost:8080/health
curl "http://localhost:8080/users/hello?name=world"

What's fixed vs JVM Resql

  • Multi-database routing works out of the box (shipped resql.yaml wires two datasources).
  • Startup refuses to boot on any misconfigured datasource.
  • Config file never holds passwords — env-var references only.
  • Body-size cap (default 1 MiB, structured 413 on overflow).
  • Cold-start ~15 MB / <100 ms (vs ~180 MB / ~4 s on JVM).

Docs

Full documentation: https://turnerrainer.github.io/Resql/

Known limitations (alpha caveats)

Full changelog: https://github.com/turnerrainer/Resql/blob/dev/CHANGELOG.md