davidpeklak / fasqlitate   0.1.1

MIT License GitHub

facilitate work with sql

Scala versions: 2.10

fasqlitate

Build Status

A micro-library that facilitates building java.sql.PreparedStatements in scala.

Example

import fasqlitate._
import ConnectionSyntax._
import Default._

val connection: java.sql.Connection
val i = 3
val ps = connection.prepareStatement(sql"select * from FOO where BAR = $i")

This has the effect of

val connection: java.sql.Connection
val i = 3
val ps = connection.prepareStatement("select * from FOO where BAR =  ? ")
ps.setInt(1, i)

Get Started

Add the following to your build.sbt

Resolvers += Resolver.bintrayRepo("dpeklak", "maven")

libraryDependencies += "com.github.davidpeklak" % "fasqlitate_2.10" % "0.1.1"