Skip to content

v0.26.0

Choose a tag to compare

@github-actions github-actions released this 09 May 11:27
· 55 commits to main since this release
fad8fcd

Fixed

  • Schema/query mismatch now surfaces as TableNotFound instead of
    the misleading ParameterTypeNotInferred "use CAST(?) AS INTEGER"
    hint.
    When a query references a table not in schema.sql,
    oaspec generate previously failed type inference for the
    WHERE-clause placeholder ("could not infer type for parameter ?N")
    with a CAST suggestion that does not actually fix the underlying
    problem. The analyzer now checks every table the query references
    against the catalog before parameter inference runs and reports the
    first missing table name. Covers SELECT (FROM/JOIN), INSERT INTO,
    UPDATE, and DELETE; UnstructuredStatement (parser-internal fallback
    for shapes the IR does not yet model) keeps the original behavior
    to avoid false positives. (#557)
  • sqlode init stub schema now adds DEFAULT CURRENT_TIMESTAMP to
    created_at
    (across SQLite / MySQL / PostgreSQL templates) so the
    documented init → generate → gleam run happy path actually inserts
    one row. Previously the stub schema declared
    created_at TEXT NOT NULL (or DATETIME / TIMESTAMP) without a default
    while the stub CreateAuthor query only set name and bio — the
    first call to the generated create_author failed with a
    ConstraintNotnull violation. Adding DEFAULT CURRENT_TIMESTAMP
    matches the column's intent (filled by the database, not the
    application) and is uniform across the three engines. (#558)
  • sqlode init log indent: the first "Created …" line now uses the
    same two-space indent as the schema/query lines below it, so the three
    paths align in the user's terminal. (#558)

Install

Download the sqlode escript below and place it on your PATH.
Requires Erlang/OTP runtime.

chmod +x sqlode
./sqlode generate --config=sqlode.yaml