{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://gmr.github.io/pglifecycle/schemata/project.json",
  "title": "Project",
  "description": "`project.yaml` at the root of a project: the database-wide settings, and the objects that belong to the database rather than to a schema.\n",
  "type": "object",
  "properties": {
    "name": {
      "description": "The name of the database that is saved in the build artifact when generating a dump.",
      "type": "string"
    },
    "encoding": {
      "description": "The database encoding to use",
      "type": "string",
      "default": "UTF8"
    },
    "stdstrings": {
      "description": "Turn standard confirming strings on/off in the created build artifact",
      "type": "boolean",
      "default": true
    },
    "superuser": {
      "description": "The PostgreSQL super user",
      "type": "string",
      "default": "postgres"
    },
    "extensions": {
      "description": "An array of PostgreSQL extensions to load into the database",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "description": "The name of the extension to be installed. PostgreSQL will create the extension using details from the file SHAREDIR/extension/extension_name.control.\n",
            "type": "string"
          },
          "schema": {
            "description": "The name of the schema in which to install the extension's objects, given that the extension allows its contents to be relocated.\n",
            "type": "string"
          },
          "version": {
            "description": "The version of the extension to install. This can be written as either an identifier or a string literal. The default version is whatever is specified in the extension's control file.\n",
            "type": "string"
          },
          "cascade": {
            "description": "Automatically install any extensions that this extension depends on that are not already installed.\n",
            "type": "boolean",
            "default": false
          },
          "comment": {
            "title": "Comment",
            "description": "An optional comment about the extension",
            "type": "string"
          }
        },
        "required": [
          "name"
        ]
      }
    },
    "foreign_data_wrappers": {
      "title": "Foreign Data Wrappers",
      "description": "An array of Foreign Data Wrappers to create in the database",
      "type": "array",
      "items": {
        "title": "Foreign Data Wrapper",
        "description": "Foreign Data Wrappers provide a standardized way of handling access to remote data stores.\n",
        "type": "object",
        "properties": {
          "name": {
            "title": "Foreign Data Wrapper Name",
            "description": "The name of the foreign data wrapper to be created.\n",
            "type": "string"
          },
          "owner": {
            "title": "Owner",
            "description": "The role name of the superuser who owns the Foreign Data Wrapper.\n",
            "type": "string"
          },
          "comment": {
            "title": "Comment",
            "description": "An optional comment about the Foreign Data Wrapper.",
            "type": "string"
          },
          "handler": {
            "title": "Handler",
            "description": "The name of a previously registered function that will be called to retrieve the execution functions for foreign tables. The handler function must take no arguments, and its return type must be fdw_handler.\nIt is possible to create a foreign-data wrapper with no handler function, but foreign tables using such a wrapper can only be declared, not accessed.\n",
            "type": "string"
          },
          "validator": {
            "title": "Validator",
            "description": "The name of a previously registered function that will be called to check the generic options given to the foreign-data wrapper, as well as options for foreign servers, user mappings and foreign tables using the foreign-data wrapper. If no validator function or NO VALIDATOR is specified, then options will not be checked at creation time. (Foreign-data wrappers will possibly ignore or reject invalid option specifications at run time, depending on the implementation.) The validator function must take two arguments: one of type text[], which will contain the array of options as stored in the system catalogs, and one of type oid, which will be the OID of the system catalog containing the options. The return type is ignored; the function should report invalid options using the ereport(ERROR) function.\n",
            "type": "string"
          },
          "options": {
            "title": "Options",
            "description": "This clause specifies options for the new foreign-data wrapper. The allowed option names and values are specific to each foreign data wrapper and are validated using the foreign-data wrapper's validator function. Option names must be unique.\n",
            "type": "object",
            "propertyNames": {
              "pattern": "^[A-Za-z_][A-Za-z0-9_\\.]*$"
            }
          }
        },
        "additionalProperties": false
      }
    },
    "languages": {
      "description": "An array of Procedural Languages to load into the database",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "description": "The name of the language to load",
            "type": "string"
          },
          "comment": {
            "title": "Comment",
            "description": "An optional comment about the language",
            "type": "string"
          },
          "trusted": {
            "description": "Specifies if the language grants access to data that the user would not otherwise have access to.\n",
            "type": "boolean",
            "default": false
          },
          "replace": {
            "description": "Use CREATE or REPLACE syntax",
            "type": "boolean",
            "default": false
          },
          "handler": {
            "description": "Specifies the name of a previously registered function that will be called to execute the procedural language's functions.\n",
            "type": "string"
          },
          "inline_handler": {
            "description": "Specifies the name of a previously registered function that will be called to execute an anonymous code block (DO command) in this language.\n",
            "type": "string"
          },
          "validator": {
            "description": "Specifies the name of a previously registered function that will be called when a new function in the language is created, to validate the new function.\n",
            "type": "string"
          }
        },
        "required": [
          "name"
        ]
      }
    }
  },
  "required": [
    "name"
  ],
  "additionalProperties": false
}