Subversion Repositories SmartDukaan

Rev

Rev 21844 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 21844 Rev 35608
Line 253... Line 253...
253
    using_options(shortnames=True)
253
    using_options(shortnames=True)
254
    using_table_options(mysql_engine="InnoDB")    
254
    using_table_options(mysql_engine="InnoDB")    
255
def initialize(dbname='inventory', db_hostname="localhost", setup=True):
255
def initialize(dbname='inventory', db_hostname="localhost", setup=True):
256
    #metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
256
    #metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
257
    #metadata.bind = 'mysql://root:shop2020@localhost/inventory'
257
    #metadata.bind = 'mysql://root:shop2020@localhost/inventory'
258
    iengine = create_engine('mysql://root:shop2020@' + db_hostname + '/' + dbname, pool_recycle=7200)
258
    iengine = create_engine('mysql://root:shop2020@' + db_hostname + '/' + dbname,
-
 
259
                            pool_recycle=3600, pool_timeout=30, pool_pre_ping=True)
259
    metadata.bind = iengine
260
    metadata.bind = iengine
260
    metadata.bind.echo = True
261
    metadata.bind.echo = False
261
    setup_all(setup)
262
    setup_all(setup)
262
 
263
 
263
if __name__=="__main__":
264
if __name__=="__main__":
264
    initialize()
265
    initialize()
265
266