sqlx prepare2

This commit is contained in:
Priec
2026-08-19 12:26:20 +02:00
parent d6f2e6b0a4
commit e3578f5413
23 changed files with 1 additions and 960 deletions

View File

@@ -1,76 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "\n SELECT td.id, td.table_name, td.columns, td.schema_id,\n s.name AS schema_name\n FROM table_definitions td\n JOIN schemas s ON s.id = td.schema_id\n WHERE td.id = $1\n FOR UPDATE OF td\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Int8",
"origin": {
"Table": {
"table": "table_definitions",
"name": "id"
}
}
},
{
"ordinal": 1,
"name": "table_name",
"type_info": "Text",
"origin": {
"Table": {
"table": "table_definitions",
"name": "table_name"
}
}
},
{
"ordinal": 2,
"name": "columns",
"type_info": "Jsonb",
"origin": {
"Table": {
"table": "table_definitions",
"name": "columns"
}
}
},
{
"ordinal": 3,
"name": "schema_id",
"type_info": "Int8",
"origin": {
"Table": {
"table": "table_definitions",
"name": "schema_id"
}
}
},
{
"ordinal": 4,
"name": "schema_name",
"type_info": "Text",
"origin": {
"Table": {
"table": "schemas",
"name": "name"
}
}
}
],
"parameters": {
"Left": [
"Int8"
]
},
"nullable": [
false,
false,
false,
false,
false
]
},
"hash": "17836f6796fd1e20bd617fdef33eeaccc5a228189424edc4c79962ac8083e6e3"
}

View File

@@ -1,28 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "SELECT id FROM schemas WHERE name = $1",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Int8",
"origin": {
"Table": {
"table": "schemas",
"name": "id"
}
}
}
],
"parameters": {
"Left": [
"Text"
]
},
"nullable": [
false
]
},
"hash": "2cada26bcc13af76e04e01a13a25c0d4f448dcdbda5cc31207668ac232cc9f85"
}

View File

@@ -1,64 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "\n SELECT id, table_name, columns, indexes\n FROM table_definitions\n WHERE id = $1\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Int8",
"origin": {
"Table": {
"table": "table_definitions",
"name": "id"
}
}
},
{
"ordinal": 1,
"name": "table_name",
"type_info": "Text",
"origin": {
"Table": {
"table": "table_definitions",
"name": "table_name"
}
}
},
{
"ordinal": 2,
"name": "columns",
"type_info": "Jsonb",
"origin": {
"Table": {
"table": "table_definitions",
"name": "columns"
}
}
},
{
"ordinal": 3,
"name": "indexes",
"type_info": "Jsonb",
"origin": {
"Table": {
"table": "table_definitions",
"name": "indexes"
}
}
}
],
"parameters": {
"Left": [
"Int8"
]
},
"nullable": [
false,
false,
false,
false
]
},
"hash": "339c149cac9a6a9a50dd78fd5d1a67bfa0d35689d6df35cd37a8097696637c97"
}

View File

@@ -1,14 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "DELETE FROM table_definitions WHERE id = $1",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Int8"
]
},
"nullable": []
},
"hash": "39d6176d6c3c4b647e4deb7cd7822a03c210ae5ec8a395f4fd3fb87dabe9ecc6"
}

View File

@@ -1,18 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "\n INSERT INTO column_alias_rename_history (\n profile_name,\n table_definition_id,\n table_name,\n old_column_name,\n new_column_name\n )\n VALUES ($1, $2, $3, $4, $5)\n ",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Text",
"Int8",
"Text",
"Text",
"Text"
]
},
"nullable": []
},
"hash": "48ff715dc1d539d0acf61a462fb3c086df5e787c9f8f653950b2ceefa128677c"
}

View File

@@ -1,14 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "DELETE FROM script_dependencies WHERE script_id = $1",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Int8"
]
},
"nullable": []
},
"hash": "4ceba24cb5232bae038dc3dafb4dc2e49b5f84add6ae804001a1f6f3dd1d0425"
}

View File

@@ -1,100 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "\n SELECT sd.script_id, sd.source_table_id, sd.target_table_id,\n td.table_name as target_table_name,\n link_column.display_name AS \"link_column?\",\n sd.dependency_type, sd.context_info\n FROM script_dependencies sd\n JOIN table_definitions td ON td.id = sd.target_table_id\n LEFT JOIN table_definition_columns link_column ON link_column.id = sd.link_column_id\n WHERE script_id = $1\n ORDER BY sd.source_table_id, sd.target_table_id\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "script_id",
"type_info": "Int8",
"origin": {
"Table": {
"table": "script_dependencies",
"name": "script_id"
}
}
},
{
"ordinal": 1,
"name": "source_table_id",
"type_info": "Int8",
"origin": {
"Table": {
"table": "script_dependencies",
"name": "source_table_id"
}
}
},
{
"ordinal": 2,
"name": "target_table_id",
"type_info": "Int8",
"origin": {
"Table": {
"table": "script_dependencies",
"name": "target_table_id"
}
}
},
{
"ordinal": 3,
"name": "target_table_name",
"type_info": "Text",
"origin": {
"Table": {
"table": "table_definitions",
"name": "table_name"
}
}
},
{
"ordinal": 4,
"name": "link_column?",
"type_info": "Text",
"origin": {
"Table": {
"table": "table_definition_columns",
"name": "display_name"
}
}
},
{
"ordinal": 5,
"name": "dependency_type",
"type_info": "Text",
"origin": {
"Table": {
"table": "script_dependencies",
"name": "dependency_type"
}
}
},
{
"ordinal": 6,
"name": "context_info",
"type_info": "Jsonb",
"origin": {
"Table": {
"table": "script_dependencies",
"name": "context_info"
}
}
}
],
"parameters": {
"Left": [
"Int8"
]
},
"nullable": [
false,
false,
false,
false,
false,
false,
true
]
},
"hash": "5c28cb03956122a62abc2283f8e71da6a4398ae02a77b228598654d6620beee0"
}

View File

@@ -1,40 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "SELECT id, table_name FROM table_definitions WHERE schema_id = $1 ORDER BY table_name",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Int8",
"origin": {
"Table": {
"table": "table_definitions",
"name": "id"
}
}
},
{
"ordinal": 1,
"name": "table_name",
"type_info": "Text",
"origin": {
"Table": {
"table": "table_definitions",
"name": "table_name"
}
}
}
],
"parameters": {
"Left": [
"Int8"
]
},
"nullable": [
false,
false
]
},
"hash": "5f8877887d62f09afb3ee2e6e3ee64daa64a561aba427a6c5a79f18a2586b8b5"
}

View File

@@ -1,41 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "SELECT table_name, columns FROM table_definitions\n WHERE schema_id = $1 AND table_name = ANY($2)",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "table_name",
"type_info": "Text",
"origin": {
"Table": {
"table": "table_definitions",
"name": "table_name"
}
}
},
{
"ordinal": 1,
"name": "columns",
"type_info": "Jsonb",
"origin": {
"Table": {
"table": "table_definitions",
"name": "columns"
}
}
}
],
"parameters": {
"Left": [
"Int8",
"TextArray"
]
},
"nullable": [
false,
false
]
},
"hash": "60fdb265a03e74fe944649702da45380383cfd073ac0f542340b01fbca31925f"
}

View File

@@ -1,88 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "SELECT sd.target_table_id, sd.dependency_type AS \"dependency_type!\", sd.context_info,\n td.table_name AS \"target_table!\",\n link_column.display_name AS \"link_column?\",\n column_meta.display_name AS \"column_alias?\"\n FROM script_dependencies sd\n JOIN table_definitions td ON sd.target_table_id = td.id\n LEFT JOIN table_definition_columns link_column\n ON link_column.id = sd.link_column_id\n LEFT JOIN table_definition_columns column_meta\n ON column_meta.table_definition_id = td.id\n AND column_meta.physical_name = sd.context_info->>'column'\n WHERE sd.script_id = ANY($1)",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "target_table_id",
"type_info": "Int8",
"origin": {
"Table": {
"table": "script_dependencies",
"name": "target_table_id"
}
}
},
{
"ordinal": 1,
"name": "dependency_type!",
"type_info": "Text",
"origin": {
"Table": {
"table": "script_dependencies",
"name": "dependency_type"
}
}
},
{
"ordinal": 2,
"name": "context_info",
"type_info": "Jsonb",
"origin": {
"Table": {
"table": "script_dependencies",
"name": "context_info"
}
}
},
{
"ordinal": 3,
"name": "target_table!",
"type_info": "Text",
"origin": {
"Table": {
"table": "table_definitions",
"name": "table_name"
}
}
},
{
"ordinal": 4,
"name": "link_column?",
"type_info": "Text",
"origin": {
"Table": {
"table": "table_definition_columns",
"name": "display_name"
}
}
},
{
"ordinal": 5,
"name": "column_alias?",
"type_info": "Text",
"origin": {
"Table": {
"table": "table_definition_columns",
"name": "display_name"
}
}
}
],
"parameters": {
"Left": [
"Int8Array"
]
},
"nullable": [
false,
false,
true,
false,
true,
true
]
},
"hash": "739059410d10fc1d50ce1f96037c7d01b0c596ad7db71e6047f1d3bdc9400b6d"
}

View File

@@ -1,71 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "SELECT \n st.table_name as source_table,\n tt.table_name as target_table,\n sd.dependency_type,\n sd.context_info,\n COUNT(*) as \"dependency_count!\"\n FROM script_dependencies sd\n JOIN table_definitions st ON sd.source_table_id = st.id\n JOIN table_definitions tt ON sd.target_table_id = tt.id\n WHERE st.schema_id = $1\n GROUP BY st.table_name, tt.table_name, sd.dependency_type, sd.context_info\n ORDER BY st.table_name, tt.table_name",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "source_table",
"type_info": "Text",
"origin": {
"Table": {
"table": "table_definitions",
"name": "table_name"
}
}
},
{
"ordinal": 1,
"name": "target_table",
"type_info": "Text",
"origin": {
"Table": {
"table": "table_definitions",
"name": "table_name"
}
}
},
{
"ordinal": 2,
"name": "dependency_type",
"type_info": "Text",
"origin": {
"Table": {
"table": "script_dependencies",
"name": "dependency_type"
}
}
},
{
"ordinal": 3,
"name": "context_info",
"type_info": "Jsonb",
"origin": {
"Table": {
"table": "script_dependencies",
"name": "context_info"
}
}
},
{
"ordinal": 4,
"name": "dependency_count!",
"type_info": "Int8",
"origin": "Expression"
}
],
"parameters": {
"Left": [
"Int8"
]
},
"nullable": [
false,
false,
false,
true,
null
]
},
"hash": "96f4559652609ba82df171a8efaaa3f1febb1074db31be8257cbd09c8dce0abd"
}

View File

@@ -1,40 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "SELECT id, columns FROM table_definitions WHERE id = $1",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Int8",
"origin": {
"Table": {
"table": "table_definitions",
"name": "id"
}
}
},
{
"ordinal": 1,
"name": "columns",
"type_info": "Jsonb",
"origin": {
"Table": {
"table": "table_definitions",
"name": "columns"
}
}
}
],
"parameters": {
"Left": [
"Int8"
]
},
"nullable": [
false,
false
]
},
"hash": "a0c0cf9289631d7037d6113d346714518599ce49e403cee9c7ff68048055bfed"
}

View File

@@ -1,16 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "\n UPDATE table_definition_columns\n SET display_name = $1\n WHERE table_definition_id = $2 AND display_name = $3\n ",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Text",
"Int8",
"Text"
]
},
"nullable": []
},
"hash": "ae5ff10297a8c41e1ab61bc587673ca8e18366b2ab429f72d9688c5641ba6dfb"
}

View File

@@ -1,64 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "SELECT sd.source_table_id, sd.target_table_id, st.table_name as source_table, tt.table_name as target_table\n FROM script_dependencies sd\n JOIN table_definitions st ON sd.source_table_id = st.id\n JOIN table_definitions tt ON sd.target_table_id = tt.id\n WHERE st.schema_id = $1",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "source_table_id",
"type_info": "Int8",
"origin": {
"Table": {
"table": "script_dependencies",
"name": "source_table_id"
}
}
},
{
"ordinal": 1,
"name": "target_table_id",
"type_info": "Int8",
"origin": {
"Table": {
"table": "script_dependencies",
"name": "target_table_id"
}
}
},
{
"ordinal": 2,
"name": "source_table",
"type_info": "Text",
"origin": {
"Table": {
"table": "table_definitions",
"name": "table_name"
}
}
},
{
"ordinal": 3,
"name": "target_table",
"type_info": "Text",
"origin": {
"Table": {
"table": "table_definitions",
"name": "table_name"
}
}
}
],
"parameters": {
"Left": [
"Int8"
]
},
"nullable": [
false,
false,
false,
false
]
},
"hash": "b9a9b9655040f8d6d636ca4f30fda3732b5d70afac9025fa136dfb6f47c7bde2"
}

View File

@@ -1,14 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "DELETE FROM table_validation_rules WHERE table_def_id = $1",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Int8"
]
},
"nullable": []
},
"hash": "c00efe465462eed1a14ea3a3fd2ccf8535b6fc7f6eaab16196dc29940b351314"
}

View File

@@ -1,40 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "SELECT source_table_id, target_table_id\n FROM script_dependencies sd\n JOIN table_definitions td ON sd.source_table_id = td.id\n WHERE td.schema_id = $1",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "source_table_id",
"type_info": "Int8",
"origin": {
"Table": {
"table": "script_dependencies",
"name": "source_table_id"
}
}
},
{
"ordinal": 1,
"name": "target_table_id",
"type_info": "Int8",
"origin": {
"Table": {
"table": "script_dependencies",
"name": "target_table_id"
}
}
}
],
"parameters": {
"Left": [
"Int8"
]
},
"nullable": [
false,
false
]
},
"hash": "c6f470487b1b3714e09c399aca2abbe33b21e5b7b654d18d63cbe775e1a1ba45"
}

View File

@@ -1,29 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "SELECT id FROM table_definitions WHERE schema_id = $1 AND table_name = $2",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Int8",
"origin": {
"Table": {
"table": "table_definitions",
"name": "id"
}
}
}
],
"parameters": {
"Left": [
"Int8",
"Text"
]
},
"nullable": [
false
]
},
"hash": "d3ed73ade96da8e5d86c1bb7986017dc0dc5f09c6c3c8ebd21e0623e095a5cd7"
}

View File

@@ -1,19 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "INSERT INTO script_dependencies\n (script_id, source_table_id, target_table_id, dependency_type, context_info,\n link_column_id)\n VALUES ($1, $2, $3, $4, $5, $6)",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Int8",
"Int8",
"Int8",
"Text",
"Jsonb",
"Int8"
]
},
"nullable": []
},
"hash": "ddf445860abf268d67eeb398847b1fd57a5a0a4e3407de21b09897e0c54a564b"
}

View File

@@ -1,53 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "SELECT id, table_name, columns FROM table_definitions\n WHERE schema_id = $1 AND table_name = $2",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Int8",
"origin": {
"Table": {
"table": "table_definitions",
"name": "id"
}
}
},
{
"ordinal": 1,
"name": "table_name",
"type_info": "Text",
"origin": {
"Table": {
"table": "table_definitions",
"name": "table_name"
}
}
},
{
"ordinal": 2,
"name": "columns",
"type_info": "Jsonb",
"origin": {
"Table": {
"table": "table_definitions",
"name": "columns"
}
}
}
],
"parameters": {
"Left": [
"Int8",
"Text"
]
},
"nullable": [
false,
false,
false
]
},
"hash": "e3538ce682101997bccffca14b82df99350fb6d88990067b637af85c209c7568"
}

View File

@@ -1,88 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "\n SELECT ts.id, ts.table_definitions_id,\n target_column.display_name AS target_column,\n ts.target_column_type, ts.script, ts.description\n FROM table_scripts ts\n JOIN table_definitions td ON ts.table_definitions_id = td.id\n JOIN table_definition_columns target_column\n ON target_column.table_definition_id = ts.table_definitions_id\n AND target_column.physical_name = ts.target_column\n WHERE td.id = ANY($1)\n ORDER BY ts.table_definitions_id, target_column.display_name\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Int8",
"origin": {
"Table": {
"table": "table_scripts",
"name": "id"
}
}
},
{
"ordinal": 1,
"name": "table_definitions_id",
"type_info": "Int8",
"origin": {
"Table": {
"table": "table_scripts",
"name": "table_definitions_id"
}
}
},
{
"ordinal": 2,
"name": "target_column",
"type_info": "Text",
"origin": {
"Table": {
"table": "table_definition_columns",
"name": "display_name"
}
}
},
{
"ordinal": 3,
"name": "target_column_type",
"type_info": "Text",
"origin": {
"Table": {
"table": "table_scripts",
"name": "target_column_type"
}
}
},
{
"ordinal": 4,
"name": "script",
"type_info": "Text",
"origin": {
"Table": {
"table": "table_scripts",
"name": "script"
}
}
},
{
"ordinal": 5,
"name": "description",
"type_info": "Text",
"origin": {
"Table": {
"table": "table_scripts",
"name": "description"
}
}
}
],
"parameters": {
"Left": [
"Int8Array"
]
},
"nullable": [
false,
false,
false,
false,
false,
true
]
},
"hash": "e8031ef79f1ad297ab13893f8a507d49a2c2af2f5af1b820b68ecf49b0b9887a"
}

View File

@@ -1,28 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "SELECT columns FROM table_definitions WHERE id = $1",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "columns",
"type_info": "Jsonb",
"origin": {
"Table": {
"table": "table_definitions",
"name": "columns"
}
}
}
],
"parameters": {
"Left": [
"Int8"
]
},
"nullable": [
false
]
},
"hash": "f364f3665433ff5a2017e3fa24b54b695caba39d15e64365da95a8c2c9717018"
}

View File

@@ -1,14 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "DELETE FROM schemas WHERE id = $1",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Int8"
]
},
"nullable": []
},
"hash": "f3886c06d621924a80c503d4adef617687a2b7dbb96627ff106f3870137660a6"
}

2
server

Submodule server updated: 575982ca6b...9e12b42d9d