fixing regex error
This commit is contained in:
29
server/src/steel/docs/script_refering_different_table.txt
Normal file
29
server/src/steel/docs/script_refering_different_table.txt
Normal file
@@ -0,0 +1,29 @@
|
||||
Creation of the tables:
|
||||
|
||||
❯ grpcurl -plaintext -d '{
|
||||
"table_name": "department",
|
||||
"columns": [
|
||||
{"name": "yearly_goal", "field_type": "text"}
|
||||
],
|
||||
"profile_name": "finance"
|
||||
}' localhost:50051 multieko2.table_definition.TableDefinition/PostTableDefinition
|
||||
{
|
||||
"success": true,
|
||||
"sql": "CREATE TABLE \"2025_department\" (\n id BIGSERIAL PRIMARY KEY,\n deleted BOOLEAN NOT NULL DEFAULT FALSE,\n \"yearly_goal\" TEXT,\n created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP\n)\n"
|
||||
}
|
||||
❯ grpcurl -plaintext -d '{
|
||||
"table_name": "project",
|
||||
"columns": [
|
||||
{"name": "name", "field_type": "TEXT"},
|
||||
{"name": "budget_estimate", "field_type": "TEXT"}
|
||||
],
|
||||
"indexes": ["name"],
|
||||
"profile_name": "finance",
|
||||
"links": [
|
||||
{"linked_table_name": "2025_department", "required": true}
|
||||
]
|
||||
}' localhost:50051 multieko2.table_definition.TableDefinition/PostTableDefinition
|
||||
{
|
||||
"success": true,
|
||||
"sql": "CREATE TABLE \"2025_project\" (\n id BIGSERIAL PRIMARY KEY,\n deleted BOOLEAN NOT NULL DEFAULT FALSE,\n \"department_id\" BIGINT NOT NULL REFERENCES \"2025_department\"(id),\n \"name\" TEXT,\n \"budget_estimate\" TEXT,\n created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP\n)\nCREATE INDEX idx_2025_project_department_fk ON \"2025_project\" (\"department_id\")\nCREATE INDEX idx_2025_project_name ON \"2025_project\" (\"name\")"
|
||||
}
|
||||
@@ -15,7 +15,7 @@ impl SyntaxParser {
|
||||
column_access_re: Regex::new(r"@(\w+)").unwrap(),
|
||||
relationship_re: Regex::new(r"@(\w+)\.(\w+)").unwrap(),
|
||||
indexed_access_re: Regex::new(r"@(\w+)\[(\d+)\]\.(\w+)").unwrap(),
|
||||
sql_integration_re: Regex::new(r#"@sql\((["'])(.*?)\1\)"#).unwrap(),
|
||||
sql_integration_re: Regex::new(r#"@sql\((['"])(.*?)['"]\)"#).unwrap(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user