{
  "db_name": "PostgreSQL",
  "query": "\n            WITH resolved AS (\n                SELECT DISTINCT ON (key) key, value, is_secret, is_protected\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)\n            SELECT $1, key, value, is_secret, is_protected FROM resolved\n            ",
  "describe": {
    "columns": [],
    "parameters": {
      "Left": [
        "Uuid",
        "Uuid",
        "Uuid"
      ]
    },
    "nullable": []
  },
  "hash": "cdfb3808b3dda7a930d23619cde7121b37e903d5e4e40b8196ee660eea2c56d2"
}
