Esempio n. 1
0
    def action(self):
        db = dbstore.connect(self.cfg.dbPath, self.cfg.dbDriver)
        if self.options.create:
            print >> sys.stderr, "Force-creating database schema ..."
            db.loadSchema()
            schema.createSchema(db, cfg=self.cfg)
        else:
            schema.loadSchema(db, self.cfg, self.options.should_migrate)

        return 0
Esempio n. 2
0
def getIndexes(driver="sqlite"):
    printer = PrintDatabase(False, driver)
    schema.createSchema(printer)
    return printer.statements
Esempio n. 3
0
def getTables(driver="sqlite"):
    printer = PrintDatabase(True, driver)
    schema.createSchema(printer)
    return printer.statements