예제 #1
0
 def cmd_install(self, params):
     pgq_objs = [
         skytools.DBLanguage("plpgsql"),
         skytools.DBFunction("txid_current_snapshot",
                             0,
                             sql_file="txid.sql"),
         skytools.DBSchema("pgq", sql_file="pgq.sql"),
         skytools.DBSchema("pgq_ext", sql_file="pgq_ext.sql"),
         skytools.DBSchema("pgq_node", sql_file="pgq_node.sql"),
     ]
     londiste_objs = pgq_objs + [
         skytools.DBSchema("londiste", sql_file="londiste.sql"),
     ]
     mod_map = {
         'londiste': londiste_objs,
         'pgq': pgq_objs,
     }
     mod_name = params['module']
     objs = mod_map[mod_name]
     if not self.db:
         print "no db?"
         return
     curs = self.db.cursor()
     skytools.db_install(curs, objs, None)
     print "INSTALL"
예제 #2
0
 def check_code(self, db):
     objs = [
         skytools.DBFunction("pgq.maint_operations", 0,
             sql_file = "londiste.maint-upgrade.sql"),
     ]
     skytools.db_install(db.cursor(), objs, self.log)
     db.commit()
예제 #3
0
    def installer(self):
        objs = [
            skytools.DBLanguage("plpgsql"),
            #skytools.DBFunction("txid_current_snapshot", 0, sql_file="txid.sql"),
            skytools.DBSchema("pgq", sql_file="pgq.sql"),
        ]

        db = self.get_database('db')
        curs = db.cursor()
        skytools.db_install(curs, objs, self.log)
        db.commit()
예제 #4
0
    def installer(self):
        objs = [
            skytools.DBLanguage("plpgsql"),
            skytools.DBFunction("txid_current_snapshot", 0, sql_file="txid.sql"),
            skytools.DBSchema("pgq", sql_file="pgq.sql"),
        ]

        db = self.get_database('db')
        curs = db.cursor()
        skytools.db_install(curs, objs, self.log)
        db.commit()
예제 #5
0
 def install_code(self, db):
     objs = [
         skytools.DBLanguage("plpgsql"),
         skytools.DBFunction("txid_current_snapshot", 0, sql_file="txid.sql"),
         skytools.DBSchema("pgq", sql_file="pgq.sql"),
         skytools.DBSchema("pgq_ext", sql_file="pgq_ext.sql"),
         skytools.DBSchema("pgq_set", sql_file="pgq_set.sql"),
     ]
     objs += self.extra_objs
     skytools.db_install(db.cursor(), objs, self.log)
     db.commit()
예제 #6
0
 def install_code(self, db):
     """Install cascading code to db."""
     objs = [
         skytools.DBLanguage("plpgsql"),
         skytools.DBFunction("txid_current_snapshot", 0, sql_file="txid.sql"),
         skytools.DBSchema("pgq", sql_file="pgq.sql"),
         skytools.DBSchema("pgq_ext", sql_file="pgq_ext.sql"), # not needed actually
         skytools.DBSchema("pgq_node", sql_file="pgq_node.sql"),
     ]
     objs += self.extra_objs
     skytools.db_install(db.cursor(), objs, self.log)
     db.commit()
예제 #7
0
 def install_code(self, db):
     """Install cascading code to db."""
     objs = [
         skytools.DBLanguage("plpgsql"),
         skytools.DBFunction("txid_current_snapshot", 0, sql_file="txid.sql"),
         skytools.DBSchema("pgq", sql_file="pgq.sql"),
         skytools.DBFunction("pgq.get_batch_cursor", 3, sql_file = "pgq.upgrade.2to3.sql"),
         skytools.DBSchema("pgq_ext", sql_file="pgq_ext.sql"), # not needed actually
         skytools.DBSchema("pgq_node", sql_file="pgq_node.sql"),
     ]
     objs += self.extra_objs
     skytools.db_install(db.cursor(), objs, self.log)
     db.commit()
예제 #8
0
 def cmd_install(self, params):
     pgq_objs = [
         skytools.DBLanguage("plpgsql"),
         # skytools.DBFunction("txid_current_snapshot", 0, sql_file="txid.sql"),
         skytools.DBSchema("pgq", sql_file="pgq.sql"),
         skytools.DBSchema("pgq_ext", sql_file="pgq_ext.sql"),
         skytools.DBSchema("pgq_node", sql_file="pgq_node.sql"),
     ]
     londiste_objs = pgq_objs + [skytools.DBSchema("londiste", sql_file="londiste.sql")]
     mod_map = {"londiste": londiste_objs, "pgq": pgq_objs}
     mod_name = params["module"]
     objs = mod_map[mod_name]
     if not self.db:
         print "no db?"
         return
     curs = self.db.cursor()
     skytools.db_install(curs, objs, None)
     print "INSTALL"
예제 #9
0
def install_subscriber(curs, log):
    """Installs needed code into subscriber db."""
    skytools.db_install(curs, subscriber_object_list, log)
예제 #10
0
def install_provider(curs, log):
    """Installs needed code into provider db."""
    skytools.db_install(curs, provider_object_list, log)