Make writing generic SQL wrappers easier with RowList.append(R)
timothybasanov opened this issue · comments
Hi,
Hope you had another great day.
I'm using acolyte to intercept calls to my SQL driver, wrap them, execute remotely and return results back through JDBC.
Reasoning: implementing my own ResultSet and Connection and other JDBC classes is way to painful.
It was non-trivial to write it as I need to be able to convert matrix of data into QueryResult. I achieved it with: my own Update- and QueryHandler and my own RowList implementations.
Main reason for my own implementations: I can not reuse deprecated RowList.append(R row), I need to use one of the specific classes, but I do not know in advance number of and type of columns in the result as I'm writing generic wrapper.
Can I have generic implementation for RowList that I can reuse that allows me to use Iterator for row data generation or at least use append(R row) to add data?
Thanks for the consideration.
Hi,
I don't see your point in requiring a custom RowList impl. Can elaborate a bit what do you wan to do in handlers and why custom impl would be useful?
Best
I'm implementing handler that takes an unknown generated query, executes it in a special way and returns query result.
Essentially I have List<List> that I'm trying to convert into QueryResult.
Entirely possible that I've missed an API to do that.
Any help appreciated.
Sent from mobile
On Jan 28, 2014, at 12:38 PM, cchantep notifications@github.com wrote:
Hi,
I don't see your point in requiring a custom RowList impl. Can elaborate a bit what do you wan to do in handlers and why custom impl would be useful?
Best
—
Reply to this email directly or view it on GitHub.
Either you can use provided RowListX (with X being column count), with its append(a, b, ..., x)
(which is typesafe) or you can implement RowList based on List (just requires implementing getColumn{Labels,Classes,Nullables}) with custom append method.
Best
I did the second variant. Works for me.
Now I'm convinced that I have not missed any special API for this case.
Thanks.
Sent from mobile
On Jan 28, 2014, at 3:58 PM, cchantep notifications@github.com wrote:
Either you can use provided RowListX (with X being column count), with its append(a, b, ..., x) (which is typesafe) or you can implement RowList based on List (just requires implementing getColumn{Labels,Classes,Nullables}) with custom append method.
Best
—
Reply to this email directly or view it on GitHub.