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

2
client

Submodule client updated: 5ad6b46ffe...d0bd9dce45

View File

@@ -57,7 +57,7 @@ message PostTableDefinitionRequest {
// Table name to create inside the target profile. // Table name to create inside the target profile.
// Must be lowercase, alphanumeric with underscores, // Must be lowercase, alphanumeric with underscores,
// start with a letter, and be <= 63 chars. // 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".
string table_name = 1; string table_name = 1;
// List of links (foreign keys) to existing tables in the same profile. // List of links (foreign keys) to existing tables in the same profile.
@@ -69,7 +69,7 @@ message PostTableDefinitionRequest {
// List of column names to be indexed (must match existing user-defined columns). // List of column names to be indexed (must match existing user-defined columns).
// Indexes can target only user-defined columns; system columns ("id", "deleted", // 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. // have indexes. Requests trying to index those columns are rejected.
repeated string indexes = 4; repeated string indexes = 4;
@@ -114,7 +114,7 @@ enum MoneyRounding {
message ColumnDefinition { message ColumnDefinition {
// Column name that follows the same validation rules as table_name. // Column name that follows the same validation rules as table_name.
// Must be lowercase, start with a letter, no uppercase characters, // 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".
string name = 1; string name = 1;
// Logical column type. Supported values (case-insensitive): // Logical column type. Supported values (case-insensitive):

View File

@@ -56,7 +56,7 @@ message PostTableScriptRequest {
// Required. The target column in the target table that this script computes. // 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). // 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: // The column's data type must NOT be one of the prohibited target types:
// BIGINT, DATE, TIMESTAMPTZ // BIGINT, DATE, TIMESTAMPTZ
// Note: BOOLEAN targets are allowed (values are converted to Steel #true/#false). // Note: BOOLEAN targets are allowed (values are converted to Steel #true/#false).

View File

@@ -45,7 +45,7 @@ message GetTableStructureResponse {
// Response with the ordered list of columns (by ordinal position) for one table. // Response with the ordered list of columns (by ordinal position) for one table.
message TableStructureResponse { message TableStructureResponse {
// Columns of the physical table, including system columns (id, deleted, // 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. // "<linked_table>_id". May be empty if the physical table is missing.
repeated TableColumn columns = 1; repeated TableColumn columns = 1;
} }

View File

@@ -61,7 +61,7 @@ service TablesData {
// Behavior: // Behavior:
// - Validates profile and table definition // - Validates profile and table definition
// - Returns all columns as strings (COALESCE(col::TEXT, '') AS col) // - 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 // named "<linked_table>_id" for each table link
// - Fails with NOT_FOUND if record does not exist or is soft-deleted // - 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 // - If the physical table is missing but the definition exists, returns INTERNAL
@@ -210,6 +210,7 @@ message PutTableDataResponse {
message RecomputedRow { message RecomputedRow {
string table_name = 1; string table_name = 1;
int64 row_id = 2; int64 row_id = 2;
int64 row_revision = 3;
} }
// Soft-delete a single row. // Soft-delete a single row.

View File

@@ -1,5 +1,6 @@
pub const ERROR_REASON_METADATA_KEY: &str = "komp-ac-error-reason"; 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 COMPUTED_VALUE_MISMATCH_REASON: &str = "computed-value-mismatch";
pub const ROW_STALE_REASON: &str = "row-stale"; pub const ROW_STALE_REASON: &str = "row-stale";
pub const ROW_ID_CONFLICT_REASON: &str = "row-id-conflict"; 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. /// Table name to create inside the target profile.
/// Must be lowercase, alphanumeric with underscores, /// Must be lowercase, alphanumeric with underscores,
/// start with a letter, and be \<= 63 chars. /// 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")] #[prost(string, tag = "1")]
pub table_name: ::prost::alloc::string::String, pub table_name: ::prost::alloc::string::String,
/// List of links (foreign keys) to existing tables in the same profile. /// 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>, pub columns: ::prost::alloc::vec::Vec<ColumnDefinition>,
/// List of column names to be indexed (must match existing user-defined columns). /// List of column names to be indexed (must match existing user-defined columns).
/// Indexes can target only user-defined columns; system columns ("id", "deleted", /// 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. /// have indexes. Requests trying to index those columns are rejected.
#[prost(string, repeated, tag = "4")] #[prost(string, repeated, tag = "4")]
pub indexes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, pub indexes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
@@ -76,7 +76,7 @@ pub struct AddTableColumnsRequest {
pub struct ColumnDefinition { pub struct ColumnDefinition {
/// Column name that follows the same validation rules as table_name. /// Column name that follows the same validation rules as table_name.
/// Must be lowercase, start with a letter, no uppercase characters, /// 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")] #[prost(string, tag = "1")]
pub name: ::prost::alloc::string::String, pub name: ::prost::alloc::string::String,
/// Logical column type. Supported values (case-insensitive): /// Logical column type. Supported values (case-insensitive):

View File

@@ -10,7 +10,7 @@ pub struct PostTableScriptRequest {
pub table_definition_id: i64, pub table_definition_id: i64,
/// Required. The target column in the target table that this script computes. /// 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). /// 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: /// The column's data type must NOT be one of the prohibited target types:
/// BIGINT, DATE, TIMESTAMPTZ /// BIGINT, DATE, TIMESTAMPTZ
/// Note: BOOLEAN targets are allowed (values are converted to Steel #true/#false). /// 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)] #[derive(Clone, PartialEq, ::prost::Message)]
pub struct TableStructureResponse { pub struct TableStructureResponse {
/// Columns of the physical table, including system columns (id, deleted, /// 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. /// "\<linked_table>\_id". May be empty if the physical table is missing.
#[prost(message, repeated, tag = "1")] #[prost(message, repeated, tag = "1")]
pub columns: ::prost::alloc::vec::Vec<TableColumn>, pub columns: ::prost::alloc::vec::Vec<TableColumn>,

View File

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

2
server

Submodule server updated: c5a374ac1a...3fef1dbed5