Skip to content

v0.1.0-alpha.5

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 04 Dec 08:56
· 6 commits to main since this release
73893a3

Adds functions and procedures (browse, run, create from a template, edit, drop)
and the schema snapshot behind the ER diagram. Finishes phase 7: sequences and
database-level multi-region metadata have no call in the Tabularis host, so
there is nothing to wire up for them. Tested against CockroachDB v24.3 and the
latest release.

Added

  • Routine management (routine_management is now true):
    build_routine_call_sql, routine_create_template and drop_routine.
    • The call statement is SELECT * FROM schema.fn(...) for a function and
      CALL schema.proc(...) for a procedure. OUT parameters are skipped. A
      value marked raw is trusted only when it is a number, a boolean or NULL;
      anything else is quoted as text, so the value box cannot add statements.
    • The template is CREATE OR REPLACE FUNCTION or PROCEDURE in the chosen
      schema; procedures are refused before v23.2.
    • Dropping copies the argument list from the routine's own CREATE
      statement, because DROP rejects numeric for DECIMAL(10,2) and an enum
      type outside the search path. Only the chosen overload goes, and never
      with CASCADE.
    • Routine listing waits briefly while a just-dropped routine is still
      visible in the catalog, where newer servers fail with function "x" is being dropped; the host reloads the list right after a drop.
  • Routines: get_routines, get_routine_parameters and
    get_routine_definition for user-defined functions and procedures
    (v22.2+). Overloads are told apart by pg_proc OID; identity_args is
    returned as the server prints it and passed back by the host to pick one
    overload. A function's definition comes from pg_get_functiondef, a
    procedure's from SHOW CREATE PROCEDURE (pg_get_functiondef returns only
    the body for procedures on v24.3). An unknown routine is an error, not an
    empty definition.
  • Schema snapshot: get_schema_snapshot returns every table of the schema
    with its columns and foreign keys, for the ER diagram and the host's
    relationship detection.