Check out Anko Sqlite <https://github.com/Kotlin/a...
# android
j
Check out Anko Sqlite https://github.com/Kotlin/anko/blob/master/doc/SQLITE.md I know that it is not ORM, but I implemented first database table just yesterday and I’m happy with it. I love that I have full controll over mapping. I work with Hibernate daily so you know… it’s refreshing 😄
a
jakub.dyszkiewicz: Looks great, thx! I will search to see if there is any demo. BTW can this work with Java? It doesn’t seems like that
j
No, it’s only for Kotlin.
a
got it
k
Requery.io is also nice fyi...I like the type safe dsl
a
I met some problem I think...
The code from anko doc produce some error
Copy code
db?.createTable("Customer", ifNotExists = true, 
                    "_id" to INTEGER + PRIMARY_KEY + UNIQUE,
                    "name" to TEXT,
                    "photo" to BLOB)
And IDE shows that
mixing name and arguments is not allowed
Requery.io looks nice 😸
j
yeah, that must be error in documentation
because I had the same problem with mixing names and arguments
a
BTW Requery.io also looks.... difficult to understand how to actually use it in Android project...
c
@jakub.dyszkiewicz I wonder: why use their template syntax with
{}
and pairs in parameters instead of Kotlin's string interpolation?
Does it do extra processing like adding quotes around strings, that kind of thing?
j
yeah, probably protecting from sqlinjection?
k
Requery isn't bad on an Android project. It's similar to a lot of other orm frameworks...And a bit like JPA server side