https://kotlinlang.org logo
#android
Title
# android
j

jakub.dyszkiewicz

03/05/2017, 11:00 AM
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

anthonyeef

03/05/2017, 11:33 AM
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

jakub.dyszkiewicz

03/05/2017, 11:34 AM
No, it’s only for Kotlin.
a

anthonyeef

03/05/2017, 11:35 AM
got it
k

kenkyee

03/05/2017, 12:24 PM
Requery.io is also nice fyi...I like the type safe dsl
a

anthonyeef

03/05/2017, 1:11 PM
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

jakub.dyszkiewicz

03/05/2017, 2:02 PM
yeah, that must be error in documentation
because I had the same problem with mixing names and arguments
a

anthonyeef

03/05/2017, 2:41 PM
BTW Requery.io also looks.... difficult to understand how to actually use it in Android project...
c

cedric

03/05/2017, 2:59 PM
@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

jakub.dyszkiewicz

03/05/2017, 3:22 PM
yeah, probably protecting from sqlinjection?
k

kenkyee

03/06/2017, 2:49 AM
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
5 Views