Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get sqltyped up to date with Scala 2.11 #12

Merged
merged 4 commits into from
Apr 4, 2016

Conversation

vdichev
Copy link
Collaborator

@vdichev vdichev commented Apr 4, 2016

I know you've mentioned that you're not maintaining sqltyped right now, but I'd like to see it live on, as it has some features that I don't see with the alternatives:

  • like you said, Slick has a typed sql feature, but I do not like the fact that it infers the types only and doesn't take column names into account. With many columns with the same type and with typos in long column names this doesn't help too much.
  • doobie has an interesting approach (https://tpolecat.github.io/doobie-0.2.3/06-Checking.html) where one can check the query at runtime but without the need to actually run it. This makes it an acceptable alternative to typed queries. However, even though doobie works with records, it discards the column names (Record names not checked with column names typelevel/doobie#277) and uses positions only, which is counterintuitive after having seen sqltyped. This also makes using records seem unnecessarily difficult since unlike sqltyped they are constructed manually.

Regarding compilation speed, it's true that shapeless does impose a tax on compile times, but things seem to have improved in recent editions. I haven't actually checked to compare with older versions, but it seems the complexity of some operations has been optimized: milessabin/shapeless#50

I'd like to hear your thoughts on future development of sqltyped and whether you'd want or have the time to provide some a small piece of help once in a while:

  • updating the public maven repo is still maintained by you- are you willing to publish stuff from new pull requests?
  • providing some advice on some future features which are tied to some knowledge that you already have, like why sqltyped has chosen to choose a certain design and not another

Thanks in advance for any help you can offer!

As of Scala 2.11, constructing a BigDecimal from null throws exception
This means we have to fetch value before constructing Scala type
Fix possibly incorrect nullable check
@jonifreeman
Copy link
Owner

Hi Vassil,

This PR looks good and it is great if there's still interest in keeping sqltyped up to date and develop it further!

I will update the Sonatype maven repos this week and help with design issues any time. I will also give you commit rights to this repo so you can push changes more easily.

@jonifreeman jonifreeman merged commit f55e3ee into jonifreeman:master Apr 4, 2016
@vdichev
Copy link
Collaborator Author

vdichev commented Apr 4, 2016

Thanks a lot!

@jonifreeman
Copy link
Owner

Released 0.4.1 to Sonatype now.

@steffenlaursen
Copy link

I'm quite not as proficient with Scala as I would like, but this is one of the most interesting SQL libraries I've yet seen. It seems quite light weight in use and I'm really looking forward to playing with it. From what I understand, it is just pure SQL which is type checked at compile time and also returns typed values (in a nice type safe package with columns as class members).
My plan would be to add a sort of record layer Sqltyped. Be able to write something like:
sqlr"select [Person.*] from [Person]" - meaning that it would look at the companion object Person to determine the actual SQL table name and it's fields and return a list of Person. It'd be a way for me to easily add metadata to records which could be used and reused in UIs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants