21
21
import warnings
22
22
import logging
23
23
24
+ from playhouse .db_url import register_database
25
+
24
26
logger = logging .getLogger ('peewee.async' )
25
27
logger .addHandler (logging .NullHandler ())
26
28
@@ -1172,6 +1174,9 @@ def use_speedups(self, value):
1172
1174
pass
1173
1175
1174
1176
1177
+ register_database (PostgresqlDatabase , 'postgres+async' , 'postgresql+async' )
1178
+
1179
+
1175
1180
class PooledPostgresqlDatabase (AsyncPostgresqlMixin , peewee .PostgresqlDatabase ):
1176
1181
"""PosgreSQL database driver providing **single drop-in sync**
1177
1182
connection and **async connections pool** interface.
@@ -1200,6 +1205,9 @@ def use_speedups(self, value):
1200
1205
pass
1201
1206
1202
1207
1208
+ register_database (PooledPostgresqlDatabase , 'postgres+pool+async' , 'postgresql+pool+async' )
1209
+
1210
+
1203
1211
#########
1204
1212
# MySQL #
1205
1213
#########
@@ -1318,6 +1326,9 @@ def use_speedups(self, value):
1318
1326
pass
1319
1327
1320
1328
1329
+ register_database (MySQLDatabase , 'mysql+async' )
1330
+
1331
+
1321
1332
class PooledMySQLDatabase (MySQLDatabase ):
1322
1333
"""MySQL database driver providing **single drop-in sync**
1323
1334
connection and **async connections pool** interface.
@@ -1339,6 +1350,9 @@ def init(self, database, **kwargs):
1339
1350
self .max_connections = max_connections
1340
1351
1341
1352
1353
+ register_database (PooledMySQLDatabase , 'mysql+pool+async' )
1354
+
1355
+
1342
1356
##############
1343
1357
# Sync utils #
1344
1358
##############
0 commit comments