On Thu, Jun 4, 2015 at 4:21 PM, Darko Volaric <lists at darko.org> wrote:
> I'm saying that SQL is alien to the platform it's being used on and native > is better. I'm trying to make a general point (in vain it seems), I don't > use JSON. > {bunch of stuff snipped} I understand where you're coming from, I think. I have many times wanted a more procedural interface to SQLite. The common flow: 1. Construct a string from native data structures. 2. Compile (prepare) the string into SQLite data structures. Seems inefficient at first blush. Instinct (not logic) tells us that things would be more efficient if we could just build the data structures ourselves and not have to go through the preparation phase each time we run the program. The problem with this is that the SQL preparation phase hides roughly a metric ton of implementation details that can and do change frequently. Exposing the "raw" interface would likely result in one of two outcomes: either the raw interface would be very brittle requiring far more changes to user code with each update of the library, or the library would be forced to stagnate so as to not break user code with each update. Exposing so much functionality through the prepare API creates quite an elegant OO style interface. Implementation details can and do change frequently without breaking consumers of the library. Still, I do get your point. A different interface is attractive for multiple reasons. I have a different reason why I'd like a slightly different interface. I dislike the fact that my compiler is able to tell me about syntax issues in my C++ code but I don't know about syntax errors in my SQL code until I actually run the program. I've worked off and on in the past on a C++ interface that feels quite a bit like SQL but allows the compiler to report some classes of errors. It still results in a SQL-in-a-string that must be prepared, but I have a slightly higher level of confidence that the code is "correct" (instead of the all too often occurrence of missing whitespace because of string concatenation or some such). I've just never had a chance to finish it. SDR