Highly ambitious ATProtocol AppView service and sdks

update query cache

+346 -2
+23
api/.sqlx/query-0b88e356f9b4ada616b1398baa792aa2012c613ac39527af939a9fed1999cf91.json
··· 1 + { 2 + "db_name": "PostgreSQL", 3 + "query": "\n SELECT job_id\n FROM job_results\n WHERE user_did = $1\n AND slice_uri = $2\n AND status = 'running'\n AND created_at > NOW() - INTERVAL '10 minutes'\n ", 4 + "describe": { 5 + "columns": [ 6 + { 7 + "ordinal": 0, 8 + "name": "job_id", 9 + "type_info": "Uuid" 10 + } 11 + ], 12 + "parameters": { 13 + "Left": [ 14 + "Text", 15 + "Text" 16 + ] 17 + }, 18 + "nullable": [ 19 + false 20 + ] 21 + }, 22 + "hash": "0b88e356f9b4ada616b1398baa792aa2012c613ac39527af939a9fed1999cf91" 23 + }
+22
api/.sqlx/query-2515ba15c6154c0ebdd44e6580bcf642b6a6ea6a31486db7e64f379e6d0312cb.json
··· 1 + { 2 + "db_name": "PostgreSQL", 3 + "query": "\n SELECT uri\n FROM record\n WHERE collection = 'network.slices.slice'\n AND uri LIKE $1\n LIMIT 1\n ", 4 + "describe": { 5 + "columns": [ 6 + { 7 + "ordinal": 0, 8 + "name": "uri", 9 + "type_info": "Text" 10 + } 11 + ], 12 + "parameters": { 13 + "Left": [ 14 + "Text" 15 + ] 16 + }, 17 + "nullable": [ 18 + false 19 + ] 20 + }, 21 + "hash": "2515ba15c6154c0ebdd44e6580bcf642b6a6ea6a31486db7e64f379e6d0312cb" 22 + }
+14
api/.sqlx/query-2e8604e20759bc693d7197d56aa63bd4ec88c627e137338cc00493acad0f4bb5.json
··· 1 + { 2 + "db_name": "PostgreSQL", 3 + "query": "\n DELETE FROM mq_msgs\n WHERE id = (\n SELECT m.id\n FROM mq_msgs m\n JOIN mq_payloads p ON m.id = p.id\n WHERE m.channel_name = 'sync_queue'\n AND p.payload_json->>'job_id' = $1\n LIMIT 1\n )\n ", 4 + "describe": { 5 + "columns": [], 6 + "parameters": { 7 + "Left": [ 8 + "Text" 9 + ] 10 + }, 11 + "nullable": [] 12 + }, 13 + "hash": "2e8604e20759bc693d7197d56aa63bd4ec88c627e137338cc00493acad0f4bb5" 14 + }
+23
api/.sqlx/query-34772b1ea9bbb544f35debd0f4322b8c5fa9b36e89d8037dabea926b41295e1c.json
··· 1 + { 2 + "db_name": "PostgreSQL", 3 + "query": "\n SELECT uri\n FROM record\n WHERE collection = 'network.slices.slice'\n AND json->>'actorHandle' = $1\n AND uri LIKE '%' || $2 || '%'\n LIMIT 1\n ", 4 + "describe": { 5 + "columns": [ 6 + { 7 + "ordinal": 0, 8 + "name": "uri", 9 + "type_info": "Text" 10 + } 11 + ], 12 + "parameters": { 13 + "Left": [ 14 + "Text", 15 + "Text" 16 + ] 17 + }, 18 + "nullable": [ 19 + false 20 + ] 21 + }, 22 + "hash": "34772b1ea9bbb544f35debd0f4322b8c5fa9b36e89d8037dabea926b41295e1c" 23 + }
+22
api/.sqlx/query-3f2817c58f926dd5988eea516a827bae626cec08106fc8863fa29c894ca97ad5.json
··· 1 + { 2 + "db_name": "PostgreSQL", 3 + "query": "\n DELETE FROM job_results\n WHERE job_id = $1\n RETURNING job_id\n ", 4 + "describe": { 5 + "columns": [ 6 + { 7 + "ordinal": 0, 8 + "name": "job_id", 9 + "type_info": "Uuid" 10 + } 11 + ], 12 + "parameters": { 13 + "Left": [ 14 + "Uuid" 15 + ] 16 + }, 17 + "nullable": [ 18 + false 19 + ] 20 + }, 21 + "hash": "3f2817c58f926dd5988eea516a827bae626cec08106fc8863fa29c894ca97ad5" 22 + }
+2 -2
api/.sqlx/query-476a222abf10eedfe5cebebf21900bc3bbee11e855aa37f6c1ccc7d9bce5f87a.json api/.sqlx/query-e89ac05d0570e29a0c546f0e463d2deffd4db29c4bb05f001e9b7740efca5caf.json
··· 1 1 { 2 2 "db_name": "PostgreSQL", 3 - "query": "\n INSERT INTO job_results (\n job_id, user_did, slice_uri, status, success, total_records,\n collections_synced, repos_processed, message, error_message\n ) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)\n ON CONFLICT (job_id)\n DO UPDATE SET\n status = EXCLUDED.status,\n success = EXCLUDED.success,\n total_records = EXCLUDED.total_records,\n collections_synced = EXCLUDED.collections_synced,\n repos_processed = EXCLUDED.repos_processed,\n message = EXCLUDED.message,\n error_message = EXCLUDED.error_message,\n completed_at = NOW()\n ", 3 + "query": "\n INSERT INTO job_results (\n job_id, user_did, slice_uri, status, success, total_records,\n collections_synced, repos_processed, message, error_message\n ) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)\n ON CONFLICT (job_id)\n DO UPDATE SET\n status = EXCLUDED.status,\n success = EXCLUDED.success,\n total_records = EXCLUDED.total_records,\n collections_synced = EXCLUDED.collections_synced,\n repos_processed = EXCLUDED.repos_processed,\n message = EXCLUDED.message,\n error_message = EXCLUDED.error_message,\n completed_at = NOW()\n WHERE job_results.status != 'cancelled'\n ", 4 4 "describe": { 5 5 "columns": [], 6 6 "parameters": { ··· 19 19 }, 20 20 "nullable": [] 21 21 }, 22 - "hash": "476a222abf10eedfe5cebebf21900bc3bbee11e855aa37f6c1ccc7d9bce5f87a" 22 + "hash": "e89ac05d0570e29a0c546f0e463d2deffd4db29c4bb05f001e9b7740efca5caf" 23 23 }
+22
api/.sqlx/query-4d9e6d902bf75d05fb516b6f0e47ad9de6ec13cd621dc2270c64a402616f9afa.json
··· 1 + { 2 + "db_name": "PostgreSQL", 3 + "query": "\n SELECT status\n FROM job_results\n WHERE job_id = $1\n AND status = 'cancelled'\n ", 4 + "describe": { 5 + "columns": [ 6 + { 7 + "ordinal": 0, 8 + "name": "status", 9 + "type_info": "Text" 10 + } 11 + ], 12 + "parameters": { 13 + "Left": [ 14 + "Uuid" 15 + ] 16 + }, 17 + "nullable": [ 18 + false 19 + ] 20 + }, 21 + "hash": "4d9e6d902bf75d05fb516b6f0e47ad9de6ec13cd621dc2270c64a402616f9afa" 22 + }
+17
api/.sqlx/query-6640b5320abf0a32dde919c3eea5e64ccebc503b2b58269d481c0c87e5a4f239.json
··· 1 + { 2 + "db_name": "PostgreSQL", 3 + "query": "\n INSERT INTO job_results (job_id, user_did, slice_uri, status, success, message, created_at, completed_at)\n VALUES ($1, $2, $3, 'cancelled', false, 'Job cancelled by user', $4, $4)\n ON CONFLICT (job_id)\n DO UPDATE SET\n status = 'cancelled',\n message = 'Job cancelled by user',\n completed_at = $4\n WHERE job_results.status NOT IN ('completed', 'failed', 'cancelled')\n ", 4 + "describe": { 5 + "columns": [], 6 + "parameters": { 7 + "Left": [ 8 + "Uuid", 9 + "Text", 10 + "Text", 11 + "Timestamptz" 12 + ] 13 + }, 14 + "nullable": [] 15 + }, 16 + "hash": "6640b5320abf0a32dde919c3eea5e64ccebc503b2b58269d481c0c87e5a4f239" 17 + }
+22
api/.sqlx/query-7122f93bb3a6a95dce7e4f772e452ffb30fea975bcc7c18ce28e2a9da4cfcbf7.json
··· 1 + { 2 + "db_name": "PostgreSQL", 3 + "query": "\n SELECT p.payload_json\n FROM mq_msgs m\n JOIN mq_payloads p ON m.id = p.id\n WHERE m.channel_name = 'sync_queue'\n AND p.payload_json->>'job_id' = $1\n LIMIT 1\n ", 4 + "describe": { 5 + "columns": [ 6 + { 7 + "ordinal": 0, 8 + "name": "payload_json", 9 + "type_info": "Jsonb" 10 + } 11 + ], 12 + "parameters": { 13 + "Left": [ 14 + "Text" 15 + ] 16 + }, 17 + "nullable": [ 18 + true 19 + ] 20 + }, 21 + "hash": "7122f93bb3a6a95dce7e4f772e452ffb30fea975bcc7c18ce28e2a9da4cfcbf7" 22 + }
+22
api/.sqlx/query-9a01a39a3f03c25fbcc9b30a5920776ca50858c3ef21f8c8f32d978e2c4abe28.json
··· 1 + { 2 + "db_name": "PostgreSQL", 3 + "query": "\n SELECT DISTINCT did\n FROM actor\n WHERE handle = $1\n LIMIT 1\n ", 4 + "describe": { 5 + "columns": [ 6 + { 7 + "ordinal": 0, 8 + "name": "did", 9 + "type_info": "Text" 10 + } 11 + ], 12 + "parameters": { 13 + "Left": [ 14 + "Text" 15 + ] 16 + }, 17 + "nullable": [ 18 + false 19 + ] 20 + }, 21 + "hash": "9a01a39a3f03c25fbcc9b30a5920776ca50858c3ef21f8c8f32d978e2c4abe28" 22 + }
+23
api/.sqlx/query-ac23bb6cab6a16529af787c4592f0f83497f1f1be80674f732af9e0aef09c796.json
··· 1 + { 2 + "db_name": "PostgreSQL", 3 + "query": "\n UPDATE job_results\n SET status = 'cancelled',\n message = 'Job cancelled by user',\n completed_at = $2\n WHERE job_id = $1\n AND status NOT IN ('completed', 'failed', 'cancelled')\n RETURNING job_id\n ", 4 + "describe": { 5 + "columns": [ 6 + { 7 + "ordinal": 0, 8 + "name": "job_id", 9 + "type_info": "Uuid" 10 + } 11 + ], 12 + "parameters": { 13 + "Left": [ 14 + "Uuid", 15 + "Timestamptz" 16 + ] 17 + }, 18 + "nullable": [ 19 + false 20 + ] 21 + }, 22 + "hash": "ac23bb6cab6a16529af787c4592f0f83497f1f1be80674f732af9e0aef09c796" 23 + }
+22
api/.sqlx/query-d24f975bc6d56b68b52d0a0cdd9c29ebc6fd519651354701e4b223718734bec6.json
··· 1 + { 2 + "db_name": "PostgreSQL", 3 + "query": "\n SELECT status\n FROM job_results\n WHERE job_id = $1\n ", 4 + "describe": { 5 + "columns": [ 6 + { 7 + "ordinal": 0, 8 + "name": "status", 9 + "type_info": "Text" 10 + } 11 + ], 12 + "parameters": { 13 + "Left": [ 14 + "Uuid" 15 + ] 16 + }, 17 + "nullable": [ 18 + false 19 + ] 20 + }, 21 + "hash": "d24f975bc6d56b68b52d0a0cdd9c29ebc6fd519651354701e4b223718734bec6" 22 + }
+17
api/.sqlx/query-e4cc601916507937a0971d62e90c621b9effeb4d0e783f66ffcc365f5af7f604.json
··· 1 + { 2 + "db_name": "PostgreSQL", 3 + "query": "\n INSERT INTO job_results (job_id, user_did, slice_uri, status, success, message, created_at)\n VALUES ($1, $2, $3, 'running', false, 'Job is running...', $4)\n ON CONFLICT (job_id) DO NOTHING\n ", 4 + "describe": { 5 + "columns": [], 6 + "parameters": { 7 + "Left": [ 8 + "Uuid", 9 + "Text", 10 + "Text", 11 + "Timestamptz" 12 + ] 13 + }, 14 + "nullable": [] 15 + }, 16 + "hash": "e4cc601916507937a0971d62e90c621b9effeb4d0e783f66ffcc365f5af7f604" 17 + }
+95
api/.sqlx/query-f7d276cab8741971c2f00946867f4ed67fdca9fe35843da890a5273ff3c0d872.json
··· 1 + { 2 + "db_name": "PostgreSQL", 3 + "query": "\n -- Completed jobs from job_results\n SELECT\n job_id, user_did, slice_uri, status, success, total_records,\n collections_synced, repos_processed, message, error_message,\n created_at, completed_at,\n 'completed' as job_type\n FROM job_results\n WHERE slice_uri LIKE $1\n\n UNION ALL\n\n -- Pending jobs from message queue\n SELECT\n (p.payload_json->>'job_id')::uuid as job_id,\n p.payload_json->>'user_did' as user_did,\n p.payload_json->>'slice_uri' as slice_uri,\n 'running' as status,\n NULL::boolean as success,\n NULL::bigint as total_records,\n '[]'::jsonb as collections_synced,\n NULL::bigint as repos_processed,\n 'Job in progress...' as message,\n NULL::text as error_message,\n m.created_at,\n NULL::timestamptz as completed_at,\n 'pending' as job_type\n FROM mq_msgs m\n JOIN mq_payloads p ON m.id = p.id\n WHERE m.channel_name = 'sync_queue'\n AND m.id != '00000000-0000-0000-0000-000000000000'\n AND p.payload_json->>'slice_uri' LIKE $1\n AND NOT EXISTS (\n SELECT 1 FROM job_results jr\n WHERE jr.job_id = (p.payload_json->>'job_id')::uuid\n )\n\n ORDER BY created_at DESC\n LIMIT $2\n ", 4 + "describe": { 5 + "columns": [ 6 + { 7 + "ordinal": 0, 8 + "name": "job_id", 9 + "type_info": "Uuid" 10 + }, 11 + { 12 + "ordinal": 1, 13 + "name": "user_did", 14 + "type_info": "Text" 15 + }, 16 + { 17 + "ordinal": 2, 18 + "name": "slice_uri", 19 + "type_info": "Text" 20 + }, 21 + { 22 + "ordinal": 3, 23 + "name": "status", 24 + "type_info": "Text" 25 + }, 26 + { 27 + "ordinal": 4, 28 + "name": "success", 29 + "type_info": "Bool" 30 + }, 31 + { 32 + "ordinal": 5, 33 + "name": "total_records", 34 + "type_info": "Int8" 35 + }, 36 + { 37 + "ordinal": 6, 38 + "name": "collections_synced", 39 + "type_info": "Jsonb" 40 + }, 41 + { 42 + "ordinal": 7, 43 + "name": "repos_processed", 44 + "type_info": "Int8" 45 + }, 46 + { 47 + "ordinal": 8, 48 + "name": "message", 49 + "type_info": "Text" 50 + }, 51 + { 52 + "ordinal": 9, 53 + "name": "error_message", 54 + "type_info": "Text" 55 + }, 56 + { 57 + "ordinal": 10, 58 + "name": "created_at", 59 + "type_info": "Timestamptz" 60 + }, 61 + { 62 + "ordinal": 11, 63 + "name": "completed_at", 64 + "type_info": "Timestamptz" 65 + }, 66 + { 67 + "ordinal": 12, 68 + "name": "job_type", 69 + "type_info": "Text" 70 + } 71 + ], 72 + "parameters": { 73 + "Left": [ 74 + "Text", 75 + "Int8" 76 + ] 77 + }, 78 + "nullable": [ 79 + null, 80 + null, 81 + null, 82 + null, 83 + null, 84 + null, 85 + null, 86 + null, 87 + null, 88 + null, 89 + null, 90 + null, 91 + null 92 + ] 93 + }, 94 + "hash": "f7d276cab8741971c2f00946867f4ed67fdca9fe35843da890a5273ff3c0d872" 95 + }