Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

3.0 KB
Raw Blame
{
  "db_name": "PostgreSQL",
  "query": "\n        SELECT\n            d.id as document_id,\n            d.owner as owner,\n            d.name as document_name,\n            db.id as \"document_version_id!\",\n            d.\"fileType\" as \"file_type?\",\n            d.\"createdAt\"::timestamptz as created_at,\n            d.\"updatedAt\"::timestamptz as updated_at,\n            db.bom_parts as \"document_bom?\",\n            d.\"projectId\" as \"project_id?\",\n            p.name as \"project_name?\"\n        FROM\n            \"Document\" d\n        LEFT JOIN LATERAL (\n            SELECT\n                b.id,\n                (\n                    SELECT\n                        json_agg(\n                            json_build_object(\n                                'id', bp.id,\n                                'sha', bp.sha,\n                                'path', bp.path\n                            )\n                        )\n                    FROM\n                        \"BomPart\" bp\n                    WHERE\n                        bp.\"documentBomId\" = b.id\n                ) as bom_parts\n            FROM\n                \"DocumentBom\" b\n            WHERE\n                b.\"documentId\" = d.id\n            ORDER BY\n                b.\"createdAt\" DESC\n            LIMIT 1\n\n        ) db ON true\n        LEFT JOIN LATERAL (\n            SELECT\n                p.name\n            FROM \"Project\" p\n            WHERE p.id = d.\"projectId\"\n        ) p ON d.\"projectId\" IS NOT NULL\n        WHERE d.\"fileType\" = 'docx' AND d.\"deletedAt\" IS NULL AND d.uploaded = true\n        ORDER BY d.\"updatedAt\" DESC\n        LIMIT $1 OFFSET $2\n    ",
  "describe": {
    "columns": [
      {
        "ordinal": 0,
        "name": "document_id",
        "type_info": "Text"
      },
      {
        "ordinal": 1,
        "name": "owner",
        "type_info": "Text"
      },
      {
        "ordinal": 2,
        "name": "document_name",
        "type_info": "Text"
      },
      {
        "ordinal": 3,
        "name": "document_version_id!",
        "type_info": "Int8"
      },
      {
        "ordinal": 4,
        "name": "file_type?",
        "type_info": "Text"
      },
      {
        "ordinal": 5,
        "name": "created_at",
        "type_info": "Timestamptz"
      },
      {
        "ordinal": 6,
        "name": "updated_at",
        "type_info": "Timestamptz"
      },
      {
        "ordinal": 7,
        "name": "document_bom?",
        "type_info": "Json"
      },
      {
        "ordinal": 8,
        "name": "project_id?",
        "type_info": "Text"
      },
      {
        "ordinal": 9,
        "name": "project_name?",
        "type_info": "Text"
      }
    ],
    "parameters": {
      "Left": [
        "Int8",
        "Int8"
      ]
    },
    "nullable": [
      false,
      false,
      false,
      false,
      true,
      null,
      null,
      null,
      true,
      false
    ]
  },
  "hash": "5183d95583de1d3aa5cb183c528a2ea768622c3b189ffa6664c15669f7d78b90"
}