dbos 0.11.0a1__py3-none-any.whl → 0.11.0a2__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.
dbos/system_database.py CHANGED
@@ -1,5 +1,6 @@
1
1
  import datetime
2
2
  import os
3
+ import re
3
4
  import threading
4
5
  import time
5
6
  from enum import Enum
@@ -203,9 +204,13 @@ class SystemDatabase:
203
204
  )
204
205
  alembic_cfg = Config()
205
206
  alembic_cfg.set_main_option("script_location", migration_dir)
206
- alembic_cfg.set_main_option(
207
- "sqlalchemy.url", self.engine.url.render_as_string(hide_password=False)
207
+ # Alembic requires the % in URL-escaped parameters to itself be escaped to %%.
208
+ escaped_conn_string = re.sub(
209
+ r"%(?=[0-9A-Fa-f]{2})",
210
+ "%%",
211
+ self.engine.url.render_as_string(hide_password=False),
208
212
  )
213
+ alembic_cfg.set_main_option("sqlalchemy.url", escaped_conn_string)
209
214
  command.upgrade(alembic_cfg, "head")
210
215
 
211
216
  self.notification_conn: Optional[psycopg.connection.Connection] = None
@@ -1,3 +1,4 @@
1
+ import re
1
2
  from logging.config import fileConfig
2
3
 
3
4
  from alembic import context
@@ -15,7 +16,13 @@ if config.config_file_name is not None:
15
16
  fileConfig(config.config_file_name)
16
17
 
17
18
  # programmatically set the sqlalchemy.url field from DBOS Config
18
- config.set_main_option("sqlalchemy.url", get_dbos_database_url())
19
+ # Alembic requires the % in URL-escaped parameters to itself be escaped to %%.
20
+ escaped_conn_string = re.sub(
21
+ r"%(?=[0-9A-Fa-f]{2})",
22
+ "%%",
23
+ get_dbos_database_url(),
24
+ )
25
+ config.set_main_option("sqlalchemy.url", escaped_conn_string)
19
26
 
20
27
  # add your model's MetaData object here
21
28
  # for 'autogenerate' support
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dbos
3
- Version: 0.11.0a1
3
+ Version: 0.11.0a2
4
4
  Summary: Ultra-lightweight durable execution in Python
5
5
  Author-Email: "DBOS, Inc." <contact@dbos.dev>
6
6
  License: MIT
@@ -1,7 +1,7 @@
1
- dbos-0.11.0a1.dist-info/METADATA,sha256=l3ysaT_HPIKcrPB4TActrP8piiKcaMDY0yVklVaGLOo,5009
2
- dbos-0.11.0a1.dist-info/WHEEL,sha256=pM0IBB6ZwH3nkEPhtcp50KvKNX-07jYtnb1g1m6Z4Co,90
3
- dbos-0.11.0a1.dist-info/entry_points.txt,sha256=z6GcVANQV7Uw_82H9Ob2axJX6V3imftyZsljdh-M1HU,54
4
- dbos-0.11.0a1.dist-info/licenses/LICENSE,sha256=VGZit_a5-kdw9WT6fY5jxAWVwGQzgLFyPWrcVVUhVNU,1067
1
+ dbos-0.11.0a2.dist-info/METADATA,sha256=5r46w44-OAT2RsQKsvcGxjMMAFtjG0r2zvDMbieRyiU,5009
2
+ dbos-0.11.0a2.dist-info/WHEEL,sha256=pM0IBB6ZwH3nkEPhtcp50KvKNX-07jYtnb1g1m6Z4Co,90
3
+ dbos-0.11.0a2.dist-info/entry_points.txt,sha256=z6GcVANQV7Uw_82H9Ob2axJX6V3imftyZsljdh-M1HU,54
4
+ dbos-0.11.0a2.dist-info/licenses/LICENSE,sha256=VGZit_a5-kdw9WT6fY5jxAWVwGQzgLFyPWrcVVUhVNU,1067
5
5
  dbos/__init__.py,sha256=-h1QgWNL11CiLlHEKa2ycAJVJw5SXYZ4BGNNWBAiE9k,726
6
6
  dbos/admin_sever.py,sha256=Qg5T3YRrbPW05PR_99yAaxgo1ugQrAp_uTeTqSfjm_k,3397
7
7
  dbos/application_database.py,sha256=knFK8We8y6WrIpnFCKvFq5hvSuFQqUuJqOqDpSVMCPI,5521
@@ -37,18 +37,18 @@ dbos/scheduler/scheduler.py,sha256=KpcBid6qIbqLqLdrQQqEQnRBTvo_XwtVuvUba3Ed5Go,1
37
37
  dbos/schemas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
38
  dbos/schemas/application_database.py,sha256=KeyoPrF7hy_ODXV7QNike_VFSD74QBRfQ76D7QyE9HI,966
39
39
  dbos/schemas/system_database.py,sha256=7iw7eHJzEvkatHMOaHORoSvtfisF73wW5j8hRt_Ph14,5126
40
- dbos/system_database.py,sha256=qYffHBwF_5pKzLp1R3-dn-VxqCGB_c4oXnUns9Sqfu8,48057
40
+ dbos/system_database.py,sha256=DIYy4Tawwvu4XnN2IxhBMmZXwUX2Em80guKhlUXYICA,48267
41
41
  dbos/templates/hello/README.md,sha256=GhxhBj42wjTt1fWEtwNriHbJuKb66Vzu89G4pxNHw2g,930
42
42
  dbos/templates/hello/__package/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
43
43
  dbos/templates/hello/__package/main.py,sha256=eI0SS9Nwj-fldtiuSzIlIG6dC91GXXwdRsoHxv6S_WI,2719
44
44
  dbos/templates/hello/__package/schema.py,sha256=7Z27JGC8yy7Z44cbVXIREYxtUhU4JVkLCp5Q7UahVQ0,260
45
45
  dbos/templates/hello/alembic.ini,sha256=VKBn4Gy8mMuCdY7Hip1jmo3wEUJ1VG1aW7EqY0_n-as,3695
46
46
  dbos/templates/hello/dbos-config.yaml.dbos,sha256=X-Ocywo8_QUr2-Xj2AiiBYL0tcd0E3Yl7FuP6fy3gRM,603
47
- dbos/templates/hello/migrations/env.py.dbos,sha256=CsiFOea3ZIsahqkfYtioha0ewmlGR78Ng0wOB2t5LQg,2208
47
+ dbos/templates/hello/migrations/env.py.dbos,sha256=GUV6sjkDzf9Vl6wkGEd0RSkK-ftRfV6EUwSQdd0qFXg,2392
48
48
  dbos/templates/hello/migrations/script.py.mako,sha256=MEqL-2qATlST9TAOeYgscMn1uy6HUS9NFvDgl93dMj8,635
49
49
  dbos/templates/hello/migrations/versions/2024_07_31_180642_init.py,sha256=U5thFWGqNN4QLrNXT7wUUqftIFDNE5eSdqD8JNW1mec,942
50
50
  dbos/templates/hello/start_postgres_docker.py,sha256=lQVLlYO5YkhGPEgPqwGc7Y8uDKse9HsWv5fynJEFJHM,1681
51
51
  dbos/tracer.py,sha256=GaXDhdKKF_IQp5SAMipGXiDVwteRKjNbrXyYCH1mor0,2520
52
52
  dbos/utils.py,sha256=lwRymY-y7GprAS8pKmbICQvOJd5eGxKGTxCMFn0OwaQ,1739
53
53
  version/__init__.py,sha256=L4sNxecRuqdtSFdpUGX3TtBi9KL3k7YsZVIvv-fv9-A,1678
54
- dbos-0.11.0a1.dist-info/RECORD,,
54
+ dbos-0.11.0a2.dist-info/RECORD,,