{
  "schema_id": "acme_orders_v1",
  "dialect": "postgresql",
  "timezone": "UTC",
  "description": "Optional notes about this database.",
  "tables": {
    "public.orders": {
      "isolation": {"mode": "jwt_email", "column": "tenant_email"},
      "allow_columns": ["id", "status", "amount", "created_at", "deleted_at"],
      "column_types": {
        "id": "INTEGER",
        "amount": "NUMERIC",
        "created_at": "TIMESTAMPTZ",
        "deleted_at": "TIMESTAMPTZ"
      },
      "description": "Customer orders.",
      "aliases": ["order", "purchase"],
      "column_values": {"status": ["open", "closed", "pending"]},
      "column_case": {"status": "sensitive"},
      "column_operators": {
        "status": ["eq", "in", "neq"],
        "amount": ["eq", "gt", "gte", "lt", "lte"]
      },
      "default_order": [{"column": "created_at", "direction": "DESC"}],
      "soft_delete": {"column": "deleted_at", "operator": "is_null"},
      "indexes": [
        {"name": "orders_tenant_status", "columns": ["tenant_email", "status"]},
        {"name": "orders_tenant_created", "columns": ["tenant_email", "created_at"]}
      ]
    },
    "public.order_items": {
      "isolation": {"mode": "via_join", "required_path_id": "path_items_orders"},
      "allow_columns": ["id", "order_id", "sku", "qty"],
      "column_types": {"id": "INTEGER", "qty": "INTEGER"},
      "description": "Line items on an order.",
      "indexes": [
        {"name": "order_items_order_id", "columns": ["order_id"]}
      ]
    }
  },
  "join_paths": [
    {
      "path_id": "path_items_orders",
      "type": "INNER",
      "left": {"schema": "public", "table": "order_items", "column": "order_id"},
      "right": {"schema": "public", "table": "orders", "column": "id"},
      "cardinality": "N:1",
      "required_when_from": ["public.order_items"],
      "when_to_use": "Line items join to the parent order.",
      "inject": [
        {"schema": "public", "table": "orders", "column": "tenant_email", "source": "jwt_email"}
      ]
    }
  ],
  "from_forbidden": [],
  "policy": {
    "limit_default": 100,
    "limit_hard": 1000,
    "rate_limit_per_email_per_minute": 10,
    "flask_wall_clock_s": 30
  }
}
