Repository navigation
v0.1.0-alpha.5
Pre-release
Pre-release
·
6 commits
to main
since this release
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_managementis nowtrue):
build_routine_call_sql,routine_create_templateanddrop_routine.- The call statement is
SELECT * FROM schema.fn(...)for a function and
CALL schema.proc(...)for a procedure.OUTparameters are skipped. A
value marked raw is trusted only when it is a number, a boolean orNULL;
anything else is quoted as text, so the value box cannot add statements. - The template is
CREATE OR REPLACE FUNCTIONorPROCEDUREin the chosen
schema; procedures are refused before v23.2. - Dropping copies the argument list from the routine's own
CREATE
statement, becauseDROPrejectsnumericforDECIMAL(10,2)and an enum
type outside the search path. Only the chosen overload goes, and never
withCASCADE. - Routine listing waits briefly while a just-dropped routine is still
visible in the catalog, where newer servers fail withfunction "x" is being dropped; the host reloads the list right after a drop.
- The call statement is
- Routines:
get_routines,get_routine_parametersand
get_routine_definitionfor user-defined functions and procedures
(v22.2+). Overloads are told apart bypg_procOID;identity_argsis
returned as the server prints it and passed back by the host to pick one
overload. A function's definition comes frompg_get_functiondef, a
procedure's fromSHOW CREATE PROCEDURE(pg_get_functiondefreturns only
the body for procedures on v24.3). An unknown routine is an error, not an
empty definition. - Schema snapshot:
get_schema_snapshotreturns every table of the schema
with its columns and foreign keys, for the ER diagram and the host's
relationship detection.