Browse Source

#118 compojure jdbc updates

Patrick Falls 12 years ago
parent
commit
dcaf507076
2 changed files with 2 additions and 4 deletions
  1. 1 3
      compojure/hello/src/hello/handler.clj
  2. 1 1
      compojure/setup.py

+ 1 - 3
compojure/hello/src/hello/handler.clj

@@ -8,12 +8,10 @@
             [compojure.route :as route]))
 
 ; Database connection
-(defdb db (mysql {:db "hello_world"
+(defdb db (mysql {:subname "//localhost:3306/hello_world?jdbcCompliantTruncation=false&elideSetAutoCommits=true&useLocalSessionState=true&cachePrepStmts=true&cacheCallableStmts=true&alwaysSendSetIsolation=false&prepStmtCacheSize=4096&cacheServerConfiguration=true&prepStmtCacheSqlLimit=2048&zeroDateTimeBehavior=convertToNull&traceProtocol=false&useUnbufferedInput=false&useReadAheadInput=false&maintainTimeStats=false&useServerPrepStmts&cacheRSMetadata=true"
                   :user "benchmarkdbuser"
                   :password "benchmarkdbpass"
                   ;;OPTIONAL KEYS
-                  :host "localhost"
-                  :port "3306"
                   :delimiters "" ;; remove delimiters
                   :maximum-pool-size 256
                   }))

+ 1 - 1
compojure/setup.py

@@ -4,7 +4,7 @@ import sys
 import setup_util
 
 def start(args):
-  setup_util.replace_text("compojure/hello/src/hello/handler.clj", ":host \".*\"", ":host \"" + args.database_host + "\"")
+  setup_util.replace_text("compojure/hello/src/hello/handler.clj", ":subname \"//.*:3306", ":subname \"//" + args.database_host + ":3306")
 
   try:
     subprocess.check_call("lein ring uberwar", shell=True, cwd="compojure/hello")