docs of delete tables made by gRPC
This commit is contained in:
67
server/src/table_definition/docs/delete_tables.txt
Normal file
67
server/src/table_definition/docs/delete_tables.txt
Normal file
@@ -0,0 +1,67 @@
|
||||
❯ grpcurl -plaintext -d '{
|
||||
"table_name": "company_data1",
|
||||
"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": ""
|
||||
}' localhost:50051 multieko2.table_definition.TableDefinition/PostTableDefinition
|
||||
ERROR:
|
||||
Code: NotFound
|
||||
Message: Linked table not found in profile
|
||||
❯ grpcurl -plaintext -d '{
|
||||
"table_name": "company_data1",
|
||||
"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"
|
||||
}' localhost:50051 multieko2.table_definition.TableDefinition/PostTableDefinition
|
||||
{
|
||||
"success": true,
|
||||
"sql": "CREATE TABLE \"2025_company_data1\" (\n id BIGSERIAL PRIMARY KEY,\n deleted BOOLEAN NOT NULL DEFAULT FALSE,\n firma TEXT NOT NULL,\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_data1_firma ON \"2025_company_data1\" (firma)\nCREATE INDEX idx_2025_company_data1_company_name ON \"2025_company_data1\" (\"company_name\")\nCREATE INDEX idx_2025_company_data1_is_active ON \"2025_company_data1\" (\"is_active\")"
|
||||
}
|
||||
❯ grpcurl -plaintext -d '{}' localhost:50051 multieko2.table_definition.TableDefinition/GetProfileTree
|
||||
{
|
||||
"profiles": [
|
||||
{
|
||||
"name": "default",
|
||||
"tables": [
|
||||
{
|
||||
"name": "2025_company_data1"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
❯ grpcurl -plaintext -d '{
|
||||
"profile_name": "default",
|
||||
"table_name": "2025_company_data1"
|
||||
}' localhost:50051 multieko2.table_definition.TableDefinition/DeleteTable
|
||||
{
|
||||
"success": true,
|
||||
"message": "Table '2025_company_data1' and its definition were successfully removed"
|
||||
}
|
||||
❯ grpcurl -plaintext -d '{}' localhost:50051 multieko2.table_definition.TableDefinition/GetProfileTree
|
||||
{}
|
||||
╭─ ~/Doc/pr/multieko2/server main ⇡1 ········· ✔
|
||||
╰─
|
||||
Reference in New Issue
Block a user