Any halfway decent jdbc wrappers for Scala?
Asked Answered
I

2

15

I'm looking for a stripped down (so NOT like squeryl, or anything that creates typesafe queries where I have to respecify the table just to get some data) wrapper for jdbc.

i'm using scala 2.9 and postgres.

Anyone have success here?

Interlaken answered 3/2, 2012 at 18:34 Comment(5)
Curious, what is your opposition to typesafe queries? How do you cast your non-typesafe query results to Scala types? Manually presumably. Anyway, I have not used Squeryl, but am using ScalaQuery with great pleasure. TypeSafe picked up the project; "everyone" will be using it when they launch their LINQ-to-SQL evolution of the project, code named, SIQ. Perhaps a bit more explanation re: your use case for straight jdbc would help deter people like me from suggesting what you appear not to want ;-)Gerome
Here is nearly full list: stackoverflow.com/a/2318935/298389Etty
@Etty Actually, it's not nearly full! :-) I gave up on updating it once the wiki overtook it.Globe
@virtualeyes, I don't have a problem with typesafe queries. I have a problem with having to define an object that is literally mirroring everything I already have in a pre-existing database so I can do queries. There's nothing wrong with ORM-ish things, but sometimes you really just want to do a query and get your results by iterating and doing things like rs.getString("columnOne"), etc.Interlaken
@dave, yah, that's why I asked about the use case. If you just want to get sh*t done without overhead of mapping tables to code, I can appreciate the straight jdbc approach.Gerome
C
9

I've used Prequel successfuly in the past. It is just a JDBC wrapper.

There is also Twitter's Querulous, but due to some crippling bugs I found it unusable (leaking connections). It also brings a huge stash of dependencies.

Conference answered 3/2, 2012 at 18:38 Comment(2)
Glad I'm not the only one. I'm currently running as fast as I can from Querulous.Interlaken
Thanks for enlightening me about Prequel, it's refreshing to see something restrained and sufficient for a change.Bernardinabernardine
L
1

Try scala-jdbc-routine . It feels like Java's JDBC wrappers except the API is Scala-friendly (e.g. Option instead of null)

And it only does plain JDBC CRUD. There is no data source management, no forced transaction or session, and no automatic O/R mapping.

Lebensraum answered 29/7 at 15:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.