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.

1.5 KB
Raw Blame
{
  "db_name": "PostgreSQL",
  "query": "\n        UPDATE user_ai_projection u\n        SET status = 'refreshing', prompt_hash = p.prompt_hash, updated_at = NOW()\n        FROM ai_projection p\n        WHERE u.ai_projection_id = p.id\n          AND p.refresh_cadence = $1\n          AND (\n                (u.stale_at IS NOT NULL AND u.stale_at < NOW())\n                OR (u.status = 'error' AND u.stale_at IS NULL)\n              )\n          AND u.last_requested_at >= NOW() - (\n                CASE p.expiry\n                    WHEN 'day'   THEN INTERVAL '1 day'\n                    WHEN 'week'  THEN INTERVAL '7 days'\n                    WHEN 'month' THEN INTERVAL '30 days'\n                END)\n          AND (\n                u.status IN ('ready', 'error')\n                OR (u.status = 'refreshing' AND u.updated_at < NOW() - INTERVAL '15 minutes')\n              )\n        RETURNING u.ai_projection_id, u.target_id, p.prompt_hash\n        ",
  "describe": {
    "columns": [
      {
        "ordinal": 0,
        "name": "ai_projection_id",
        "type_info": "Text"
      },
      {
        "ordinal": 1,
        "name": "target_id",
        "type_info": "Text"
      },
      {
        "ordinal": 2,
        "name": "prompt_hash",
        "type_info": "Text"
      }
    ],
    "parameters": {
      "Left": [
        "Text"
      ]
    },
    "nullable": [
      false,
      false,
      false
    ]
  },
  "hash": "4cacf56482bf5307f00763a90f91a1bae873a0cb73d8785e238bdaf71f58d9b7"
}