Skip to content

v0.7.0-beta.0

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 17 Sep 08:53
· 18 commits to a0a47feb437fd02ef5bc88b7f42f02949f942d58 since this release

Typed nested data, equality indexes, and in-database TypeScript procedures — plus an everyday CLI for local databases.

This is a beta. Treat it as a new on-disk format, not an in-place upgrade from 0.6.

Breaking: wipe the data directory

0.7 stores USER / SHARED / STREAM row values as compact ordinal payloads (identity stays on the RocksDB key). The server does not dual-decode 0.6 KENV / name-keyed rows.

  • Dev and test clusters: wipe the data directory before starting this binary.
  • There is no in-process cluster migration in this release. An offline rewrite tool is follow-on work.
  • HTTP, WebSocket, PGWire, and SDK payloads are unchanged.

Server functions (#380)

SQL-defined procedures run in a sandboxed V8 isolate, using the same types, row codec, and indexes as tables.

  • CREATE PROCEDURE / DROP PROCEDURE, CALL, GRANT / REVOKE EXECUTE, SECURITY INVOKER (default) and SECURITY DEFINER
  • Invoke from SQL and PGWire (CALL), HTTP (POST /v1/functions/{namespace}/{procedure}), or a topic trigger
  • Nested ctx.functions.call, transactional ctx.db.query / execute, staged ctx.topics.publish (commit flushes, rollback drops)
  • Inline JavaScript bodies, or project TypeScript compiled by kalam deploy / kalam schema gen
  • Topic payload types: CREATE TRIGGER … ON TOPIC … EXECUTE PROCEDURE with a typed PAYLOAD
  • CREATE SCHEDULE / ALTER SCHEDULE … ENABLE|DISABLE / DROP SCHEDULE (CRON or INTERVAL)
  • Catalog in information_schema / pg_catalog.pg_proc; Admin UI for procedures, logs, and schedules
  • Generated TypeScript/Dart clients from the local schema (no live server required to compile the contract)
CREATE OR REPLACE PROCEDURE app.inc(x INT)
LANGUAGE JAVASCRIPT
AS $$
  return input.x + 1;
$$;

CALL app.inc(41);

Database types (#380)

Named types are the same contract for table columns and procedure signatures.

  • CREATE TYPE … AS (…) composites, AS ENUM, and FROM TABLE row-type aliases
  • Implicit row type per table (app.users is both the table and the row type); topics catalog an implicit payload type
  • Nested STRUCT / List persist without JSON fallbacks
  • ALTER TYPE (attributes and enum values), DROP TYPE, COMMENT ON TYPE / COMMENT ON PROCEDURE
  • SET search_path (PostgreSQL spelling; USE remains an alias)
CREATE TYPE app.address AS (
  city TEXT NOT NULL,
  country TEXT NOT NULL
);

CREATE SHARED TABLE app.users (
  id TEXT PRIMARY KEY,
  name TEXT NOT NULL,
  home app.address
);

CREATE TYPE app.user FROM TABLE app.users;

Indexes on USER and SHARED tables (#380)

Scalar secondary indexes are equality prefix scans — not vector USING COSINE. They apply to USER and SHARED tables, including RLS membership lookups such as user_id.

  • CREATE INDEX / CREATE UNIQUE INDEX / DROP INDEX (also ALTER TABLE … CREATE|DROP INDEX)
  • Hot prefix seek; cold segments prune with bloom / min-max instead of scanning every flushed file
  • Round-trip through kalam schema / schema-diff (CREATE TYPE, CREATE INDEX, CREATE PROCEDURE)
CREATE INDEX idx_messages_conversation ON app.messages (conversation_id);
CREATE INDEX idx_conversation_members_user ON app.conversation_members (user_id);

Everyday CLI (#380)

kalam now covers local databases, schema, and procedures — not only the SQL shell.

Command Purpose
kalam init New app or template
kalam dev Watch schema + procedures; start/status/logs/stop a background session
kalam up / down Start / stop a local database (data kept on down)
kalam status This folder, --global, or a named --env
kalam instances Local servers and saved cloud connections (servers / list aliases)
kalam logs Server logs (-F follow); --local-file for the capture file
kalam schema gen Generate SDK types from local SQL
kalam deploy Apply migrations and activate procedures (--dry-run to validate)
kalam db migrate / reset / seed Migrations and fixtures
kalam functions build / status / revisions / rollback / logs Procedure lifecycle

--global / -g is the shared local database. --env selects a named project environment. --agent emits deterministic events for coding agents.

Also in this beta

  • Direct PostgreSQL wire: JDBC/DBeaver-style pg_catalog shims, search_path, procedure metadata, and typed CALL (#376, #380)
  • Admin UI: Functions, SQL Studio, Schedules; platform release binaries embed the UI
  • Topic consumer groups: same-group fetch no longer overlaps, skips, or redelivers in-flight / already-acked offsets
  • OIDC: JWKS rediscovery when Dex/IdP keys rotate, so invite login does not fail as “unauthorized”
  • V8 isolate reuse, worker affinity, and idle memory accounting (#381)
  • Windows MSVC link for V8 + RocksDB; kalam update can refresh CLI and managed server

Not in this beta

  • In-place upgrade of existing 0.6 data directories
  • Table AFTER ROW triggers (route writes through a topic instead)
  • Extra function runtimes (V8 only)
  • CREATE TYPE … AS UNION / INTERFACE (reserved)
  • Vector indexes answering scalar equality

See the SQL reference and CLI guide.

What's Changed

  • pgwire JDBC catalog, SQL Studio RLS policies, and CLI test-runner fixes by @jamals86 in #376
  • Optimize V8 function session memory and warm reuse by @jamals86 in #381
  • feat: 0.7 serialization, scalar indexes, and server functions by @jamals86 in #380

Full Changelog: v0.6.0-rc.0...v0.7.0-beta.0

What's Changed

  • pgwire JDBC catalog, SQL Studio RLS policies, and CLI test-runner fixes by @jamals86 in #376
  • Optimize V8 function session memory and warm reuse by @jamals86 in #381
  • feat: 0.7 serialization, scalar indexes, and server functions by @jamals86 in #380

Full Changelog: v0.6.0-rc.0...v0.7.0-beta.0