multirow FK
This commit is contained in:
Binary file not shown.
@@ -1,19 +1,4 @@
|
||||
// This file is @generated by prost-build.
|
||||
/// A single link to another table within the same profile (schema).
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
|
||||
pub struct TableLink {
|
||||
/// Name of an existing table within the same profile to link to.
|
||||
/// For each link, a "<linked>\_id" column is created on the new table.
|
||||
/// That column references "<linked>"(id) and adds an index automatically.
|
||||
#[prost(string, tag = "1")]
|
||||
pub linked_table_name: ::prost::alloc::string::String,
|
||||
/// If true, the generated foreign key column is NOT NULL.
|
||||
/// Otherwise the column allows NULL.
|
||||
/// Duplicate links to the same target table in one request are rejected.
|
||||
#[prost(bool, tag = "2")]
|
||||
pub required: bool,
|
||||
}
|
||||
/// Defines the input for creating a new table definition.
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||
@@ -24,10 +9,6 @@ pub struct PostTableDefinitionRequest {
|
||||
/// 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.
|
||||
/// Each will automatically get a "<linked>\_id" column and an index.
|
||||
#[prost(message, repeated, tag = "2")]
|
||||
pub links: ::prost::alloc::vec::Vec<TableLink>,
|
||||
/// List of user-defined columns (adds to system/id/fk columns).
|
||||
#[prost(message, repeated, tag = "3")]
|
||||
pub columns: ::prost::alloc::vec::Vec<ColumnDefinition>,
|
||||
@@ -153,6 +134,9 @@ pub struct ColumnDefinition {
|
||||
/// DURATION
|
||||
/// PERIOD
|
||||
/// DECIMAL(p,s) → NUMERIC(p,s)
|
||||
/// LINK(table) → BIGINT referencing that table in the same profile, indexed
|
||||
/// automatically. A table may hold several links to the same
|
||||
/// target as long as the columns are named differently.
|
||||
/// DECIMAL args must be integers (no sign, no dot, no leading zeros);
|
||||
/// s ≤ p and p ≥ 1.
|
||||
#[prost(string, tag = "2")]
|
||||
@@ -486,6 +470,11 @@ pub enum ColumnTypeSpelling {
|
||||
/// at least 1 and scale no greater than precision; neither may carry a sign,
|
||||
/// a decimal point, or leading zeros.
|
||||
Decimal = 1,
|
||||
/// The name takes the name of another table in the same profile:
|
||||
/// "link(adresar)". The column holds that table's id, and the server creates
|
||||
/// the foreign key and its index. A picker offers the profile's other tables
|
||||
/// as the argument.
|
||||
Link = 2,
|
||||
}
|
||||
impl ColumnTypeSpelling {
|
||||
/// String value of the enum field names used in the ProtoBuf definition.
|
||||
@@ -496,6 +485,7 @@ impl ColumnTypeSpelling {
|
||||
match self {
|
||||
Self::Bare => "COLUMN_TYPE_SPELLING_BARE",
|
||||
Self::Decimal => "COLUMN_TYPE_SPELLING_DECIMAL",
|
||||
Self::Link => "COLUMN_TYPE_SPELLING_LINK",
|
||||
}
|
||||
}
|
||||
/// Creates an enum from field names used in the ProtoBuf definition.
|
||||
@@ -503,6 +493,7 @@ impl ColumnTypeSpelling {
|
||||
match value {
|
||||
"COLUMN_TYPE_SPELLING_BARE" => Some(Self::Bare),
|
||||
"COLUMN_TYPE_SPELLING_DECIMAL" => Some(Self::Decimal),
|
||||
"COLUMN_TYPE_SPELLING_LINK" => Some(Self::Link),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user