Re: [sqlite] forming sqlite3_statements using stored sql

2018-11-04 Thread Peter da Silva
I don't care for the sql variable syntax they're using, since it appears to conflict with the native Tcl bindings for sqlite3. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org

Re: [sqlite] forming sqlite3_statements using stored sql

2018-11-03 Thread Dingyuan Wang
It seems that SpatiaLite (an extension for GIS) plans to support that: https://www.gaia-gis.it/fossil/libspatialite/wiki?name=Stored+Procedures 2018-11-02 03:53, Thomas Kurz: >> Rather than inserting the SQL into a user-visible table, it might be > preferable to support CREATE PROCEDURE. > > +1

Re: [sqlite] forming sqlite3_statements using stored sql

2018-11-03 Thread James K. Lowden
On Fri, 2 Nov 2018 15:24:51 -0700 Jens Alfke wrote: > > On Nov 2, 2018, at 12:50 AM, Thomas Kurz > > wrote: > > > > My opinion is that the logic for database queries should be held > > together with the data. > > Why? The logic has to be in the application itself (where else would > it come

Re: [sqlite] forming sqlite3_statements using stored sql

2018-11-02 Thread Jens Alfke
> On Nov 2, 2018, at 12:50 AM, Thomas Kurz wrote: > > My opinion is that the logic for database queries should be held together > with the data. Why? The logic has to be in the application itself (where else would it come from?) to copy into the database in the first place. So why create a

Re: [sqlite] forming sqlite3_statements using stored sql

2018-11-02 Thread Thomas Kurz
My opinion is that the logic for database queries should be held together with the data. I don't think that embedded vs. non-embedded makes a difference here. One could as well use a MySQL or whatsoever database, and the application code still owned and create the database. This will always be

Re: [sqlite] forming sqlite3_statements using stored sql

2018-11-01 Thread Jens Alfke
This doesn’t seem very useful for an embedded database engine — the application code owns and creates the database, so it already has those SQL strings; in which case it just seems like extra work to first write them to the DB and then have the DB read them back out again to compile statements.

Re: [sqlite] forming sqlite3_statements using stored sql

2018-11-01 Thread Thomas Kurz
> Rather than inserting the SQL into a user-visible table, it might be preferable to support CREATE PROCEDURE. +1 for that ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org

Re: [sqlite] forming sqlite3_statements using stored sql

2018-11-01 Thread James K. Lowden
On Thu, 1 Nov 2018 08:41:51 +0100 Clemens Ladisch wrote: > > It strikes me that this would be nicer if sqlite offered this as > > an intrinsic capability. > > How would SQLite know what the table and column names are? When the SQL is loaded, it can be parsed and analyzed. SQLite could, if

Re: [sqlite] forming sqlite3_statements using stored sql

2018-11-01 Thread Clemens Ladisch
David Fletcher wrote: > create table if not exists StmtSQL ( > StmtNameTEXT NOT NULL UNIQUE, > SQL TEXT NOT NULL); > > The GetPreparedStmt() function retrieves the SQL from table, creates a new > sqlite3_statement object (or retrieves this from a