@@ -116,10 +116,10 @@ async def initialize(self, configuration: Configuration) -> None:
116116 async with engine .begin () as conn :
117117 self ._dialect_name = engine .dialect .name
118118
119- if self ._dialect_name not in ( 'sqlite' , 'postgresql' , 'mysql' ) :
119+ if self ._dialect_name not in { 'sqlite' , 'postgresql' , 'mysql' , 'mariadb' } :
120120 raise ValueError (
121- f'Unsupported database dialect: { self ._dialect_name } . Supported: sqlite, postgresql, mysql. '
122- 'Consider using a different database.' ,
121+ f'Unsupported database dialect: { self ._dialect_name } . Supported: sqlite, postgresql, mysql, '
122+ 'mariadb. Consider using a different database.' ,
123123 )
124124
125125 # Create tables if they don't exist.
@@ -260,14 +260,16 @@ def _get_or_create_engine(self, configuration: Configuration) -> AsyncEngine:
260260 ('sqlite' not in connection_string )
261261 and ('postgresql' not in connection_string )
262262 and ('mysql' not in connection_string )
263+ and ('mariadb' not in connection_string )
263264 ):
264265 raise ValueError (
265- 'Unsupported database. Supported: sqlite, postgresql, mysql. Consider using a different database.'
266+ 'Unsupported database. Supported: sqlite, postgresql, mysql, mariadb. Consider using a different '
267+ 'database.'
266268 )
267269
268270 connect_args : dict [str , Any ]
269271 kwargs : dict [str , Any ] = {}
270- if 'mysql' in connection_string :
272+ if 'mysql' in connection_string or 'mariadb' in connection_string :
271273 connect_args : dict [str , Any ] = {'connect_timeout' : 30 }
272274 kwargs ['isolation_level' ] = 'READ COMMITTED'
273275 else :
0 commit comments