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

@@ -6,16 +6,18 @@ pub struct 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.
#[prost(string, tag = "1")]
pub table_name: ::prost::alloc::string::String,
/// List of user-defined columns (adds to system/id/fk columns).
/// The table's columns, including its links. System columns are added on top.
#[prost(message, repeated, tag = "3")]
pub columns: ::prost::alloc::vec::Vec<ColumnDefinition>,
/// 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.
#[prost(string, repeated, tag = "4")]
pub indexes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
/// Name of profile (Postgres schema) where the table will be created.
@@ -106,9 +108,13 @@ pub struct AddTableColumnsRequest {
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct 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.
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Logical column type. Supported values (case-insensitive):