{
  "db_name": "PostgreSQL",
  "query": "\n            WITH resolved AS (\n                SELECT DISTINCT ON (key) key, value, is_secret, is_protected,\n                    CASE WHEN environment_id IS NOT NULL THEN $4 ELSE 'global' END as source\n                FROM project_env_vars\n                WHERE project_id = $2 AND (environment_id IS NULL OR environment_id = $3)\n                ORDER BY key, CASE WHEN environment_id IS NOT NULL THEN 0 ELSE 1 END\n            )\n            INSERT INTO deployment_env_vars (deployment_id, key, value, is_secret, is_protected, source)\n            SELECT $1, key, value, is_secret, is_protected, source FROM resolved\n            ",
  "describe": {
    "columns": [],
    "parameters": {
      "Left": [
        "Uuid",
        "Uuid",
        "Uuid",
        "Text"
      ]
    },
    "nullable": []
  },
  "hash": "db538fde3bfbef84c2e74ed0ef1a85b06e598b6e0a3c95a80788d9fe46c0bd50"
}
