Exemplo n.º 1
0
 def create_database(self, SQLFile):
     '''Create a new database using deploy SQLFile'''
     if not toolkit_file.check_file_exists(self.DB_FILE):
         print('Deploy {} to {}'.format(SQLFile, self.DB_FILE))
         self.conn = sqlite3.connect(self.DB_FILE)
         self.cursor = self.conn.cursor()
         with open(SQLFile) as f:
             self.cursor.executescript(f.read())
     else:
         print('{} exists'.format(self.DB_FILE))
Exemplo n.º 2
0
 def __init__(self, DB_FILE):
     self.DB_FILE = DB_FILE
     if toolkit_file.check_file_exists(self.DB_FILE):
         self.conn = sqlite3.connect(self.DB_FILE)