diff --git a/engine/config/1.0/schema.json b/engine/config/1.0/schema.json index 04aa2df..7dd1d6e 100644 --- a/engine/config/1.0/schema.json +++ b/engine/config/1.0/schema.json @@ -446,27 +446,30 @@ "type": "object", "description": "Configures the persistent storage system.", "properties": { - "embedded": { + "in_memory": { "type": "object", - "description": "Use an embedded PostgreSQL database for local development. Data is persisted to the specified data path.", + "description": "Use an in-memory database (data is not persisted between restarts). If storage is not configured, this is the default.", + "additionalProperties": false + } + }, + "required": ["in_memory"], + "additionalProperties": false + }, + { + "type": "object", + "description": "Configures the persistent storage system.", + "properties": { + "sqlite": { + "type": "object", + "description": "Use a SQLite database for persistent storage.", "properties": { - "data_path": { - "type": "string", - "description": "The path where PostgreSQL data will be stored. Defaults to ~/.arcade/postgres-data if not specified." - }, - "port": { - "description": "The port for the embedded PostgreSQL server. Defaults to 5432.", - "oneOf": [ - { "type": "integer", "default": 5432 }, - { "$ref": "#/$defs/envVarPattern" }, - { "$ref": "#/$defs/filePattern" } - ] - } + "connection_string": { "type": "string" } }, + "required": ["connection_string"], "additionalProperties": false } }, - "required": ["embedded"], + "required": ["sqlite"], "additionalProperties": false }, { @@ -475,7 +478,7 @@ "properties": { "postgres": { "type": "object", - "description": "Use an external PostgreSQL database for persistent storage.", + "description": "Use a PostgreSQL database for persistent storage.", "properties": { "user": { "type": "string" }, "password": { "type": "string" }, @@ -515,7 +518,7 @@ }, { "type": "null", - "description": "No storage configuration is set. Uses embedded PostgreSQL with default settings." + "description": "No storage configuration is set. Uses an in-memory database (data is not persisted between restarts)." } ] }, diff --git a/engine/config/2.0/example.yaml b/engine/config/2.0/example.yaml index 630e123..893106b 100644 --- a/engine/config/2.0/example.yaml +++ b/engine/config/2.0/example.yaml @@ -143,13 +143,14 @@ security: storage: postgres: - user: ${env:POSTGRES_USER} - password: ${env:POSTGRES_PASSWORD} - host: ${env:POSTGRES_HOST} - port: ${env:POSTGRES_PORT} - db: ${env:POSTGRES_DB} - sslmode: require data_path: ${env:POSTGRES_DATA_PATH} + # Or, connect to an external Postgres instance: + # user: ${env:POSTGRES_USER} + # password: ${env:POSTGRES_PASSWORD} + # host: ${env:POSTGRES_HOST} + # port: ${env:POSTGRES_PORT} + # db: ${env:POSTGRES_DB} + # sslmode: require telemetry: diff --git a/engine/config/2.0/schema.json b/engine/config/2.0/schema.json index 0c5b3f9..8c42ffa 100644 --- a/engine/config/2.0/schema.json +++ b/engine/config/2.0/schema.json @@ -449,63 +449,72 @@ "postgres": { "type": "object", "description": "PostgreSQL configuration. Use 'data_path' for embedded mode (local development) or 'host' for external mode (production).", - "properties": { - "data_path": { - "type": "string", - "description": "Enables embedded PostgreSQL mode. Data is stored at this path. Defaults to ~/.arcade/postgres-data if not specified. Mutually exclusive with 'host'." - }, - "host": { - "type": "string", - "description": "The hostname of the external PostgreSQL server. When set, connects to an external database instead of using embedded mode." - }, - "port": { - "description": "The port for the PostgreSQL server. Defaults to 5432.", - "oneOf": [ - { "type": "integer", "default": 5432 }, - { "$ref": "#/$defs/envVarPattern" }, - { "$ref": "#/$defs/filePattern" } - ] - }, - "user": { - "type": "string", - "description": "The username for the PostgreSQL connection. Required for external mode." - }, - "password": { - "type": "string", - "description": "The password for the PostgreSQL connection. Required for external mode." - }, - "db": { - "type": "string", - "description": "The database name. Required for external mode." + "oneOf": [ + { + "type": "object", + "properties": { + "data_path": { + "type": "string", + "description": "Enables embedded PostgreSQL mode. Data is stored at this path. Defaults to ~/.arcade/postgres-data if empty or not specified. Mutually exclusive with 'host'." + } + }, + "required": ["data_path"], + "additionalProperties": false }, - "sslmode": { - "description": "The SSL mode for the PostgreSQL connection. Required for external mode.", - "oneOf": [ - { + { + "type": "object", + "properties": { + "host": { "type": "string", - "enum": [ - "disable", - "allow", - "prefer", - "require", - "verify-ca", - "verify-full" + "description": "The hostname of the external PostgreSQL server. When set, connects to an external database instead of using embedded mode." + }, + "port": { + "description": "The port for the PostgreSQL server. Defaults to 5432.", + "oneOf": [ + { "type": "integer", "default": 5432 }, + { "$ref": "#/$defs/envVarPattern" }, + { "$ref": "#/$defs/filePattern" } ] }, - { "$ref": "#/$defs/envVarPattern" }, - { "$ref": "#/$defs/filePattern" } - ] + "user": { + "type": "string", + "description": "The username for the PostgreSQL connection. Required for external mode." + }, + "password": { + "type": "string", + "description": "The password for the PostgreSQL connection. Required for external mode." + }, + "db": { + "type": "string", + "description": "The database name. Required for external mode." + }, + "sslmode": { + "description": "The SSL mode for the PostgreSQL connection. Required for external mode.", + "oneOf": [ + { + "type": "string", + "enum": [ + "disable", + "allow", + "prefer", + "require", + "verify-ca", + "verify-full" + ] + }, + { "$ref": "#/$defs/envVarPattern" }, + { "$ref": "#/$defs/filePattern" } + ] + } + }, + "required": ["host", "port", "user", "password", "db", "sslmode"], + "additionalProperties": false } - }, - "additionalProperties": false + ] } }, "required": ["postgres"], "additionalProperties": false - }, - { - "type": "null", - "description": "No storage configuration is set. Uses embedded PostgreSQL with default settings." } ] },