dbos 0.28.0a7__py3-none-any.whl → 0.28.0a12__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of dbos might be problematic. Click here for more details.
- dbos/__init__.py +1 -4
- dbos/_admin_server.py +20 -4
- dbos/_client.py +2 -0
- dbos/_conductor/conductor.py +1 -1
- dbos/_dbos.py +7 -57
- dbos/_dbos_config.py +2 -56
- dbos/_docker_pg_helper.py +8 -1
- dbos/_sys_db.py +16 -10
- dbos/_templates/dbos-db-starter/__package/{main.py → main.py.dbos} +7 -2
- dbos/_templates/dbos-db-starter/migrations/env.py.dbos +5 -5
- dbos/cli/_template_init.py +3 -0
- dbos/cli/cli.py +6 -9
- {dbos-0.28.0a7.dist-info → dbos-0.28.0a12.dist-info}/METADATA +1 -1
- {dbos-0.28.0a7.dist-info → dbos-0.28.0a12.dist-info}/RECORD +17 -17
- {dbos-0.28.0a7.dist-info → dbos-0.28.0a12.dist-info}/WHEEL +0 -0
- {dbos-0.28.0a7.dist-info → dbos-0.28.0a12.dist-info}/entry_points.txt +0 -0
- {dbos-0.28.0a7.dist-info → dbos-0.28.0a12.dist-info}/licenses/LICENSE +0 -0
dbos/__init__.py
CHANGED
@@ -8,13 +8,12 @@ from ._context import (
|
|
8
8
|
SetWorkflowTimeout,
|
9
9
|
)
|
10
10
|
from ._dbos import DBOS, DBOSConfiguredInstance, WorkflowHandle, WorkflowHandleAsync
|
11
|
-
from ._dbos_config import
|
11
|
+
from ._dbos_config import DBOSConfig
|
12
12
|
from ._kafka_message import KafkaMessage
|
13
13
|
from ._queue import Queue
|
14
14
|
from ._sys_db import GetWorkflowsInput, WorkflowStatus, WorkflowStatusString
|
15
15
|
|
16
16
|
__all__ = [
|
17
|
-
"ConfigFile",
|
18
17
|
"DBOSConfig",
|
19
18
|
"DBOS",
|
20
19
|
"DBOSClient",
|
@@ -31,8 +30,6 @@ __all__ = [
|
|
31
30
|
"WorkflowHandleAsync",
|
32
31
|
"WorkflowStatus",
|
33
32
|
"WorkflowStatusString",
|
34
|
-
"load_config",
|
35
|
-
"get_dbos_database_url",
|
36
33
|
"error",
|
37
34
|
"Queue",
|
38
35
|
]
|
dbos/_admin_server.py
CHANGED
@@ -171,9 +171,17 @@ class AdminRequestHandler(BaseHTTPRequestHandler):
|
|
171
171
|
def _handle_restart(self, workflow_id: str) -> None:
|
172
172
|
try:
|
173
173
|
print(f"Restarting workflow {workflow_id}")
|
174
|
-
self.dbos.restart_workflow(workflow_id)
|
175
|
-
|
174
|
+
handle = self.dbos.restart_workflow(workflow_id)
|
175
|
+
response_body = json.dumps(
|
176
|
+
{
|
177
|
+
"workflow_id": handle.workflow_id,
|
178
|
+
}
|
179
|
+
).encode("utf-8")
|
180
|
+
self.send_response(200)
|
181
|
+
self.send_header("Content-Type", "application/json")
|
182
|
+
self.send_header("Content-Length", str(len(response_body)))
|
176
183
|
self._end_headers()
|
184
|
+
self.wfile.write(response_body)
|
177
185
|
except DBOSException as e:
|
178
186
|
print(f"Error restarting workflow: {e}")
|
179
187
|
self.send_response(500)
|
@@ -185,9 +193,17 @@ class AdminRequestHandler(BaseHTTPRequestHandler):
|
|
185
193
|
|
186
194
|
def _handle_fork(self, workflow_id: str, start_step: int) -> None:
|
187
195
|
try:
|
188
|
-
self.dbos.fork_workflow(workflow_id, start_step)
|
189
|
-
|
196
|
+
handle = self.dbos.fork_workflow(workflow_id, start_step)
|
197
|
+
response_body = json.dumps(
|
198
|
+
{
|
199
|
+
"workflow_id": handle.workflow_id,
|
200
|
+
}
|
201
|
+
).encode("utf-8")
|
202
|
+
self.send_response(200)
|
203
|
+
self.send_header("Content-Type", "application/json")
|
204
|
+
self.send_header("Content-Length", str(len(response_body)))
|
190
205
|
self._end_headers()
|
206
|
+
self.wfile.write(response_body)
|
191
207
|
except DBOSException as e:
|
192
208
|
print(f"Error forking workflow: {e}")
|
193
209
|
self.send_response(500)
|
dbos/_client.py
CHANGED
@@ -302,6 +302,7 @@ class DBOSClient:
|
|
302
302
|
limit: Optional[int] = None,
|
303
303
|
offset: Optional[int] = None,
|
304
304
|
sort_desc: bool = False,
|
305
|
+
workflow_id_prefix: Optional[str] = None,
|
305
306
|
) -> List[WorkflowStatus]:
|
306
307
|
return await asyncio.to_thread(
|
307
308
|
self.list_workflows,
|
@@ -315,6 +316,7 @@ class DBOSClient:
|
|
315
316
|
limit=limit,
|
316
317
|
offset=offset,
|
317
318
|
sort_desc=sort_desc,
|
319
|
+
workflow_id_prefix=workflow_id_prefix,
|
318
320
|
)
|
319
321
|
|
320
322
|
def list_queued_workflows(
|
dbos/_conductor/conductor.py
CHANGED
@@ -35,7 +35,7 @@ class ConductorWebsocket(threading.Thread):
|
|
35
35
|
self.websocket: Optional[Connection] = None
|
36
36
|
self.evt = evt
|
37
37
|
self.dbos = dbos
|
38
|
-
self.app_name = dbos.
|
38
|
+
self.app_name = dbos._config["name"]
|
39
39
|
self.url = (
|
40
40
|
conductor_url.rstrip("/") + f"/websocket/{self.app_name}/{conductor_key}"
|
41
41
|
)
|
dbos/_dbos.py
CHANGED
@@ -94,8 +94,6 @@ from ._dbos_config import (
|
|
94
94
|
ConfigFile,
|
95
95
|
DBOSConfig,
|
96
96
|
check_config_consistency,
|
97
|
-
is_dbos_configfile,
|
98
|
-
load_config,
|
99
97
|
overwrite_config,
|
100
98
|
process_config,
|
101
99
|
set_env_vars,
|
@@ -160,7 +158,6 @@ class DBOSRegistry:
|
|
160
158
|
self.queue_info_map: dict[str, Queue] = {}
|
161
159
|
self.pollers: list[RegisteredJob] = []
|
162
160
|
self.dbos: Optional[DBOS] = None
|
163
|
-
self.config: Optional[ConfigFile] = None
|
164
161
|
|
165
162
|
def register_wf_function(self, name: str, wrapped_func: F, functype: str) -> None:
|
166
163
|
if name in self.function_type_map:
|
@@ -264,7 +261,7 @@ class DBOS:
|
|
264
261
|
def __new__(
|
265
262
|
cls: Type[DBOS],
|
266
263
|
*,
|
267
|
-
config:
|
264
|
+
config: DBOSConfig,
|
268
265
|
fastapi: Optional["FastAPI"] = None,
|
269
266
|
flask: Optional["Flask"] = None,
|
270
267
|
conductor_url: Optional[str] = None,
|
@@ -273,25 +270,8 @@ class DBOS:
|
|
273
270
|
global _dbos_global_instance
|
274
271
|
global _dbos_global_registry
|
275
272
|
if _dbos_global_instance is None:
|
276
|
-
if (
|
277
|
-
_dbos_global_registry is not None
|
278
|
-
and _dbos_global_registry.config is not None
|
279
|
-
):
|
280
|
-
if config is not None and config is not _dbos_global_registry.config:
|
281
|
-
raise DBOSException(
|
282
|
-
f"DBOS configured multiple times with conflicting information"
|
283
|
-
)
|
284
|
-
config = _dbos_global_registry.config
|
285
|
-
|
286
273
|
_dbos_global_instance = super().__new__(cls)
|
287
274
|
_dbos_global_instance.__init__(fastapi=fastapi, config=config, flask=flask, conductor_url=conductor_url, conductor_key=conductor_key) # type: ignore
|
288
|
-
else:
|
289
|
-
if (config is not None and _dbos_global_instance.config is not config) or (
|
290
|
-
_dbos_global_instance.fastapi is not fastapi
|
291
|
-
):
|
292
|
-
raise DBOSException(
|
293
|
-
f"DBOS Initialized multiple times with conflicting configuration / fastapi information"
|
294
|
-
)
|
295
275
|
return _dbos_global_instance
|
296
276
|
|
297
277
|
@classmethod
|
@@ -309,7 +289,7 @@ class DBOS:
|
|
309
289
|
def __init__(
|
310
290
|
self,
|
311
291
|
*,
|
312
|
-
config:
|
292
|
+
config: DBOSConfig,
|
313
293
|
fastapi: Optional["FastAPI"] = None,
|
314
294
|
flask: Optional["Flask"] = None,
|
315
295
|
conductor_url: Optional[str] = None,
|
@@ -342,26 +322,11 @@ class DBOS:
|
|
342
322
|
|
343
323
|
init_logger()
|
344
324
|
|
345
|
-
|
346
|
-
|
347
|
-
if
|
348
|
-
|
349
|
-
|
350
|
-
elif is_dbos_configfile(config):
|
351
|
-
dbos_logger.warning(
|
352
|
-
"ConfigFile config strutcture detected. This will be deprecated in favor of DBOSConfig in an upcoming release."
|
353
|
-
)
|
354
|
-
unvalidated_config = cast(ConfigFile, config)
|
355
|
-
if os.environ.get("DBOS__CLOUD") == "true":
|
356
|
-
unvalidated_config = overwrite_config(unvalidated_config)
|
357
|
-
check_config_consistency(name=unvalidated_config["name"])
|
358
|
-
else:
|
359
|
-
unvalidated_config = translate_dbos_config_to_config_file(
|
360
|
-
cast(DBOSConfig, config)
|
361
|
-
)
|
362
|
-
if os.environ.get("DBOS__CLOUD") == "true":
|
363
|
-
unvalidated_config = overwrite_config(unvalidated_config)
|
364
|
-
check_config_consistency(name=unvalidated_config["name"])
|
325
|
+
# Translate user provided config to an internal format
|
326
|
+
unvalidated_config = translate_dbos_config_to_config_file(config)
|
327
|
+
if os.environ.get("DBOS__CLOUD") == "true":
|
328
|
+
unvalidated_config = overwrite_config(unvalidated_config)
|
329
|
+
check_config_consistency(name=unvalidated_config["name"])
|
365
330
|
|
366
331
|
if unvalidated_config is not None:
|
367
332
|
self._config: ConfigFile = process_config(data=unvalidated_config)
|
@@ -1086,21 +1051,6 @@ class DBOS:
|
|
1086
1051
|
"""Return the DBOS `Logger` for the current context."""
|
1087
1052
|
return dbos_logger # TODO get from context if appropriate...
|
1088
1053
|
|
1089
|
-
@classproperty
|
1090
|
-
def config(cls) -> ConfigFile:
|
1091
|
-
"""Return the DBOS `ConfigFile` for the current context."""
|
1092
|
-
global _dbos_global_instance
|
1093
|
-
if _dbos_global_instance is not None:
|
1094
|
-
return _dbos_global_instance._config
|
1095
|
-
reg = _get_or_create_dbos_registry()
|
1096
|
-
if reg.config is not None:
|
1097
|
-
return reg.config
|
1098
|
-
loaded_config = (
|
1099
|
-
load_config()
|
1100
|
-
) # This will return the processed & validated config (with defaults)
|
1101
|
-
reg.config = loaded_config
|
1102
|
-
return loaded_config
|
1103
|
-
|
1104
1054
|
@classproperty
|
1105
1055
|
def sql_session(cls) -> Session:
|
1106
1056
|
"""Return the SQLAlchemy `Session` for the current context, which must be within a transaction function."""
|
dbos/_dbos_config.py
CHANGED
@@ -1,19 +1,13 @@
|
|
1
1
|
import json
|
2
2
|
import os
|
3
3
|
import re
|
4
|
-
import sys
|
5
4
|
from importlib import resources
|
6
|
-
from typing import Any, Dict, List, Optional, TypedDict,
|
7
|
-
|
8
|
-
if sys.version_info < (3, 10):
|
9
|
-
from typing_extensions import TypeGuard
|
10
|
-
else:
|
11
|
-
from typing import TypeGuard
|
5
|
+
from typing import Any, Dict, List, Optional, TypedDict, cast
|
12
6
|
|
13
7
|
import yaml
|
14
8
|
from jsonschema import ValidationError, validate
|
15
9
|
from rich import print
|
16
|
-
from sqlalchemy import
|
10
|
+
from sqlalchemy import make_url
|
17
11
|
|
18
12
|
from ._error import DBOSInitializationError
|
19
13
|
from ._logger import dbos_logger
|
@@ -146,28 +140,6 @@ class ConfigFile(TypedDict, total=False):
|
|
146
140
|
env: Dict[str, str]
|
147
141
|
|
148
142
|
|
149
|
-
def is_dbos_configfile(data: Union[ConfigFile, DBOSConfig]) -> TypeGuard[DBOSConfig]:
|
150
|
-
"""
|
151
|
-
Type guard to check if the provided data is a DBOSConfig.
|
152
|
-
|
153
|
-
Args:
|
154
|
-
data: The configuration object to check
|
155
|
-
|
156
|
-
Returns:
|
157
|
-
True if the data is a DBOSConfig, False otherwise
|
158
|
-
"""
|
159
|
-
return (
|
160
|
-
isinstance(data, dict)
|
161
|
-
and "name" in data
|
162
|
-
and (
|
163
|
-
"runtimeConfig" in data
|
164
|
-
or "database" in data
|
165
|
-
or "env" in data
|
166
|
-
or "telemetry" in data
|
167
|
-
)
|
168
|
-
)
|
169
|
-
|
170
|
-
|
171
143
|
def translate_dbos_config_to_config_file(config: DBOSConfig) -> ConfigFile:
|
172
144
|
if "name" not in config:
|
173
145
|
raise DBOSInitializationError(f"Configuration must specify an application name")
|
@@ -271,32 +243,6 @@ def _substitute_env_vars(content: str, silent: bool = False) -> str:
|
|
271
243
|
return re.sub(env_regex, replace_env_func, content)
|
272
244
|
|
273
245
|
|
274
|
-
def get_dbos_database_url(config_file_path: str = DBOS_CONFIG_PATH) -> str:
|
275
|
-
"""
|
276
|
-
Retrieve application database URL from configuration `.yaml` file.
|
277
|
-
|
278
|
-
Loads the DBOS `ConfigFile` from the specified path (typically `dbos-config.yaml`),
|
279
|
-
and returns the database URL for the application database.
|
280
|
-
|
281
|
-
Args:
|
282
|
-
config_file_path (str): The path to the yaml configuration file.
|
283
|
-
|
284
|
-
Returns:
|
285
|
-
str: Database URL for the application database
|
286
|
-
|
287
|
-
"""
|
288
|
-
dbos_config = load_config(config_file_path, run_process_config=True)
|
289
|
-
db_url = URL.create(
|
290
|
-
"postgresql+psycopg",
|
291
|
-
username=dbos_config["database"]["username"],
|
292
|
-
password=dbos_config["database"]["password"],
|
293
|
-
host=dbos_config["database"]["hostname"],
|
294
|
-
port=dbos_config["database"]["port"],
|
295
|
-
database=dbos_config["database"]["app_db_name"],
|
296
|
-
)
|
297
|
-
return db_url.render_as_string(hide_password=False)
|
298
|
-
|
299
|
-
|
300
246
|
def load_config(
|
301
247
|
config_file_path: str = DBOS_CONFIG_PATH,
|
302
248
|
*,
|
dbos/_docker_pg_helper.py
CHANGED
@@ -83,6 +83,7 @@ def start_docker_postgres(pool_config: Dict[str, Any]) -> bool:
|
|
83
83
|
logging.info("Starting a Postgres Docker container...")
|
84
84
|
container_name = "dbos-db"
|
85
85
|
pg_data = "/var/lib/postgresql/data"
|
86
|
+
image_name = "pgvector/pgvector:pg16"
|
86
87
|
|
87
88
|
try:
|
88
89
|
client = docker.from_env()
|
@@ -103,9 +104,15 @@ def start_docker_postgres(pool_config: Dict[str, Any]) -> bool:
|
|
103
104
|
# Container doesn't exist, proceed with creation
|
104
105
|
pass
|
105
106
|
|
107
|
+
# Pull the image if it doesn't exist
|
108
|
+
imgs = client.images.list(name=image_name)
|
109
|
+
if len(imgs) == 0:
|
110
|
+
logging.info(f"Pulling Docker image {image_name}...")
|
111
|
+
client.images.pull(image_name)
|
112
|
+
|
106
113
|
# Create and start the container
|
107
114
|
container = client.containers.run(
|
108
|
-
image=
|
115
|
+
image=image_name,
|
109
116
|
name=container_name,
|
110
117
|
detach=True,
|
111
118
|
environment={
|
dbos/_sys_db.py
CHANGED
@@ -1735,14 +1735,29 @@ class SystemDatabase:
|
|
1735
1735
|
available_tasks = max(0, queue.concurrency - total_running_tasks)
|
1736
1736
|
max_tasks = min(max_tasks, available_tasks)
|
1737
1737
|
|
1738
|
-
#
|
1738
|
+
# Retrieve the first max_tasks workflows in the queue.
|
1739
|
+
# Only retrieve workflows of the appropriate version (or without version set)
|
1739
1740
|
query = (
|
1740
1741
|
sa.select(
|
1741
1742
|
SystemSchema.workflow_queue.c.workflow_uuid,
|
1742
1743
|
)
|
1744
|
+
.select_from(
|
1745
|
+
SystemSchema.workflow_queue.join(
|
1746
|
+
SystemSchema.workflow_status,
|
1747
|
+
SystemSchema.workflow_queue.c.workflow_uuid
|
1748
|
+
== SystemSchema.workflow_status.c.workflow_uuid,
|
1749
|
+
)
|
1750
|
+
)
|
1743
1751
|
.where(SystemSchema.workflow_queue.c.queue_name == queue.name)
|
1744
1752
|
.where(SystemSchema.workflow_queue.c.started_at_epoch_ms == None)
|
1745
1753
|
.where(SystemSchema.workflow_queue.c.completed_at_epoch_ms == None)
|
1754
|
+
.where(
|
1755
|
+
sa.or_(
|
1756
|
+
SystemSchema.workflow_status.c.application_version
|
1757
|
+
== app_version,
|
1758
|
+
SystemSchema.workflow_status.c.application_version.is_(None),
|
1759
|
+
)
|
1760
|
+
)
|
1746
1761
|
.order_by(
|
1747
1762
|
SystemSchema.workflow_queue.c.priority.asc(),
|
1748
1763
|
SystemSchema.workflow_queue.c.created_at_epoch_ms.asc(),
|
@@ -1778,15 +1793,6 @@ class SystemDatabase:
|
|
1778
1793
|
SystemSchema.workflow_status.c.status
|
1779
1794
|
== WorkflowStatusString.ENQUEUED.value
|
1780
1795
|
)
|
1781
|
-
.where(
|
1782
|
-
sa.or_(
|
1783
|
-
SystemSchema.workflow_status.c.application_version
|
1784
|
-
== app_version,
|
1785
|
-
SystemSchema.workflow_status.c.application_version.is_(
|
1786
|
-
None
|
1787
|
-
),
|
1788
|
-
)
|
1789
|
-
)
|
1790
1796
|
.values(
|
1791
1797
|
status=WorkflowStatusString.PENDING.value,
|
1792
1798
|
application_version=app_version,
|
@@ -6,16 +6,21 @@
|
|
6
6
|
|
7
7
|
# First, let's do imports, create a FastAPI app, and initialize DBOS.
|
8
8
|
|
9
|
+
import os
|
9
10
|
import uvicorn
|
10
11
|
from fastapi import FastAPI
|
11
12
|
from fastapi.responses import HTMLResponse
|
12
13
|
|
13
|
-
from dbos import DBOS
|
14
|
+
from dbos import DBOS, DBOSConfig
|
14
15
|
|
15
16
|
from .schema import dbos_hello
|
16
17
|
|
17
18
|
app = FastAPI()
|
18
|
-
|
19
|
+
dbos_config: DBOSConfig = {
|
20
|
+
"name": "${project_name}",
|
21
|
+
"database_url": os.environ.get("DBOS_DATABASE_URL", "postgresql+psycopg://postgres:dbos@localhost:5432/${default_db_name}?connect_timeout=5")
|
22
|
+
}
|
23
|
+
DBOS(fastapi=app, config=dbos_config)
|
19
24
|
|
20
25
|
# Next, let's write a function that greets visitors.
|
21
26
|
# To make it more interesting, we'll keep track of how
|
@@ -1,11 +1,10 @@
|
|
1
1
|
import re
|
2
|
+
import os
|
2
3
|
from logging.config import fileConfig
|
3
4
|
|
4
5
|
from alembic import context
|
5
6
|
from sqlalchemy import engine_from_config, pool
|
6
7
|
|
7
|
-
from dbos import get_dbos_database_url
|
8
|
-
|
9
8
|
# this is the Alembic Config object, which provides
|
10
9
|
# access to the values within the .ini file in use.
|
11
10
|
config = context.config
|
@@ -15,12 +14,13 @@ config = context.config
|
|
15
14
|
if config.config_file_name is not None:
|
16
15
|
fileConfig(config.config_file_name)
|
17
16
|
|
18
|
-
#
|
19
|
-
|
17
|
+
# Programmatically set the sqlalchemy.url field to the DBOS application database URL
|
18
|
+
conn_string = os.environ.get("DBOS_DATABASE_URL", "postgresql+psycopg://postgres:dbos@localhost:5432/${default_db_name}?connect_timeout=5")
|
19
|
+
# Alembic requires the % in URL-escaped parameters to itself be escaped to %%
|
20
20
|
escaped_conn_string = re.sub(
|
21
21
|
r"%(?=[0-9A-Fa-f]{2})",
|
22
22
|
"%%",
|
23
|
-
|
23
|
+
conn_string,
|
24
24
|
)
|
25
25
|
config.set_main_option("sqlalchemy.url", escaped_conn_string)
|
26
26
|
|
dbos/cli/_template_init.py
CHANGED
@@ -7,6 +7,8 @@ from typing import Any
|
|
7
7
|
import tomlkit
|
8
8
|
from rich import print
|
9
9
|
|
10
|
+
from dbos._dbos_config import _app_name_to_db_name
|
11
|
+
|
10
12
|
|
11
13
|
def get_templates_directory() -> str:
|
12
14
|
import dbos
|
@@ -64,6 +66,7 @@ def copy_template(src_dir: str, project_name: str, config_mode: bool) -> None:
|
|
64
66
|
"""
|
65
67
|
ctx = {
|
66
68
|
"project_name": project_name,
|
69
|
+
"default_db_name": _app_name_to_db_name(project_name),
|
67
70
|
"package_name": package_name,
|
68
71
|
"start_command": f"python3 -m {package_name}.main",
|
69
72
|
"migration_section": default_migration_section,
|
dbos/cli/cli.py
CHANGED
@@ -6,7 +6,6 @@ import time
|
|
6
6
|
import typing
|
7
7
|
from os import path
|
8
8
|
from typing import Any, Optional
|
9
|
-
from urllib.parse import quote
|
10
9
|
|
11
10
|
import jsonpickle # type: ignore
|
12
11
|
import sqlalchemy as sa
|
@@ -17,10 +16,9 @@ from typing_extensions import Annotated
|
|
17
16
|
|
18
17
|
from dbos._debug import debug_workflow, parse_start_command
|
19
18
|
|
20
|
-
from .. import load_config
|
21
19
|
from .._app_db import ApplicationDatabase
|
22
20
|
from .._client import DBOSClient
|
23
|
-
from .._dbos_config import _is_valid_app_name
|
21
|
+
from .._dbos_config import _is_valid_app_name, load_config
|
24
22
|
from .._docker_pg_helper import start_docker_pg, stop_docker_pg
|
25
23
|
from .._schemas.system_database import SystemSchema
|
26
24
|
from .._sys_db import SystemDatabase, reset_system_database
|
@@ -33,12 +31,11 @@ def start_client(db_url: Optional[str] = None) -> DBOSClient:
|
|
33
31
|
database_url = db_url
|
34
32
|
if database_url is None:
|
35
33
|
database_url = os.getenv("DBOS_DATABASE_URL")
|
36
|
-
|
37
|
-
|
38
|
-
database
|
39
|
-
|
40
|
-
|
41
|
-
database_url = f"postgresql://{username}:{password}@{database['hostname']}:{database['port']}/{database['app_db_name']}"
|
34
|
+
if database_url is None:
|
35
|
+
raise ValueError(
|
36
|
+
"Missing database URL: please set it using the --db-url flag or the DBOS_DATABASE_URL environment variable."
|
37
|
+
)
|
38
|
+
|
42
39
|
return DBOSClient(database_url=database_url)
|
43
40
|
|
44
41
|
|
@@ -1,22 +1,22 @@
|
|
1
|
-
dbos-0.28.
|
2
|
-
dbos-0.28.
|
3
|
-
dbos-0.28.
|
4
|
-
dbos-0.28.
|
5
|
-
dbos/__init__.py,sha256
|
1
|
+
dbos-0.28.0a12.dist-info/METADATA,sha256=nxjIfoX9CdMPTCpI-L-iIAHRyTjDDbjJKNbwI6gtiqc,13269
|
2
|
+
dbos-0.28.0a12.dist-info/WHEEL,sha256=tSfRZzRHthuv7vxpI4aehrdN9scLjk-dCJkPLzkHxGg,90
|
3
|
+
dbos-0.28.0a12.dist-info/entry_points.txt,sha256=_QOQ3tVfEjtjBlr1jS4sHqHya9lI2aIEIWkz8dqYp14,58
|
4
|
+
dbos-0.28.0a12.dist-info/licenses/LICENSE,sha256=VGZit_a5-kdw9WT6fY5jxAWVwGQzgLFyPWrcVVUhVNU,1067
|
5
|
+
dbos/__init__.py,sha256=NssPCubaBxdiKarOWa-wViz1hdJSkmBGcpLX_gQ4NeA,891
|
6
6
|
dbos/__main__.py,sha256=G7Exn-MhGrVJVDbgNlpzhfh8WMX_72t3_oJaFT9Lmt8,653
|
7
|
-
dbos/_admin_server.py,sha256=
|
7
|
+
dbos/_admin_server.py,sha256=A_28_nJ1nBBYDmCxtklJR9O2v14JRMtD1rAo_D4y8Kc,9764
|
8
8
|
dbos/_app_db.py,sha256=3j8_5-MlSDY0otLRszFE-GfenU6JC20fcfSL-drSNYk,11800
|
9
9
|
dbos/_classproperty.py,sha256=f0X-_BySzn3yFDRKB2JpCbLYQ9tLwt1XftfshvY7CBs,626
|
10
|
-
dbos/_client.py,sha256=
|
11
|
-
dbos/_conductor/conductor.py,sha256=
|
10
|
+
dbos/_client.py,sha256=PPktnvaLfl8Fj27YoOjy_kfgeQm_c3QQZztPyts5GZo,13924
|
11
|
+
dbos/_conductor/conductor.py,sha256=qP3fTe74gdaIN9SU9nCn2B5GYMBnhQ6shEhGezEcSPg,19693
|
12
12
|
dbos/_conductor/protocol.py,sha256=jwX8ZjmAIlXu1vw9R3b5PfHSNdwofeYOKj8rkfAFVg0,6630
|
13
13
|
dbos/_context.py,sha256=Ly1CXF1nWxICQgIpDZSaONGlz1yERBs63gqmR-yqCzM,24476
|
14
14
|
dbos/_core.py,sha256=UDpSgRA9m_YuViNXR9tVgNFLC-zxKZPxjlkj2a-Kj00,48317
|
15
15
|
dbos/_croniter.py,sha256=XHAyUyibs_59sJQfSNWkP7rqQY6_XrlfuuCxk4jYqek,47559
|
16
|
-
dbos/_dbos.py,sha256=
|
17
|
-
dbos/_dbos_config.py,sha256=
|
16
|
+
dbos/_dbos.py,sha256=tPpf_X9oLtpPICryXDMc589XuFeJtZ4cIq7vmsNDcls,46220
|
17
|
+
dbos/_dbos_config.py,sha256=pgzE5UP3LV_nhwIV4d1-W9q2LumQb1kla75xdx9mBcI,20136
|
18
18
|
dbos/_debug.py,sha256=MNlQVZ6TscGCRQeEEL0VE8Uignvr6dPeDDDefS3xgIE,1823
|
19
|
-
dbos/_docker_pg_helper.py,sha256=
|
19
|
+
dbos/_docker_pg_helper.py,sha256=tLJXWqZ4S-ExcaPnxg_i6cVxL6ZxrYlZjaGsklY-s2I,6115
|
20
20
|
dbos/_error.py,sha256=EN4eVBjMT3k7O7hfqJl6mIf4sxWPsiAOM086yhcGH_g,8012
|
21
21
|
dbos/_event_loop.py,sha256=NmaLbEQFfEK36S_0KhVD39YdYrGce3qSKCTJ-5RqKQ0,2136
|
22
22
|
dbos/_fastapi.py,sha256=m4SL3H9P-NBQ_ZrbFxAWMOqNyIi3HGEn2ODR7xAK038,3118
|
@@ -47,14 +47,14 @@ dbos/_schemas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
47
47
|
dbos/_schemas/application_database.py,sha256=SypAS9l9EsaBHFn9FR8jmnqt01M74d9AF1AMa4m2hhI,1040
|
48
48
|
dbos/_schemas/system_database.py,sha256=3Z0L72bOgHnusK1hBaETWU9RfiLBP0QnS-fdu41i0yY,5835
|
49
49
|
dbos/_serialization.py,sha256=bWuwhXSQcGmiazvhJHA5gwhrRWxtmFmcCFQSDJnqqkU,3666
|
50
|
-
dbos/_sys_db.py,sha256=
|
50
|
+
dbos/_sys_db.py,sha256=lceVny4RzQP7DeEJ8CpQ0crg8cJmuTznUsiGmv1oM-E,82486
|
51
51
|
dbos/_templates/dbos-db-starter/README.md,sha256=GhxhBj42wjTt1fWEtwNriHbJuKb66Vzu89G4pxNHw2g,930
|
52
52
|
dbos/_templates/dbos-db-starter/__package/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
53
|
-
dbos/_templates/dbos-db-starter/__package/main.py,sha256=
|
53
|
+
dbos/_templates/dbos-db-starter/__package/main.py.dbos,sha256=aQnBPSSQpkB8ERfhf7gB7P9tsU6OPKhZscfeh0yiaD8,2702
|
54
54
|
dbos/_templates/dbos-db-starter/__package/schema.py,sha256=7Z27JGC8yy7Z44cbVXIREYxtUhU4JVkLCp5Q7UahVQ0,260
|
55
55
|
dbos/_templates/dbos-db-starter/alembic.ini,sha256=VKBn4Gy8mMuCdY7Hip1jmo3wEUJ1VG1aW7EqY0_n-as,3695
|
56
56
|
dbos/_templates/dbos-db-starter/dbos-config.yaml.dbos,sha256=0wPktElM7kMB3OPHTXw4xBk9bgGKMqOHrrr7x_R23Z8,446
|
57
|
-
dbos/_templates/dbos-db-starter/migrations/env.py.dbos,sha256=
|
57
|
+
dbos/_templates/dbos-db-starter/migrations/env.py.dbos,sha256=IBB_gz9RjC20HPfOTGZzS6kTbv3jXhiOrnWpbJNk1Gk,2509
|
58
58
|
dbos/_templates/dbos-db-starter/migrations/script.py.mako,sha256=MEqL-2qATlST9TAOeYgscMn1uy6HUS9NFvDgl93dMj8,635
|
59
59
|
dbos/_templates/dbos-db-starter/migrations/versions/2024_07_31_180642_init.py,sha256=MpS7LGaJS0CpvsjhfDkp9EJqvMvVCjRPfUp4c0aE2ys,941
|
60
60
|
dbos/_templates/dbos-db-starter/start_postgres_docker.py,sha256=lQVLlYO5YkhGPEgPqwGc7Y8uDKse9HsWv5fynJEFJHM,1681
|
@@ -62,9 +62,9 @@ dbos/_tracer.py,sha256=yN6GRDKu_1p-EqtQLNarMocPfga2ZuqpzStzzSPYhzo,2732
|
|
62
62
|
dbos/_utils.py,sha256=UbpMYRBSyvJqdXeWAnfSw8xXM1R1mfnyl1oTunhEjJM,513
|
63
63
|
dbos/_workflow_commands.py,sha256=2E8FRUv_nLYkpBTwfhh_ELhySYpMrm8qGB9J44g6DSE,3872
|
64
64
|
dbos/cli/_github_init.py,sha256=Y_bDF9gfO2jB1id4FV5h1oIxEJRWyqVjhb7bNEa5nQ0,3224
|
65
|
-
dbos/cli/_template_init.py,sha256
|
66
|
-
dbos/cli/cli.py,sha256=
|
65
|
+
dbos/cli/_template_init.py,sha256=7JBcpMqP1r2mfCnvWatu33z8ctEGHJarlZYKgB83cXE,2972
|
66
|
+
dbos/cli/cli.py,sha256=SFmaHlCHtOojETd-P8BpbENQvwQoyq2l2yXZhSVo-50,18892
|
67
67
|
dbos/dbos-config.schema.json,sha256=8KcwJb_sQc4-6tQG2TLmjE_nratfrQa0qVLl9XPsvWE,6367
|
68
68
|
dbos/py.typed,sha256=QfzXT1Ktfk3Rj84akygc7_42z0lRpCq0Ilh8OXI6Zas,44
|
69
69
|
version/__init__.py,sha256=L4sNxecRuqdtSFdpUGX3TtBi9KL3k7YsZVIvv-fv9-A,1678
|
70
|
-
dbos-0.28.
|
70
|
+
dbos-0.28.0a12.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|