registry: add sqlx checks for published operation reads

This commit is contained in:
a.tolmachev
2026-04-12 21:17:56 +00:00
parent 934c872753
commit c940b9b97a
9 changed files with 966 additions and 110 deletions
@@ -0,0 +1,65 @@
{
"db_name": "PostgreSQL",
"query": "select\n id,\n operation_id,\n version,\n descriptor_kind,\n storage_ref,\n source_name,\n package_index_json,\n to_char(created_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"created_at!\"\n from descriptors\n where operation_id = $1 and version = $2\n order by created_at asc",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Text"
},
{
"ordinal": 1,
"name": "operation_id",
"type_info": "Text"
},
{
"ordinal": 2,
"name": "version",
"type_info": "Int4"
},
{
"ordinal": 3,
"name": "descriptor_kind",
"type_info": "Text"
},
{
"ordinal": 4,
"name": "storage_ref",
"type_info": "Text"
},
{
"ordinal": 5,
"name": "source_name",
"type_info": "Text"
},
{
"ordinal": 6,
"name": "package_index_json",
"type_info": "Jsonb"
},
{
"ordinal": 7,
"name": "created_at!",
"type_info": "Text"
}
],
"parameters": {
"Left": [
"Text",
"Int4"
]
},
"nullable": [
false,
true,
true,
false,
false,
true,
true,
null
]
},
"hash": "2907637008db9d3febc5f8f2f79f7f073b35973aad326acfd54970ef0ab2a731"
}
@@ -0,0 +1,160 @@
{
"db_name": "PostgreSQL",
"query": "select\n o.id,\n o.workspace_id,\n o.name,\n o.display_name,\n o.category,\n o.protocol,\n to_char(o.created_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"operation_created_at!\",\n to_char(o.updated_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"operation_updated_at!\",\n to_char(o.published_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as operation_published_at,\n ov.version,\n ov.status,\n ov.target_json,\n ov.input_schema_json,\n ov.output_schema_json,\n ov.input_mapping_json,\n ov.output_mapping_json,\n ov.execution_config_json,\n ov.tool_description_json,\n ov.samples_json,\n ov.generated_draft_json,\n ov.config_export_json,\n ov.change_note,\n to_char(ov.created_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"created_at!\",\n ov.created_by\n from published_operations po\n join operation_versions ov\n on ov.operation_id = po.operation_id and ov.version = po.version\n join operations o on o.id = po.operation_id\n where po.operation_id = $1",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Text"
},
{
"ordinal": 1,
"name": "workspace_id",
"type_info": "Text"
},
{
"ordinal": 2,
"name": "name",
"type_info": "Text"
},
{
"ordinal": 3,
"name": "display_name",
"type_info": "Text"
},
{
"ordinal": 4,
"name": "category",
"type_info": "Text"
},
{
"ordinal": 5,
"name": "protocol",
"type_info": "Text"
},
{
"ordinal": 6,
"name": "operation_created_at!",
"type_info": "Text"
},
{
"ordinal": 7,
"name": "operation_updated_at!",
"type_info": "Text"
},
{
"ordinal": 8,
"name": "operation_published_at",
"type_info": "Text"
},
{
"ordinal": 9,
"name": "version",
"type_info": "Int4"
},
{
"ordinal": 10,
"name": "status",
"type_info": "Text"
},
{
"ordinal": 11,
"name": "target_json",
"type_info": "Jsonb"
},
{
"ordinal": 12,
"name": "input_schema_json",
"type_info": "Jsonb"
},
{
"ordinal": 13,
"name": "output_schema_json",
"type_info": "Jsonb"
},
{
"ordinal": 14,
"name": "input_mapping_json",
"type_info": "Jsonb"
},
{
"ordinal": 15,
"name": "output_mapping_json",
"type_info": "Jsonb"
},
{
"ordinal": 16,
"name": "execution_config_json",
"type_info": "Jsonb"
},
{
"ordinal": 17,
"name": "tool_description_json",
"type_info": "Jsonb"
},
{
"ordinal": 18,
"name": "samples_json",
"type_info": "Jsonb"
},
{
"ordinal": 19,
"name": "generated_draft_json",
"type_info": "Jsonb"
},
{
"ordinal": 20,
"name": "config_export_json",
"type_info": "Jsonb"
},
{
"ordinal": 21,
"name": "change_note",
"type_info": "Text"
},
{
"ordinal": 22,
"name": "created_at!",
"type_info": "Text"
},
{
"ordinal": 23,
"name": "created_by",
"type_info": "Text"
}
],
"parameters": {
"Left": [
"Text"
]
},
"nullable": [
false,
false,
false,
false,
false,
false,
null,
null,
null,
false,
false,
false,
false,
false,
false,
false,
false,
false,
true,
true,
true,
true,
null,
true
]
},
"hash": "33071dad43cffdb3bc1a55d07a5aee93f9af115155e319e49acc6f02d006fcc0"
}
@@ -0,0 +1,158 @@
{
"db_name": "PostgreSQL",
"query": "select\n o.id,\n o.workspace_id,\n o.name,\n o.display_name,\n o.category,\n o.protocol,\n to_char(o.created_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"operation_created_at!\",\n to_char(o.updated_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"operation_updated_at!\",\n to_char(o.published_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as operation_published_at,\n ov.version,\n ov.status,\n ov.target_json,\n ov.input_schema_json,\n ov.output_schema_json,\n ov.input_mapping_json,\n ov.output_mapping_json,\n ov.execution_config_json,\n ov.tool_description_json,\n ov.samples_json,\n ov.generated_draft_json,\n ov.config_export_json,\n ov.change_note,\n to_char(ov.created_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"created_at!\",\n ov.created_by\n from published_operations po\n join operation_versions ov\n on ov.operation_id = po.operation_id and ov.version = po.version\n join operations o on o.id = po.operation_id\n order by o.name asc",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Text"
},
{
"ordinal": 1,
"name": "workspace_id",
"type_info": "Text"
},
{
"ordinal": 2,
"name": "name",
"type_info": "Text"
},
{
"ordinal": 3,
"name": "display_name",
"type_info": "Text"
},
{
"ordinal": 4,
"name": "category",
"type_info": "Text"
},
{
"ordinal": 5,
"name": "protocol",
"type_info": "Text"
},
{
"ordinal": 6,
"name": "operation_created_at!",
"type_info": "Text"
},
{
"ordinal": 7,
"name": "operation_updated_at!",
"type_info": "Text"
},
{
"ordinal": 8,
"name": "operation_published_at",
"type_info": "Text"
},
{
"ordinal": 9,
"name": "version",
"type_info": "Int4"
},
{
"ordinal": 10,
"name": "status",
"type_info": "Text"
},
{
"ordinal": 11,
"name": "target_json",
"type_info": "Jsonb"
},
{
"ordinal": 12,
"name": "input_schema_json",
"type_info": "Jsonb"
},
{
"ordinal": 13,
"name": "output_schema_json",
"type_info": "Jsonb"
},
{
"ordinal": 14,
"name": "input_mapping_json",
"type_info": "Jsonb"
},
{
"ordinal": 15,
"name": "output_mapping_json",
"type_info": "Jsonb"
},
{
"ordinal": 16,
"name": "execution_config_json",
"type_info": "Jsonb"
},
{
"ordinal": 17,
"name": "tool_description_json",
"type_info": "Jsonb"
},
{
"ordinal": 18,
"name": "samples_json",
"type_info": "Jsonb"
},
{
"ordinal": 19,
"name": "generated_draft_json",
"type_info": "Jsonb"
},
{
"ordinal": 20,
"name": "config_export_json",
"type_info": "Jsonb"
},
{
"ordinal": 21,
"name": "change_note",
"type_info": "Text"
},
{
"ordinal": 22,
"name": "created_at!",
"type_info": "Text"
},
{
"ordinal": 23,
"name": "created_by",
"type_info": "Text"
}
],
"parameters": {
"Left": []
},
"nullable": [
false,
false,
false,
false,
false,
false,
null,
null,
null,
false,
false,
false,
false,
false,
false,
false,
false,
false,
true,
true,
true,
true,
null,
true
]
},
"hash": "3348d60983e16bac76e81ec2158c1c6b1333ec49067d23bdd3c2fd33caa93a3c"
}
@@ -0,0 +1,23 @@
{
"db_name": "PostgreSQL",
"query": "select 1 as \"present!\"\n from workspaces w\n join agents a on a.workspace_id = w.id\n join published_agents pa on pa.agent_id = a.id\n where w.slug = $1 and a.slug = $2",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "present!",
"type_info": "Int4"
}
],
"parameters": {
"Left": [
"Text",
"Text"
]
},
"nullable": [
null
]
},
"hash": "3422060fba1de6d85f89c46b41cc1cf462f49f0e2fe93e9230d15f97710b74ee"
}
@@ -0,0 +1,65 @@
{
"db_name": "PostgreSQL",
"query": "select\n id,\n operation_id,\n version,\n sample_kind,\n storage_ref,\n content_type,\n file_name,\n to_char(created_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"created_at!\"\n from operation_samples\n where operation_id = $1 and version = $2\n order by created_at asc",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Text"
},
{
"ordinal": 1,
"name": "operation_id",
"type_info": "Text"
},
{
"ordinal": 2,
"name": "version",
"type_info": "Int4"
},
{
"ordinal": 3,
"name": "sample_kind",
"type_info": "Text"
},
{
"ordinal": 4,
"name": "storage_ref",
"type_info": "Text"
},
{
"ordinal": 5,
"name": "content_type",
"type_info": "Text"
},
{
"ordinal": 6,
"name": "file_name",
"type_info": "Text"
},
{
"ordinal": 7,
"name": "created_at!",
"type_info": "Text"
}
],
"parameters": {
"Left": [
"Text",
"Int4"
]
},
"nullable": [
false,
false,
false,
false,
false,
false,
true,
null
]
},
"hash": "da58664742ddda01bd0bb8fccf69c69167b1c4f4868ca5310fbd8f5fdc5cd546"
}
@@ -0,0 +1,197 @@
{
"db_name": "PostgreSQL",
"query": "select\n w.id as workspace_id,\n w.slug as workspace_slug,\n a.id as agent_id,\n a.slug as agent_slug,\n b.tool_name,\n b.tool_title,\n coalesce(b.tool_description_override, ov.tool_description_json->>'description') as \"tool_description!\",\n o.id,\n o.name,\n o.display_name,\n o.category,\n o.protocol,\n to_char(o.created_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"operation_created_at!\",\n to_char(o.updated_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"operation_updated_at!\",\n to_char(o.published_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as operation_published_at,\n ov.version,\n ov.status,\n ov.target_json,\n ov.input_schema_json,\n ov.output_schema_json,\n ov.input_mapping_json,\n ov.output_mapping_json,\n ov.execution_config_json,\n ov.tool_description_json,\n ov.samples_json,\n ov.generated_draft_json,\n ov.config_export_json,\n ov.change_note,\n to_char(ov.created_at at time zone 'UTC', 'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') as \"created_at!\",\n ov.created_by\n from workspaces w\n join agents a on a.workspace_id = w.id\n join published_agents pa on pa.agent_id = a.id\n join agent_operation_bindings b on b.agent_id = a.id and b.agent_version = pa.version\n join operation_versions ov on ov.operation_id = b.operation_id and ov.version = b.operation_version\n join operations o on o.id = ov.operation_id and o.workspace_id = w.id\n where w.slug = $1 and a.slug = $2 and b.enabled = true\n order by b.tool_name asc",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "workspace_id",
"type_info": "Text"
},
{
"ordinal": 1,
"name": "workspace_slug",
"type_info": "Text"
},
{
"ordinal": 2,
"name": "agent_id",
"type_info": "Text"
},
{
"ordinal": 3,
"name": "agent_slug",
"type_info": "Text"
},
{
"ordinal": 4,
"name": "tool_name",
"type_info": "Text"
},
{
"ordinal": 5,
"name": "tool_title",
"type_info": "Text"
},
{
"ordinal": 6,
"name": "tool_description!",
"type_info": "Text"
},
{
"ordinal": 7,
"name": "id",
"type_info": "Text"
},
{
"ordinal": 8,
"name": "name",
"type_info": "Text"
},
{
"ordinal": 9,
"name": "display_name",
"type_info": "Text"
},
{
"ordinal": 10,
"name": "category",
"type_info": "Text"
},
{
"ordinal": 11,
"name": "protocol",
"type_info": "Text"
},
{
"ordinal": 12,
"name": "operation_created_at!",
"type_info": "Text"
},
{
"ordinal": 13,
"name": "operation_updated_at!",
"type_info": "Text"
},
{
"ordinal": 14,
"name": "operation_published_at",
"type_info": "Text"
},
{
"ordinal": 15,
"name": "version",
"type_info": "Int4"
},
{
"ordinal": 16,
"name": "status",
"type_info": "Text"
},
{
"ordinal": 17,
"name": "target_json",
"type_info": "Jsonb"
},
{
"ordinal": 18,
"name": "input_schema_json",
"type_info": "Jsonb"
},
{
"ordinal": 19,
"name": "output_schema_json",
"type_info": "Jsonb"
},
{
"ordinal": 20,
"name": "input_mapping_json",
"type_info": "Jsonb"
},
{
"ordinal": 21,
"name": "output_mapping_json",
"type_info": "Jsonb"
},
{
"ordinal": 22,
"name": "execution_config_json",
"type_info": "Jsonb"
},
{
"ordinal": 23,
"name": "tool_description_json",
"type_info": "Jsonb"
},
{
"ordinal": 24,
"name": "samples_json",
"type_info": "Jsonb"
},
{
"ordinal": 25,
"name": "generated_draft_json",
"type_info": "Jsonb"
},
{
"ordinal": 26,
"name": "config_export_json",
"type_info": "Jsonb"
},
{
"ordinal": 27,
"name": "change_note",
"type_info": "Text"
},
{
"ordinal": 28,
"name": "created_at!",
"type_info": "Text"
},
{
"ordinal": 29,
"name": "created_by",
"type_info": "Text"
}
],
"parameters": {
"Left": [
"Text",
"Text"
]
},
"nullable": [
false,
false,
false,
false,
false,
false,
null,
false,
false,
false,
false,
false,
null,
null,
null,
false,
false,
false,
false,
false,
false,
false,
false,
false,
true,
true,
true,
true,
null,
true
]
},
"hash": "f7b3017dafdc3b8291e4336b2f1c8290985f30802a9c159f75b9387bf44fb611"
}