multiclient setup2

This commit is contained in:
Priec
2026-07-17 01:14:00 +02:00
parent 8b27b8b172
commit 4aed5d3022
12 changed files with 20 additions and 16 deletions

View File

@@ -1,5 +1,6 @@
pub const ERROR_REASON_METADATA_KEY: &str = "komp-ac-error-reason";
pub const EXPECTED_ROW_METADATA_KEY: &str = "komp-ac-expected-row-bin";
pub const EXPECTED_ROW_REVISION_METADATA_KEY: &str = "komp-ac-expected-row-revision";
pub const ROW_REVISION_METADATA_KEY: &str = "komp-ac-row-revision";
pub const COMPUTED_VALUE_MISMATCH_REASON: &str = "computed-value-mismatch";
pub const ROW_STALE_REASON: &str = "row-stale";
pub const ROW_ID_CONFLICT_REASON: &str = "row-id-conflict";

Binary file not shown.

View File

@@ -21,7 +21,7 @@ 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", or ending in "\_id".
/// Forbidden names: "id", "deleted", "created_at", "row_revision", or ending in "\_id".
#[prost(string, tag = "1")]
pub table_name: ::prost::alloc::string::String,
/// List of links (foreign keys) to existing tables in the same profile.
@@ -33,7 +33,7 @@ pub struct PostTableDefinitionRequest {
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") and automatically generated foreign key ("\*\_id") columns already
/// "created_at", "row_revision") and automatically generated foreign key ("\*\_id") columns already
/// have indexes. Requests trying to index those columns are rejected.
#[prost(string, repeated, tag = "4")]
pub indexes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
@@ -76,7 +76,7 @@ pub struct AddTableColumnsRequest {
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", or end with "\_id".
/// and cannot be "id", "deleted", "created_at", "row_revision", or end with "\_id".
#[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String,
/// Logical column type. Supported values (case-insensitive):

View File

@@ -10,7 +10,7 @@ pub struct PostTableScriptRequest {
pub table_definition_id: i64,
/// Required. The target column in the target table that this script computes.
/// Must be an existing user-defined column in that table (not a system column).
/// System columns are reserved: "id", "deleted", "created_at".
/// System columns are reserved: "id", "deleted", "created_at", "row_revision".
/// The column's data type must NOT be one of the prohibited target types:
/// BIGINT, DATE, TIMESTAMPTZ
/// Note: BOOLEAN targets are allowed (values are converted to Steel #true/#false).

View File

@@ -25,7 +25,7 @@ pub struct GetTableStructureResponse {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TableStructureResponse {
/// Columns of the physical table, including system columns (id, deleted,
/// created_at), user-defined columns, and any foreign-key columns such as
/// created_at, row_revision), user-defined columns, and any foreign-key columns such as
/// "\<linked_table>\_id". May be empty if the physical table is missing.
#[prost(message, repeated, tag = "1")]
pub columns: ::prost::alloc::vec::Vec<TableColumn>,

View File

@@ -149,6 +149,8 @@ pub struct RecomputedRow {
pub table_name: ::prost::alloc::string::String,
#[prost(int64, tag = "2")]
pub row_id: i64,
#[prost(int64, tag = "3")]
pub row_revision: i64,
}
/// Soft-delete a single row.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
@@ -482,7 +484,7 @@ pub mod tables_data_client {
///
/// * Validates profile and table definition
/// * Returns all columns as strings (COALESCE(col::TEXT, '') AS col)
/// including: id, deleted, all user-defined columns, and FK columns
/// including: id, deleted, row_revision, all user-defined columns, and FK columns
/// named "\<linked_table>\_id" for each table link
/// * Fails with NOT_FOUND if record does not exist or is soft-deleted
/// * If the physical table is missing but the definition exists, returns INTERNAL
@@ -674,7 +676,7 @@ pub mod tables_data_server {
///
/// * Validates profile and table definition
/// * Returns all columns as strings (COALESCE(col::TEXT, '') AS col)
/// including: id, deleted, all user-defined columns, and FK columns
/// including: id, deleted, row_revision, all user-defined columns, and FK columns
/// named "\<linked_table>\_id" for each table link
/// * Fails with NOT_FOUND if record does not exist or is soft-deleted
/// * If the physical table is missing but the definition exists, returns INTERNAL