The current implementation is useful for providing...
# jasync-sql
d
The current implementation is useful for providing defaults like
it.getInt(0) ?: 0
, but maybe there could be some other name for such an implementation?
o
What you said is not accurate.
getInt
will return null if the db value is null. In case the column name not exists it will throw an exception with column name (you can test it, maybe it can be more clear). for the index method it will throw ArrayIndexOutOfBound
d
Oh, so if its not nullable, then one can safely just use the !! ... that's good to know! It still feels a bit funny to use it so much in Kotlin... but at least it makes more sense. It might be good to document this on those functions (I tend to look for behaviour of functions with ctrl-q alot...), but thanks for the explanation!
o
The kotlin way is not to use getInt but getAs<Int>() then you dont need the null check
👍🏼 1