python-glowplug 0.3.3__py3-none-any.whl → 0.3.5__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.
glowplug/driver/base.py CHANGED
@@ -99,14 +99,16 @@ class DbDriver(ABC):
99
99
  return create_engine(self.sync_uri, echo=self.debug)
100
100
 
101
101
  @cached_property
102
- def async_session(self) -> AsyncSession:
102
+ def async_session(self, **kwargs) -> AsyncSession:
103
103
  """Get an async session."""
104
- return async_sessionmaker(self.get_async_engine(), expire_on_commit=False)
104
+ return async_sessionmaker(
105
+ self.get_async_engine(**kwargs), expire_on_commit=False
106
+ )
105
107
 
106
108
  @cached_property
107
- def sync_session(self) -> Session:
109
+ def sync_session(self, **kwargs) -> Session:
108
110
  """Get a sync session."""
109
- return sessionmaker(self.get_sync_engine(), expire_on_commit=False)
111
+ return sessionmaker(self.get_sync_engine(**kwargs), expire_on_commit=False)
110
112
 
111
113
  @cached_property
112
114
  def alembic(self) -> AlembicCommandProxy:
glowplug/driver/sqlite.py CHANGED
@@ -26,7 +26,9 @@ class SqliteDriver(DbDriver):
26
26
  return
27
27
  # Make sure directories exist. The file itself will be created
28
28
  # when the first connection is made.
29
- os.makedirs(os.path.dirname(self.path), exist_ok=True)
29
+ dirname = os.path.dirname(self.path)
30
+ if dirname:
31
+ os.makedirs(dirname, exist_ok=True)
30
32
 
31
33
  @property
32
34
  def async_uri(self) -> str:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-glowplug
3
- Version: 0.3.3
3
+ Version: 0.3.5
4
4
  Summary: A collection of utilities for common DB maintenance operations in SQLAlchemy
5
5
  Home-page: https://github.com/jnu/python-glowplug
6
6
  License: MIT
@@ -1,11 +1,11 @@
1
1
  glowplug/__init__.py,sha256=VKKI-9C6KSlXwvisxTQFhVUUtQdwiNeV_g8wB5TVjM4,378
2
2
  glowplug/config/__init__.py,sha256=0v2Tqk8mJ3v_wRuifXP1-V4x7--xupBxxtrSt2CFqXs,1628
3
3
  glowplug/driver/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- glowplug/driver/base.py,sha256=hMC8HKEY97O-_6VxCfBwdilPRQ3goDt8vaNcDl9KhkY,3673
4
+ glowplug/driver/base.py,sha256=QcTKToKKnzymVQk0Sm2s1L15qrLP6BXjnbOaUlproC4,3731
5
5
  glowplug/driver/mssql.py,sha256=gbrlh2O-LViDwNmwwpme0sNzu2EbgJtQKbp4o_mNrvs,2635
6
6
  glowplug/driver/pg.py,sha256=4Hw2WG33UzgYyJtWLv8QWZzHhzzsM34TyDuObtxvNmI,2600
7
- glowplug/driver/sqlite.py,sha256=DEJ8lYP8ZPemeGezTovs8WISGaVyUfwTIqiwMz3FPdU,1020
8
- python_glowplug-0.3.3.dist-info/LICENSE,sha256=HvAzro26TfbigQ3ppmyagEGHIr_UtyQDfU8muTAqWFU,1060
9
- python_glowplug-0.3.3.dist-info/METADATA,sha256=acjy0WeTq0-Ou_62GIxF00qwBAdl_9XYD32eJRpXIuM,1494
10
- python_glowplug-0.3.3.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
11
- python_glowplug-0.3.3.dist-info/RECORD,,
7
+ glowplug/driver/sqlite.py,sha256=SPhZXYMu_OcdN2r7dr5YJA-3Jsd-deH7peMWYEzX_sE,1070
8
+ python_glowplug-0.3.5.dist-info/LICENSE,sha256=HvAzro26TfbigQ3ppmyagEGHIr_UtyQDfU8muTAqWFU,1060
9
+ python_glowplug-0.3.5.dist-info/METADATA,sha256=uPMxUhvsSK7WSh94hvQvViKhuX74Tu0aCzNJyQ-dk1g,1494
10
+ python_glowplug-0.3.5.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
11
+ python_glowplug-0.3.5.dist-info/RECORD,,