def create_trigger(self, sql): """Create a trigger """ if self.verbose > 2: stm = dbcommands.mogrify(sql, database=self.database) sys.stdout.write(stm) res = dbcommands.execute_raw(sql, self.database) return res
def get_nb_tuples(self): """ Remplissage de la table technique avec les données existantes """ sql = self.backend.sql_nb_tuples() params = (self.table,) if self.verbose > 2: msg = "[SQL] %s\n" % (dbcommands.mogrify(sql, params=params, database=self.database)) sys.stdout.write(msg) res = dbcommands.lookup(sql, params=params, database=self.database) return res