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] json_each() in a table trigger for an 'attached' db causes an error

2018-11-02 Thread Lindsay Lawrence
P.S. Here are the first few lines of 'fossil timeline' on my local that I am building. === 2018-11-02 === 17:38:39 [1fa74930ab] Enhance triggers so that they can use table-valued-functions that exist in schemas outside of the schema in which the trigger is defined. (user: drh) === 2018-10-31 ===

Re: [sqlite] json_each() in a table trigger for an 'attached' db causes an error

2018-11-02 Thread Lindsay Lawrence
Hi, Sorry. I have had no luck with this. I followed the instructions here https://www.sqlite.org/getthecode.html#clone then built from source following the directions in README.md. mkdir bld;# Build will occur in a sibling directory cd bld ;# Change to

Re: [sqlite] json_each() in a table trigger for an 'attached' db causes an error

2018-11-02 Thread Lindsay Lawrence
Ok. I am a fossil newbie. My effort to build from that did not work. The amalgamation from configure+make seemed incomplete and other files like json1.c were missing. I am on trunk and fossil timeline showed Dr Hipp's fix. I'll educate myself a bit more on Fossil to see where I went wrong.

Re: [sqlite] json_each() in a table trigger for an 'attached' db causes an error

2018-11-02 Thread Keith Medcalf
configure --enable-load-extension --enable-threadsafe --with-readline-lib=auto --with-pic --enable-json1 --enable-fts3 --enable-fts4 --enable-fts5 --enable-rtree --enable-session --enable-update-limit --enable-geopoly Adjust the configure parameters to include what you want included. ---

Re: [sqlite] json_each() in a table trigger for an 'attached' db causes an error

2018-11-02 Thread Keith Medcalf
Works for me using Lindsay's original scripts. 3.26.0 2018-11-02 17:38:39 1fa74930ab56171e2e840d4a5b259abafb0ad1e0320fc3030066570a6dd1alt2 --- The fact that there's a Highway to Hell but only a Stairway to Heaven says a lot about anticipated traffic volume. >-Original Message-

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] curious discovery about geopoly module

2018-11-02 Thread Graham Hardman
Thanks for the very detailed info. I am certainly a lot wiser now! Graham On 01-11-2018 11:40 pm, R Smith wrote: On 2018/11/01 9:51 AM, Graham Hardman wrote: I am pleased about this, although still puzzled by the fact that the windows LoadLibrary call returned a non null pointer and windows

Re: [sqlite] Displaying row count

2018-11-02 Thread E.Pasma
> R Smith: > > Simply add a column to any select like this: et voila... I tried without "partition by 1" and that works as well: "row_number() OVER ()" ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org

Re: [sqlite] Bug: float granularity breaking unique contraint?

2018-11-02 Thread Dennis Clarke
INSERT INTO TestReal values (9223372036854775807);INSERT INTO TestReal values (9223372036854775807 - 1);INSERT INTO TestReal values (9223372036854775807 - 2);INSERT INTO TestReal values (9223372036854775807 - 3);sqlite>...>...>...>...> I recognize that number on sight and it

Re: [sqlite] Bug: float granularity breaking unique contraint?

2018-11-02 Thread David Raymond
I did a little Python script to go find what the data was that was actually being stored. They're each getting stored as serial type 6: "Value is a big-endian 64-bit twos-complement integer." So apparently unique indexes consider uniqueness based on the *stored* value, whereas distinct

Re: [sqlite] Sqlite intarray issue

2018-11-02 Thread Roman Ivasyshyn
Thank you for the clarification. On Wed, Oct 31, 2018 at 6:03 PM Richard Hipp wrote: > On 10/31/18, Roman Ivasyshyn wrote: > > > > I faced with an issue of creating int array with the same name without > > closing connection. > > That is not allowed. But you can use sqlite3_intarray_bind() to

Re: [sqlite] json_each() in a table trigger for an 'attached' db causes an error

2018-11-02 Thread Lindsay Lawrence
Thanks! As a further note, I also tried building the shell with JSON1 enabled and building and loading the json1 extension separately, with the same results. SQLite version 3.25.2 2018-09-25 19:08:10 Enter ".help" for usage hints. Connected to a transient in-memory database. Use ".open FILENAME"

Re: [sqlite] json_each() in a table trigger for an 'attached' db causes an error

2018-11-02 Thread Richard Hipp
Please try your test script on the latest trunk check-in and let us know whether or not it is working for you. -- D. Richard Hipp d...@sqlite.org ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org

[sqlite] Suggestion about check-in 1fa74930ab

2018-11-02 Thread sqlite
This check-in is done so that trigger programs can use table-valued-functions. But it seems to me that the correct way should be to check if it is a eponymous virtual table; whether it uses table-valued-function syntax or not is irrelevant. Since, eponymous virtual tables do not belong to any

[sqlite] json_each() in a table trigger for an 'attached' db does not work

2018-11-02 Thread Lindsay Lawrence
Has anyone else run into this issue? Is there a workaround? I have the following tables and trigger - Data table CREATE TABLE people ( id INTEGER PRIMARY KEY, created TIMESTAMP DEFAULT CURRENT_TIMESTAMP, name TEXT, age INTEGER ); -- Change log table CREATE TABLE change_log (

[sqlite] json_each() in a table trigger for an 'attached' db causes an error

2018-11-02 Thread Lindsay Lawrence
Has anyone else run into this issue? I have the following tables and trigger - Data table CREATE TABLE people ( id INTEGER PRIMARY KEY, created TIMESTAMP DEFAULT CURRENT_TIMESTAMP, name TEXT, age INTEGER ); -- Change log table CREATE TABLE change_log ( id INTEGER PRIMARY

Re: [sqlite] json_each() in a table trigger for an 'attached' db causes an error

2018-11-02 Thread Richard Hipp
On 11/2/18, Lindsay Lawrence wrote: > Has anyone else run into this issue? I can confirm that it is an issue and that we are working on it. -- D. Richard Hipp d...@sqlite.org ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org

Re: [sqlite] curious discovery about geopoly module

2018-11-02 Thread Graham Hardman
Thanks. In my case there is no installer as such. My vba code runs inside the same process as the host cad system. In this case Bricscad has already loaded their copy of dqlite3.dll and my like-named file could not demand precedence. Graham On 02-11-2018 3:16 am, Simon Slavin wrote: On 1