@@ -69,7 +69,7 @@ def create_engine(clazz, url):
6969 Engines are memoized by url
7070 '''
7171 if url not in clazz ._engines :
72- LOGGER .info ('creating new engine: %s' , url )
72+ LOGGER .info ('creating new engine: %s' , util . sanitize_db_connect ( url ) )
7373 engine = create_engine ('%s' % url , echo = False , pool_pre_ping = True )
7474
7575 # load SQLite query bindings
@@ -238,7 +238,7 @@ def __init__(self, database, context, app_root=None, table='records', repo_filte
238238 self .queryables ['_all' ].update (self .context .md_core_model ['mappings' ])
239239
240240 def ping (self , max_tries = 10 , wait_seconds = 10 ):
241- LOGGER .debug (f"Waiting for { self .database } ..." )
241+ LOGGER .debug (f"Waiting for { util . sanitize_db_connect ( self .database ) } ..." )
242242
243243 if self .database .startswith ('sqlite' ):
244244 sql = 'SELECT sqlite_version();'
@@ -258,12 +258,12 @@ def ping(self, max_tries=10, wait_seconds=10):
258258 sleep (wait_seconds )
259259 else :
260260 raise RuntimeError (
261- f"Database not responding at { self .database } after { max_tries } tries. " )
261+ f"Database not responding at { util . sanitize_db_connect ( self .database ) } after { max_tries } tries. " )
262262
263263 def rebuild_db_indexes (self ):
264264 """Rebuild database indexes"""
265265
266- LOGGER .info ('Rebuilding database %s, table %s' , self .database , self .table )
266+ LOGGER .info ('Rebuilding database %s, table %s' , util . sanitize_db_connect ( self .database ) , self .table )
267267 connection = self .engine .connect ()
268268 connection .autocommit = True
269269 connection .execute ('REINDEX %s' % self .table )
@@ -274,7 +274,7 @@ def optimize_db(self):
274274 """Optimize database"""
275275 from sqlalchemy .exc import ArgumentError , OperationalError
276276
277- LOGGER .info ('Optimizing database %s' , self .database )
277+ LOGGER .info ('Optimizing database %s' , util . sanitize_db_connect ( self .database ) )
278278 connection = self .engine .connect ()
279279 try :
280280 # PostgreSQL
@@ -720,7 +720,7 @@ def setup(database, table, create_sfsql_tables=True, postgis_geometry_column='wk
720720 from sqlalchemy .types import Float
721721 from sqlalchemy .orm import create_session
722722
723- LOGGER .info ('Creating database %s' , database )
723+ LOGGER .info ('Creating database %s' , util . sanitize_db_connect ( database ) )
724724 if database .startswith ('sqlite:///' ):
725725 _ , filepath = database .split ('sqlite:///' )
726726 dirname = os .path .dirname (filepath )
0 commit comments