]> git.etc.gen.nz Git - whoisi.git/commitdiff
Switch from MySQL to PostgreSQL. Rah!
authorAndrew Ruthven <andrew@etc.gen.nz>
Thu, 18 Jun 2009 20:54:06 +0000 (06:54 +1000)
committerAndrew Ruthven <andrew@etc.gen.nz>
Mon, 22 Jun 2009 09:33:53 +0000 (21:33 +1200)
controller-service
services/master/database.py

index a383824e048987ea4ffbe41666c82c2cca412aa4..899053a51d019ca058a62a1eec1558e6568204e7 100755 (executable)
@@ -37,14 +37,13 @@ import services.config as config
 
 class Controller(pb.Root):
     def service_setup(self):
-        self.connection_type = "MySQLdb"
+        self.connection_type = "pyPgSQL.PgSQL"
         self.connection_dict = dict(cp_reconnect=True,
                                     host=config.get("db", "host"),
                                     user=config.get("db", "user"),
-                                    passwd=config.get("db", "passwd"),
-                                    db=config.get("db", "db"),
-                                    port=config.getint("db", "port"),
-                                    charset="utf8")
+                                    password=config.get("db", "passwd"),
+                                    database=config.get("db", "db"),
+                                    port=config.getint("db", "port"))
 
         self.sm = ServiceManager()
         self.dcm = DatabaseCommandManager()
index 83f4260612b4773637056de140fad4bdde179196..ab7c7eb6ed63690eaf7c6bf52ceb030d60eae5f8 100644 (file)
@@ -55,11 +55,11 @@ class DatabaseManager:
         Start up the connection to the database.
         """
         if self.db is None:
-            self.db = adbapi.ConnectionPool("MySQLdb", cp_reconnect=True,
+            self.db = adbapi.ConnectionPool("pyPgSQL.PgSQL", cp_reconnect=True,
                                             host=config.get("db", "host"),
                                             user=config.get("db", "user"),
-                                            passwd=config.get("db", "passwd"),
-                                            db=config.get("db", "db"),
+                                            password=config.get("db", "passwd"),
+                                            database=config.get("db", "db"),
                                             port=config.getint("db", "port"))
 
     def stop(self):