Permalink
Browse files

Renamed pass to password, added exec to PGScala, added sslmode to PGC…

…redentials.
  • Loading branch information...
1 parent 17f31da commit 5d8fee7371a143ca66c636069d965ded6f843f2c @melezov committed Mar 6, 2013
@@ -2,8 +2,9 @@ package org.pgscala
case class PGCredentials(
host: String
-, port: Int
+, port: Int = 5432
, dbName: String
, user: String
-, pass: String
+, password: String
+, sslMode: String = "require"
)
@@ -89,6 +89,13 @@ class PGScala(con: java.sql.Connection) {
}
/**
+ * Query the database and discard the result.
+ */
+
+ def exec(query: String, params: ParamText[_]*): Unit =
+ qry(query, params: _*){ _ => }
+
+ /**
* Query one database tuple.
*/
@@ -13,5 +13,5 @@ class PGSimple(creds: PGCredentials) extends PGSimpleDataSource
setPortNumber(creds.port)
setDatabaseName(creds.dbName)
setUser(creds.user)
- setPassword(creds.pass)
+ setPassword(creds.password)
}
@@ -12,7 +12,7 @@ class PGPool(creds: PGCredentials) extends PGSessionFactory {
format(creds.host, creds.port, creds.dbName))
cpds.setUser(creds.user)
- cpds.setPassword(creds.pass)
+ cpds.setPassword(creds.password)
cpds
}
View
@@ -16,9 +16,6 @@ object BuildSettings {
name := "pgscala-iorc"
, version := "0.1.7"
, initialCommands := "import org.pgscala.iorc._"
- , crossScalaVersions := Seq(
- "2.9.0", "2.9.0-1", "2.9.1", "2.9.1-1", "2.9.2", "2.9.3"
- )
)
// ===========================================================================
@@ -57,13 +54,14 @@ object BuildSettings {
val bsPGScala = scalaSettings ++ Seq(
name := "pgscala"
- , version := "0.7.22"
+ , version := "0.7.23"
, initialCommands := "import org.pgscala._"
)
val bsPool = scalaSettings ++ Seq(
name := "pgscala-pool"
- , version := "0.2.15"
+ , version := "0.2.16"
+ , initialCommands := "import org.pgscala._"
)
}
@@ -75,7 +73,7 @@ object Dependencies {
lazy val postgres = "postgresql" % "postgresql" % "9.2-1002.jdbc4"
- lazy val c3p0 = "c3p0" % "c3p0" % "0.9.2"
+ lazy val c3p0 = "com.mchange" % "c3p0" % "0.9.2"
lazy val slf4j = "org.slf4j" % "slf4j-api" % "1.7.2"
lazy val log4jOverSlf4j = "org.slf4j" % "log4j-over-slf4j" % "1.7.2"
@@ -84,6 +82,7 @@ object Dependencies {
lazy val scalaIo = (sV: String) =>
"com.github.scala-incubator.io" % "scala-io-file_".+(sV match {
case "2.9.2" | "2.9.3" => "2.9.2"
+ case x if x startsWith "2.10" => "2.10"
case x => "2.9.1"
}) % "0.4.1-seq"

0 comments on commit 5d8fee7

Please sign in to comment.