You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR enables configuring DBOS with just a system database, like this:
```python
config: DBOSConfig = {
"name": "dbos-starter",
"system_database_url": os.environ.get("DBOS_SYSTEM_DATABASE_URL"),
}
DBOS(config=config)
```
If using transactions, the application database can be configured
separately:
```python
config: DBOSConfig = {
"name": "dbos-starter",
"system_database_url": os.environ.get("DBOS_SYSTEM_DATABASE_URL"),
"application_database_url": os.environ.get("APP_DATABASE_URL"),
}
DBOS(config=config)
```
This is fully backwards-compatible—the old way of configuring DBOS
with just `database_url` (which points to an application database, with
the system database name suffixed with `_dbos_sys` if not provided) is
still supported, though it will be removed in a future major release.
The client interface and CLI are updated similarly.
The client can now be created with just a system database URL:
```python
client = DBOSClient(
system_database_url=os.environ.get("DBOS_DATABASE_URL"),
)
```
All CLI commands now accept a `--sys-db-url` parameter.
@@ -22,9 +22,10 @@ class DBOSConfig(TypedDict, total=False):
22
22
23
23
Attributes:
24
24
name (str): Application name
25
-
database_url (str): Database connection string
26
-
system_database_url (str): Connection string for the system database (if different from the application database)
27
-
sys_db_name (str): System database name (deprecated)
25
+
system_database_url (str): Connection string for the DBOS system database. Defaults to sqlite:///{name} if not provided.
26
+
application_database_url (str): Connection string for the DBOS application database, in which DBOS @Transaction functions run. Optional. Should be the same type of database (SQLite or Postgres) as the system database.
# Gather connect_timeout from the URL if provided. It should be used in engine kwargs if not provided there (instead of our default). This overrides a timeout from the application database, if any.
f"[bold blue]DBOS system database URL: {printable_sys_db_url}[/bold blue]"
446
+
)
391
447
ifdata["database_url"].startswith("sqlite"):
392
448
print(
393
449
f"[bold blue]Using SQLite as a system database. The SQLite system database is for development and testing. PostgreSQL is recommended for production use.[/bold blue]"
# Load the DBOS configuration file and force the use of:
477
-
# 1. The database url provided by DBOS_DATABASE_URL
533
+
# 1. The application and system database url provided by DBOS_DATABASE_URL and DBOS_SYSTEM_DATABASE_URL
478
534
# 2. OTLP traces endpoints (add the config data to the provided config)
479
535
# 3. Use the application name from the file. This is a defensive measure to ensure the application name is whatever it was registered with in the cloud
480
536
# 4. Remove admin_port is provided in code
481
537
# 5. Remove env vars if provided in code
482
538
# Optimistically assume that expected fields in config_from_file are present
0 commit comments