Skip to content

Commit

Permalink
Renamed pass to password, added exec to PGScala, added sslmode to PGC…
Browse files Browse the repository at this point in the history
…redentials.
  • Loading branch information
melezov committed Mar 6, 2013
1 parent 17f31da commit 5d8fee7
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 10 deletions.
5 changes: 3 additions & 2 deletions pgscala/src/main/scala/org/pgscala/PGCredentials.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
7 changes: 7 additions & 0 deletions pgscala/src/main/scala/org/pgscala/PGScala.scala
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,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.
*/
Expand Down
2 changes: 1 addition & 1 deletion pgscala/src/main/scala/org/pgscala/PGSimple.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
2 changes: 1 addition & 1 deletion pool/src/main/scala/org/pgscala/PGPool.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
11 changes: 5 additions & 6 deletions project/PGScalaBuild.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
)

// ===========================================================================
Expand Down Expand Up @@ -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._"
)
}

Expand All @@ -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"
Expand All @@ -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"

Expand Down

0 comments on commit 5d8fee7

Please sign in to comment.