It might be worth trying the ScalaIDE Eclipse plugin - I think it works with Helios now. That said, I had so many issues using it half a year ago I went and learnt to use emacs with scala-mode, which, combined with sbt ~test, has worked out brilliantly.
The only thing I'd really appreciate an IDE for is mass refactoring (my project is at a point now where it's all a bit badly organised).
My similar bad experience with Eclipse took me to IntelliJ with the Scala plugin and it has been a markedly better experience these last few months. The refactoring abilities in IntelliJ are pretty good so far.
IntelliJ's IDEA IDE has excellent Scala integration in the Community Edition (i.e. the free version).
I've been working with Scala for about two years now and in my experience IDEA has always been ahead of Eclipse for Scala development. That being said I prefer IDEA for writing Java code too so this may just be personal preference.
Also worth adding to the list are Querulous and Configgy, which are (respectively) a database abstraction layer which is optimised for running raw SQL (it's not an ORM, it just abstracts away 90% of the JDBC bullshit), and a config/logging library.
Also, sbt is fantastic. sbt ~test is a cheap form of CI: every time you save a file, your project gets recompiled and your tests re-run; it makes it really easy to get IDE-like error detection out of a simple text editor, and encourages you to write tests for your code.
What's wrong with JDBC? Slap a driver in, and then populate the parameters of your statement (basically a query string wrapped in an object that prevents SQL injection attacks) and BAM you're good to go. Iterate through the result set. If you want fast raw (but no food poisoning) SQL it doesn't get much better than that.
I hope your Querulous and Configgy are set up in such a way as to easily avoid SQL Injection?
Or since you're talking about database abstraction, at the other end of the scale JPA is an absolute dream. Very easy to get up and running fast with the right tools (Netbeans used to be good for this).
Just don't touch J2EE with a barge-pole (Java EE 5 is the nice one) and you'll be fine.
I find JDBC unnecessarily wordy for everyday usage. Preventing SQL injection with:
PreparedStatement x = dbh.prepare("SELECT * FROM mytable WHERE a = ? AND b = ?");
x.setString(1, "test");
x.setInt(2, 3);
ResultSet xs = x.execute()
while (x.next()) { ... }
... and so on and so forth, is far more lines than I personally think I should need to write. The type system already knows the types of the vars I'm dealing with: why should I have to retell it what they are?
Querulous:
val connection = QueryEvaluator(host, dbname, username password);
connection.select("SELECT * FROM mytable WHERE a = ? AND b = ?", "test", 3) { row => ... }
It's much more concise, it's just as type-safe (and therefore avoids SQL Injection, as behind the scenes Querulous uses a prepared statement), and (to my mind) makes code much easier to deal with.
Each to their own :), but after dealing with a _lot_ of raw JDBC in another project, Querulous has been much nicer to me.
11 comments
[ 7.4 ms ] story [ 35.0 ms ] threadThe only thing I'd really appreciate an IDE for is mass refactoring (my project is at a point now where it's all a bit badly organised).
I've been working with Scala for about two years now and in my experience IDEA has always been ahead of Eclipse for Scala development. That being said I prefer IDEA for writing Java code too so this may just be personal preference.
Also, sbt is fantastic. sbt ~test is a cheap form of CI: every time you save a file, your project gets recompiled and your tests re-run; it makes it really easy to get IDE-like error detection out of a simple text editor, and encourages you to write tests for your code.
I hope your Querulous and Configgy are set up in such a way as to easily avoid SQL Injection?
Or since you're talking about database abstraction, at the other end of the scale JPA is an absolute dream. Very easy to get up and running fast with the right tools (Netbeans used to be good for this).
Just don't touch J2EE with a barge-pole (Java EE 5 is the nice one) and you'll be fine.
PreparedStatement x = dbh.prepare("SELECT * FROM mytable WHERE a = ? AND b = ?");
x.setString(1, "test");
x.setInt(2, 3);
ResultSet xs = x.execute()
while (x.next()) { ... }
... and so on and so forth, is far more lines than I personally think I should need to write. The type system already knows the types of the vars I'm dealing with: why should I have to retell it what they are?
Querulous:
val connection = QueryEvaluator(host, dbname, username password);
connection.select("SELECT * FROM mytable WHERE a = ? AND b = ?", "test", 3) { row => ... }
It's much more concise, it's just as type-safe (and therefore avoids SQL Injection, as behind the scenes Querulous uses a prepared statement), and (to my mind) makes code much easier to deal with.
Each to their own :), but after dealing with a _lot_ of raw JDBC in another project, Querulous has been much nicer to me.
Scalatra https://github.com/scalatra/scalatra
a Sinatra-like (ruby) framework.
http://www.scala-lang.org/node/1209