This commit is contained in:
Priec
2026-08-08 12:40:42 +02:00
parent 5be1a5c661
commit 751bfd9226
12 changed files with 91 additions and 36 deletions

View File

@@ -53,16 +53,18 @@ message PostTableDefinitionRequest {
// Table name to create inside the target profile.
// Must be lowercase, alphanumeric with underscores,
// start with a letter, and be <= 63 chars.
// Forbidden names: "id", "deleted", "created_at", "row_revision", or ending in "_id".
// Forbidden names: "id", "deleted", "created_at", "row_revision" -- the
// system columns, which share one namespace with table names wherever the
// two are named side by side. The "_id" suffix is allowed.
string table_name = 1;
// List of user-defined columns (adds to system/id/fk columns).
// The table's columns, including its links. System columns are added on top.
repeated ColumnDefinition columns = 3;
// List of column names to be indexed (must match existing user-defined columns).
// Indexes can target only user-defined columns; system columns ("id", "deleted",
// "created_at", "row_revision") and automatically generated foreign key ("*_id") columns already
// have indexes. Requests trying to index those columns are rejected.
// Column names to index, matching names declared above. System columns
// ("id", "deleted", "created_at", "row_revision") already have indexes, and
// a LINK column is indexed when it is created. Requests naming either are
// rejected.
repeated string indexes = 4;
// Name of profile (Postgres schema) where the table will be created.
@@ -142,9 +144,13 @@ enum MoneyRounding {
// Describes one user-defined column for a table.
message ColumnDefinition {
// Column name that follows the same validation rules as table_name.
// Must be lowercase, start with a letter, no uppercase characters,
// and cannot be "id", "deleted", "created_at", "row_revision", or end with "_id".
// Must be lowercase, start with a letter, and use only lowercase letters,
// digits and underscores.
//
// Cannot be "id", "deleted", "created_at" or "row_revision": those are
// system columns, and a data request names system and user columns in one
// namespace. Any other name is free, including one ending in "_id" -- no
// column name is derived from a table name, so nothing collides.
string name = 1;
// Logical column type. Supported values (case-insensitive):