|
63 | 63 | - ``'db_user'`` -- if not set, ``postgres``;
|
64 | 64 | - ``'db_password'`` -- if not set, empty string;
|
65 | 65 | - ``'db_database'`` -- if not set, ``postgres``;
|
| 66 | +- ``'db_echo'`` -- whether to enable SQLAlchemy echo mode, defaults to False. |
66 | 67 | - ``dsn`` -- a SQLAlchemy database URL to create the engine, its existence
|
67 | 68 | will replace all previous connect arguments.
|
68 | 69 | - ``'db_pool_min_size'`` -- number of connection the pool will be initialized
|
@@ -187,6 +188,7 @@ def inner(value):
|
187 | 188 | _define('db_user', 'postgres', str, group='database')
|
188 | 189 | _define('db_password', 'password', str, group='database')
|
189 | 190 | _define('db_database', 'postgres', str, group='database')
|
| 191 | +_define('db_echo', False, bool, group='database') |
190 | 192 | _define('db_pool_min_size', 5, int, group='database',
|
191 | 193 | callback=_assert_not_negative('db_pool_min_size'))
|
192 | 194 | _define('db_pool_max_size', 10, int, group='database',
|
@@ -341,6 +343,7 @@ async def late_init(self, db: Gino, *, loop=None, options=_options):
|
341 | 343 |
|
342 | 344 | await db.set_bind(
|
343 | 345 | dsn,
|
| 346 | + echo=options['db_echo'], |
344 | 347 | min_size=options['db_pool_min_size'],
|
345 | 348 | max_size=options['db_pool_max_size'],
|
346 | 349 | max_inactive_connection_lifetime=(
|
|
0 commit comments