예제 #1
0
 def _create_db(self):
     """
     private method to open a new DB
     and create the gemini schema.
     """
     # open up a new database
     if os.path.exists(self.args.db):
         os.remove(self.args.db)
     self.conn = sqlite3.connect(self.args.db)
     self.conn.isolation_level = None
     self.c = self.conn.cursor()
     self.c.execute('PRAGMA synchronous = OFF')
     self.c.execute('PRAGMA journal_mode=MEMORY')
     # create the gemini database tables for the new DB
     database.create_tables(self.c)
     database.create_sample_table(self.c, self.args)
예제 #2
0
 def _create_db(self):
     """
     private method to open a new DB
     and create the gemini schema.
     """
     # open up a new database
     if os.path.exists(self.args.db):
         os.remove(self.args.db)
     self.conn = sqlite3.connect(self.args.db)
     self.conn.isolation_level = None
     self.c = self.conn.cursor()
     self.c.execute('PRAGMA synchronous = OFF')
     self.c.execute('PRAGMA journal_mode=MEMORY')
     # create the gemini database tables for the new DB
     database.create_tables(self.c)
     database.create_sample_table(self.c, self.args)
예제 #3
0
 def _create_db(self, effect_fields=None):
     """
     private method to open a new DB
     and create the gemini schema.
     """
     # open up a new database
     db_path = self.args.db if not hasattr(self.args, 'tmp_db') else self.args.tmp_db
     if os.path.exists(db_path):
         os.remove(db_path)
     self.c, self.metadata = database.create_tables(db_path, effect_fields or [])
     session = self.c
     if session.bind.name == "sqlite":
         self.c.execute('PRAGMA synchronous=OFF')
         self.c.execute('PRAGMA journal_mode=MEMORY')
     # create the gemini database tables for the new DB
     database.create_sample_table(self.c, self.metadata, self.args)
예제 #4
0
 def _create_db(self, effect_fields=None):
     """
     private method to open a new DB
     and create the gemini schema.
     """
     # open up a new database
     db_path = self.args.db if not hasattr(self.args, 'tmp_db') else self.args.tmp_db
     if os.path.exists(db_path):
         os.remove(db_path)
     self.conn = sqlite3.connect(db_path)
     self.conn.isolation_level = None
     self.c = self.conn.cursor()
     self.c.execute('PRAGMA synchronous = OFF')
     self.c.execute('PRAGMA journal_mode=MEMORY')
     # create the gemini database tables for the new DB
     database.create_tables(self.c, effect_fields or [])
     database.create_sample_table(self.c, self.args)
예제 #5
0
 def _create_db(self, effect_fields=None):
     """
     private method to open a new DB
     and create the gemini schema.
     """
     # open up a new database
     db_path = self.args.db if not hasattr(self.args,
                                           'tmp_db') else self.args.tmp_db
     if os.path.exists(db_path):
         os.remove(db_path)
     self.conn = sqlite3.connect(db_path)
     self.conn.isolation_level = None
     self.c = self.conn.cursor()
     self.c.execute('PRAGMA synchronous = OFF')
     self.c.execute('PRAGMA journal_mode=MEMORY')
     # create the gemini database tables for the new DB
     database.create_tables(self.c, effect_fields or [])
     database.create_sample_table(self.c, self.args)