63 lines
2.4 KiB
JSON
63 lines
2.4 KiB
JSON
{
|
|
"db_name": "SQLite",
|
|
"query": "SELECT \n t.id as \"id!: Uuid\", \n t.project_id as \"project_id!: Uuid\", \n t.title, \n t.description, \n t.status as \"status!: TaskStatus\", \n t.created_at as \"created_at!: DateTime<Utc>\", \n t.updated_at as \"updated_at!: DateTime<Utc>\",\n CASE WHEN in_progress_attempts.task_id IS NOT NULL THEN true ELSE false END as \"has_in_progress_attempt!\"\n FROM tasks t\n LEFT JOIN (\n SELECT DISTINCT ta.task_id \n FROM task_attempts ta\n INNER JOIN (\n SELECT task_attempt_id, MAX(created_at) as latest_created_at\n FROM task_attempt_activities\n GROUP BY task_attempt_id\n ) latest_activity ON ta.id = latest_activity.task_attempt_id\n INNER JOIN task_attempt_activities taa ON ta.id = taa.task_attempt_id \n AND taa.created_at = latest_activity.latest_created_at\n WHERE taa.status = 'inprogress'\n ) in_progress_attempts ON t.id = in_progress_attempts.task_id\n WHERE t.project_id = $1 \n ORDER BY t.created_at DESC",
|
|
"describe": {
|
|
"columns": [
|
|
{
|
|
"name": "id!: Uuid",
|
|
"ordinal": 0,
|
|
"type_info": "Blob"
|
|
},
|
|
{
|
|
"name": "project_id!: Uuid",
|
|
"ordinal": 1,
|
|
"type_info": "Blob"
|
|
},
|
|
{
|
|
"name": "title",
|
|
"ordinal": 2,
|
|
"type_info": "Text"
|
|
},
|
|
{
|
|
"name": "description",
|
|
"ordinal": 3,
|
|
"type_info": "Text"
|
|
},
|
|
{
|
|
"name": "status!: TaskStatus",
|
|
"ordinal": 4,
|
|
"type_info": "Text"
|
|
},
|
|
{
|
|
"name": "created_at!: DateTime<Utc>",
|
|
"ordinal": 5,
|
|
"type_info": "Text"
|
|
},
|
|
{
|
|
"name": "updated_at!: DateTime<Utc>",
|
|
"ordinal": 6,
|
|
"type_info": "Text"
|
|
},
|
|
{
|
|
"name": "has_in_progress_attempt!",
|
|
"ordinal": 7,
|
|
"type_info": "Int"
|
|
}
|
|
],
|
|
"parameters": {
|
|
"Right": 1
|
|
},
|
|
"nullable": [
|
|
true,
|
|
false,
|
|
false,
|
|
true,
|
|
false,
|
|
false,
|
|
false,
|
|
false
|
|
]
|
|
},
|
|
"hash": "0ac126dc834dc72fd7cbf4cc32ab23fec591cd48114905fadc59d15c38c9718c"
|
|
}
|