It is a nice and compact code, but looks very inefficient to me. It transfers all database names to client first, right? I tried my version and sqlalchemy.inspect, I called it 20 times, the timing was 0.014 (mine) vs 0.766 (inspect) - 54x difference Jacek On 09/09/2015 01:12 PM, Van Klaveren, Brian N. wrote: > dbExists is probably best implemented this way: > > from sqlalchemy.inspection import inspect > > def dbExists(self, dbName): > return dbName in inspect(self.engine).get_schema_names() > > Brian > > >> On Sep 9, 2015, at 12:17 PM, Becla, Jacek <[log in to unmask] >> <mailto:[log in to unmask]>> wrote: >> >> >> >>> Begin forwarded message: >>> >>> *From: *Jacek Becla <[log in to unmask] >>> <mailto:[log in to unmask]>> >>> *Subject: **dynamic selection of utils* >>> *Date: *September 9, 2015 at 11:27:46 AM PDT >>> *To: *Andy Salnikov <[log in to unmask] >>> <mailto:[log in to unmask]>> >>> >>> Andy >>> >>> See attached, what do you think? >>> >>> Jacek >> >> ------------------------------------------------------------------------ >> >> Use REPLY-ALL to reply to list >> >> To unsubscribe from the QSERV-L list, click the following link: >> https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=QSERV-L&A=1 >> >> <utils.py> >> >> >> ------------------------------------------------------------------------ >> >> Use REPLY-ALL to reply to list >> >> To unsubscribe from the QSERV-L list, click the following link: >> https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=QSERV-L&A=1 >> > ######################################################################## Use REPLY-ALL to reply to list To unsubscribe from the QSERV-L list, click the following link: https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=QSERV-L&A=1