sqlite-jdbc
sqlite-jdbc copied to clipboard
What are the chance I can get you to implement createArrayOf and setArray?
The prepared statement throws not implemented but when operating on complex queries, the IN clause can be a god send.
public void setArray(int i, Array x) throws SQLException { throw unused(); }
I can mimic this but, I would prefer not to build strings rather I would prefer to let the Driver validate that the parameters / list being set meets the db specific type requirements.
The reality is that using the JDBC prepared statement abstraction becomes side stepped as my sql dialect is specific to whatever driver I'm using instead of being generic but I loose the very ANSI SQL idiom of the IN clause otherwise.
So I thought I had it figured out... I was wrong. So I deleted my earlier comment.
Would you be willing to accept PR's on this issue if I do figure it out?
Go for it! I won't pretend to speak for @xerial or anyone else for that matter, but I don't see any reason not to. I'm sure there's some other people out there who'd like the functionality.
Edit: Grammar
Hi guys! 1st of all, thank you for your effort on sqlite-jdbc, you save my life! 2nd thing is that I encountered a problem with jdbi today due to createArrayOf not being implemented.
https://github.com/jdbi/jdbi/blob/0420cc462f98565062bd577cf5d3a4d92a621060/core/src/main/java/org/jdbi/v3/core/array/SqlArrayArgument.java#L42
Application simply crashes when I use .bindArray() method.
I think it's similar to #708
PRs are welcome.
I checked on this today, and found out a few things:
- by default SQLite does not support arrays
- support is only available via a loadable extension
carray - the
carrayextension only supports those types:- 'int32'
- 'int64'
- 'double'
- 'char*'
I am closing this issue in favor of #708 which already mentions the carray extension.