107 lines
6.5 KiB
Plaintext
107 lines
6.5 KiB
Plaintext
❯ grpcurl -plaintext -d '{
|
||
"table_name": "company_data3",
|
||
"columns": [
|
||
{"name": "company_name", "field_type": "text"},
|
||
{"name": "textfield", "field_type": "text"},
|
||
{"name": "textfield2", "field_type": "text"},
|
||
{"name": "textfield3", "field_type": "text"},
|
||
{"name": "headquarters_psc", "field_type": "psc"},
|
||
{"name": "contact_phone", "field_type": "phone"},
|
||
{"name": "office_address", "field_type": "address"},
|
||
{"name": "support_email", "field_type": "email"},
|
||
{"name": "is_active", "field_type": "boolean"},
|
||
{"name": "last_updated", "field_type": "timestamp"}
|
||
],
|
||
"indexes": ["company_name", "is_active"],
|
||
"profile_name": "default",
|
||
"linked_table_name": "ud_2025_test_table"
|
||
}' localhost:50051 multieko2.table_definition.TableDefinition/PostTableDefinition
|
||
{
|
||
"success": true,
|
||
"sql": "CREATE TABLE \"2025_company_data3\" (\n id BIGSERIAL PRIMARY KEY,\n deleted BOOLEAN NOT NULL DEFAULT FALSE,\n firma TEXT NOT NULL,\n \"2025_test_table_id\" BIGINT NOT NULL REFERENCES \"ud_2025_test_table\"(id),\n \"company_name\" TEXT,\n \"textfield\" TEXT,\n \"textfield2\" TEXT,\n \"textfield3\" TEXT,\n \"headquarters_psc\" TEXT,\n \"contact_phone\" VARCHAR(15),\n \"office_address\" TEXT,\n \"support_email\" VARCHAR(255),\n \"is_active\" BOOLEAN,\n \"last_updated\" TIMESTAMPTZ,\n created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP\n)\nCREATE INDEX idx_2025_company_data3_firma ON \"2025_company_data3\" (firma)\nCREATE INDEX idx_2025_company_data3_2025_test_table_id ON \"2025_company_data3\" (\"2025_test_table_id\")"
|
||
}
|
||
❯ psql -U multi_psql_dev -d multi_rust_dev
|
||
psql (17.2)
|
||
Type "help" for help.
|
||
|
||
multi_rust_dev=> \dt
|
||
List of relations
|
||
Schema | Name | Type | Owner
|
||
--------+--------------------------------+-------+----------------
|
||
public | 2025_company_data | table | multi_psql_dev
|
||
public | 2025_company_data3 | table | multi_psql_dev
|
||
public | 2025_multi_dependent_table3 | table | multi_psql_dev
|
||
public | 2025_multi_dependent_table4 | table | multi_psql_dev
|
||
public | 2025_multi_dependent_table5 | table | multi_psql_dev
|
||
public | _sqlx_migrations | table | multi_psql_dev
|
||
public | adresar | table | multi_psql_dev
|
||
public | profiles | table | multi_psql_dev
|
||
public | table_definitions | table | multi_psql_dev
|
||
public | uctovnictvo | table | multi_psql_dev
|
||
public | ud_2025_linked_test_table | table | multi_psql_dev
|
||
public | ud_2025_linked_test_table2 | table | multi_psql_dev
|
||
public | ud_2025_linked_test_table3 | table | multi_psql_dev
|
||
public | ud_2025_multi_dependent_table | table | multi_psql_dev
|
||
public | ud_2025_multi_dependent_table2 | table | multi_psql_dev
|
||
public | ud_2025_profile_table | table | multi_psql_dev
|
||
public | ud_2025_test_table | table | multi_psql_dev
|
||
public | ud_2025_test_table_no_linked | table | multi_psql_dev
|
||
(18 rows)
|
||
|
||
multi_rust_dev=> \d adresar
|
||
Table "public.adresar"
|
||
Column | Type | Collation | Nullable | Default
|
||
------------+--------------------------+-----------+----------+-------------------------------------
|
||
id | bigint | | not null | nextval('adresar_id_seq'::regclass)
|
||
deleted | boolean | | not null | false
|
||
firma | text | | not null |
|
||
kz | text | | |
|
||
drc | text | | |
|
||
ulica | text | | |
|
||
psc | text | | |
|
||
mesto | text | | |
|
||
stat | text | | |
|
||
banka | text | | |
|
||
ucet | text | | |
|
||
skladm | text | | |
|
||
ico | text | | |
|
||
kontakt | text | | |
|
||
telefon | text | | |
|
||
skladu | text | | |
|
||
fax | text | | |
|
||
created_at | timestamp with time zone | | | CURRENT_TIMESTAMP
|
||
Indexes:
|
||
"adresar_pkey" PRIMARY KEY, btree (id)
|
||
"idx_adresar_firma" btree (firma)
|
||
"idx_adresar_mesto" btree (mesto)
|
||
Referenced by:
|
||
TABLE "uctovnictvo" CONSTRAINT "uctovnictvo_adresar_id_fkey" FOREIGN KEY (adresar_id) REFERENCES adresar(id)
|
||
|
||
multi_rust_dev=> \d 2025_company_data3
|
||
Table "public.2025_company_data3"
|
||
Column | Type | Collation | Nullable | Default
|
||
--------------------+--------------------------+-----------+----------+--------------------------------------------------
|
||
id | bigint | | not null | nextval('"2025_company_data3_id_seq"'::regclass)
|
||
deleted | boolean | | not null | false
|
||
firma | text | | not null |
|
||
2025_test_table_id | bigint | | not null |
|
||
company_name | text | | |
|
||
textfield | text | | |
|
||
textfield2 | text | | |
|
||
textfield3 | text | | |
|
||
headquarters_psc | text | | |
|
||
contact_phone | character varying(15) | | |
|
||
office_address | text | | |
|
||
support_email | character varying(255) | | |
|
||
is_active | boolean | | |
|
||
last_updated | timestamp with time zone | | |
|
||
created_at | timestamp with time zone | | | CURRENT_TIMESTAMP
|
||
Indexes:
|
||
"2025_company_data3_pkey" PRIMARY KEY, btree (id)
|
||
"idx_2025_company_data3_2025_test_table_id" btree ("2025_test_table_id")
|
||
"idx_2025_company_data3_firma" btree (firma)
|
||
Foreign-key constraints:
|
||
"2025_company_data3_2025_test_table_id_fkey" FOREIGN KEY ("2025_test_table_id") REFERENCES ud_2025_test_table(id)
|
||
|
||
multi_rust_dev=>
|