Subversion Repositories SmartDukaan

Rev

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

Rev 1122 Rev 1249
Line 152... Line 152...
152
    id = Field(Integer, primary_key=True, autoincrement=True)
152
    id = Field(Integer, primary_key=True, autoincrement=True)
153
    object = Field(Binary)
153
    object = Field(Binary)
154
    using_options(shortnames=True)
154
    using_options(shortnames=True)
155
    using_table_options(mysql_engine="InnoDB")
155
    using_table_options(mysql_engine="InnoDB")
156
    
156
    
157
def initialize():
157
def initialize(dbname='catalog'):
158
    #metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
158
    #metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
159
    #metadata.bind = 'mysql://root:shop2020@localhost/catalog'
159
    #metadata.bind = 'mysql://root:shop2020@localhost/catalog'
160
    engine = create_engine('mysql://root:shop2020@localhost/catalog', pool_recycle=7200)
160
    engine = create_engine('mysql://root:shop2020@localhost/' + dbname, pool_recycle=7200)
161
    metadata.bind = engine
161
    metadata.bind = engine
162
    metadata.bind.echo = True
162
    metadata.bind.echo = True
163
    setup_all(True)
163
    setup_all(True)
164
 
164
 
165
if __name__=="__main__":
165
if __name__=="__main__":