Slick: a modern database query and access library for Scala
slick.typesafe.com
slick.typesafe.com
I don't think that its not achievable either. I think that LINQtoSQL and EntityFramework are the best implementation of database access that exists today. Import the database/table select over it with 95% assurance that the query will work at runtime and with the correct types. I really wish something like this existed in the Java world as I would switch in a heartbeat.
For the record I code C# mostly in my day job, but every time I move over to PHP/Java/Scala I miss LINQ. I am working with Play! at the moment and while the DB access is the best I have come across in the Java world, its still not at the same standard. I am still getting issues with simple selects where I should be using a Long rather then an Int.
After that, if your production schema is that different from your development schema that auto-generated code can't help, then you've got more problems than that.
I know that issues where the schema is different are always going to be a problem (nothing can save you there unless you want auto generated entities every time) but I can live with that.
How are you dealing with issues like the one I found the other day.
A view was created in MySQL which selected from a table with a column compressed with the compress function and was uncompressed in the view.
IE
select id,uncompress(content) as content from stuff;
The above looks fine, but unless you cast the content to a char most ORM's have issues working out what it is, yet it looks fine in your standard mysql command line query. It's an unusual case, but I would like to see the autogenerated code produce a binary cast so I can explicitly see the error when I generate rather then at runtime.
With pleasure. You are wrong. SLICK (formerly known as ScalaQuery) is Typesafe.
>> I am working with Play! at the moment and while the DB access is the best I have come across in the Java world
I've been working with Scalaquery with Play 2 for two months now. The experience has been fantastic. I haven't really had any queries I haven't been able to create even complex joins.
The approach where queries are made like Scala collections is really intuitive. Compared to you I just started using linq recently for a work related project. Basically coming from the other end and I've been quite pleased that the SQ skills I've built over the past month transferred over reasonably well. I only have good things to say about Slick. You should try it out.
Should have mentioned I am using Scala for the DB access in Play 2.0 and the other portions are mostly Java (heavy lifting done in existing libraries, so its just plumbing work hence doing it in Java). I am pretty happy with it except I still hit type issues which I would never encounter in LINQ.
I guess the way im looking at it is that LINQ solved a pain point for me which I am still experiencing in other languages. I would very much like someone to take the pain away from me, either by getting C# working well on Linux or bringing some of the features from C# over into the Java world.
I absolutely agree that LINQ has no peer in the open source world. I too am a .NET/C# dev by day but I've been playing around a lot with the Play! framework on my own time (built the UI to my senior thesis in it) and I much prefer their ANORM over a bastardized ORM that only half-works.