diff --git a/dev/404.html b/dev/404.html index b9abe13..8222ebc 100644 --- a/dev/404.html +++ b/dev/404.html @@ -16,7 +16,7 @@ - + @@ -24,7 +24,7 @@ - + diff --git a/dev/api_reference/bind_manager/index.html b/dev/api_reference/bind_manager/index.html index 5ec36aa..ee524d7 100644 --- a/dev/api_reference/bind_manager/index.html +++ b/dev/api_reference/bind_manager/index.html @@ -20,7 +20,7 @@ - + @@ -28,7 +28,7 @@ - + @@ -692,15 +692,6 @@ - - -
  • - - - SQLAlchemyAsyncConfig - - -
  • @@ -867,15 +858,6 @@ - - -
  • - - - SQLAlchemyAsyncConfig - - -
  • @@ -942,7 +924,16 @@

    Source code in sqlalchemy_bind_manager/_bind_manager.py -
     82
    +              
     73
    + 74
    + 75
    + 76
    + 77
    + 78
    + 79
    + 80
    + 81
    + 82
      83
      84
      85
    @@ -1064,33 +1055,14 @@ 

    201 202 203 -204 -205 -206 -207 -208 -209 -210 -211 -212 -213 -214 -215 -216 -217 -218 -219 -220 -221 -222

    class SQLAlchemyBindManager:
    +204
    class SQLAlchemyBindManager:
         __binds: MutableMapping[str, Union[SQLAlchemyBind, SQLAlchemyAsyncBind]]
     
         def __init__(
             self,
             config: Union[
    -            Mapping[str, Union[SQLAlchemyConfig, SQLAlchemyAsyncConfig]],
    +            Mapping[str, SQLAlchemyConfig],
                 SQLAlchemyConfig,
    -            SQLAlchemyAsyncConfig,
             ],
         ) -> None:
             self.__binds = {}
    @@ -1100,18 +1072,10 @@ 

    else: self.__init_bind(DEFAULT_BIND_NAME, config) - def __init_bind( - self, name: str, config: Union[SQLAlchemyConfig, SQLAlchemyAsyncConfig] - ): - if not any( - [ - isinstance(config, SQLAlchemyConfig), - isinstance(config, SQLAlchemyAsyncConfig), - ] - ): + def __init_bind(self, name: str, config: SQLAlchemyConfig): + if not isinstance(config, SQLAlchemyConfig): raise InvalidConfigError( - f"Config for bind `{name}` is not a SQLAlchemyConfig" - f" or SQLAlchemyAsyncConfig object" + f"Config for bind `{name}` is not a SQLAlchemyConfig" f"object" ) engine_options: dict = config.engine_options or {} @@ -1122,7 +1086,7 @@

    session_options.setdefault("expire_on_commit", False) session_options.setdefault("autobegin", False) - if isinstance(config, SQLAlchemyAsyncConfig): + if config.async_engine: self.__binds[name] = self.__build_async_bind( engine_url=config.engine_url, engine_options=engine_options, @@ -1282,14 +1246,14 @@

    Source code in sqlalchemy_bind_manager/_bind_manager.py -
    172
    -173
    -174
    -175
    -176
    -177
    -178
    -179
    def get_bind_mappers_metadata(self) -> Mapping[str, MetaData]:
    +            
    154
    +155
    +156
    +157
    +158
    +159
    +160
    +161
    def get_bind_mappers_metadata(self) -> Mapping[str, MetaData]:
         """
         Returns the registered mappers metadata in a format
         that can be used in Alembic configuration
    @@ -1376,19 +1340,19 @@ 

    Source code in sqlalchemy_bind_manager/_bind_manager.py -
    181
    -182
    -183
    -184
    -185
    -186
    -187
    -188
    -189
    -190
    -191
    -192
    -193
    def get_bind(
    +            
    163
    +164
    +165
    +166
    +167
    +168
    +169
    +170
    +171
    +172
    +173
    +174
    +175
    def get_bind(
         self, bind_name: str = DEFAULT_BIND_NAME
     ) -> Union[SQLAlchemyBind, SQLAlchemyAsyncBind]:
         """
    @@ -1450,13 +1414,13 @@ 

    Source code in sqlalchemy_bind_manager/_bind_manager.py -
    195
    -196
    -197
    -198
    -199
    -200
    -201
    def get_binds(self) -> Mapping[str, Union[SQLAlchemyBind, SQLAlchemyAsyncBind]]:
    +            
    177
    +178
    +179
    +180
    +181
    +182
    +183
    def get_binds(self) -> Mapping[str, Union[SQLAlchemyBind, SQLAlchemyAsyncBind]]:
         """
         Returns all the registered bind objects.
     
    @@ -1542,14 +1506,14 @@ 

    Source code in sqlalchemy_bind_manager/_bind_manager.py -
    203
    -204
    -205
    -206
    -207
    -208
    -209
    -210
    def get_mapper(self, bind_name: str = DEFAULT_BIND_NAME) -> registry:
    +            
    185
    +186
    +187
    +188
    +189
    +190
    +191
    +192
    def get_mapper(self, bind_name: str = DEFAULT_BIND_NAME) -> registry:
         """
         Returns the registered SQLAlchemy registry_mapper for the given bind name
     
    @@ -1637,17 +1601,17 @@ 

    Source code in sqlalchemy_bind_manager/_bind_manager.py -
    212
    -213
    -214
    -215
    -216
    -217
    -218
    -219
    -220
    -221
    -222
    def get_session(
    +            
    194
    +195
    +196
    +197
    +198
    +199
    +200
    +201
    +202
    +203
    +204
    def get_session(
         self, bind_name: str = DEFAULT_BIND_NAME
     ) -> Union[Session, AsyncSession]:
         """
    @@ -1687,7 +1651,7 @@ 

    -

    Configuration for synchronous engines

    +

    Configuration for engines

    Source code in sqlalchemy_bind_manager/_bind_manager.py @@ -1698,71 +1662,16 @@

    45 46 47 -48

    class SQLAlchemyConfig(BaseModel):
    -    """
    -    Configuration for synchronous engines
    -    """
    -
    -    engine_url: str
    -    engine_options: Union[dict, None] = None
    -    session_options: Union[dict, None] = None
    -
    - - - - -
    - - - - - - - - - - - -
    - -
    - - - - -
    - - - -

    - sqlalchemy_bind_manager.SQLAlchemyAsyncConfig - - -

    - - -
    - - -

    Configuration for asynchronous engines

    - -
    - Source code in sqlalchemy_bind_manager/_bind_manager.py -
    51
    -52
    -53
    -54
    -55
    -56
    -57
    -58
    class SQLAlchemyAsyncConfig(BaseModel):
    +48
    +49
    class SQLAlchemyConfig(BaseModel):
         """
    -    Configuration for asynchronous engines
    +    Configuration for engines
         """
     
         engine_url: str
         engine_options: Union[dict, None] = None
         session_options: Union[dict, None] = None
    +    async_engine: StrictBool = False
     
    diff --git a/dev/api_reference/exceptions/index.html b/dev/api_reference/exceptions/index.html index 8367d93..cf686fe 100644 --- a/dev/api_reference/exceptions/index.html +++ b/dev/api_reference/exceptions/index.html @@ -18,7 +18,7 @@ - + @@ -26,7 +26,7 @@ - + diff --git a/dev/api_reference/repository/index.html b/dev/api_reference/repository/index.html index 87e5997..6a52fc2 100644 --- a/dev/api_reference/repository/index.html +++ b/dev/api_reference/repository/index.html @@ -20,7 +20,7 @@ - + @@ -28,7 +28,7 @@ - + @@ -78,7 +78,7 @@
    - + Skip to content @@ -637,27 +637,27 @@
    • - + - protocols + repository -