Re: [sqlite] Mixing main and temp databases in foreign keys is not supported

2019-05-12 Thread Manuel Rigger
Okay, thanks for the clarification! Best, Manuel On Mon, May 13, 2019 at 1:38 AM J. King wrote: > On May 12, 2019 7:33:20 p.m. EDT, Manuel Rigger > wrote: > > >As far as I understood, the main and temp databases are always loaded > >and > >cannot be detached. But, as you pointed out, I can

Re: [sqlite] Mixing main and temp databases in foreign keys is not supported

2019-05-12 Thread J. King
On May 12, 2019 7:33:20 p.m. EDT, Manuel Rigger wrote: >As far as I understood, the main and temp databases are always loaded >and >cannot be detached. But, as you pointed out, I can understand that this >makes sense in the general case. Note that the temp database is specific to a given

Re: [sqlite] Mixing main and temp databases in foreign keys is not supported

2019-05-12 Thread Manuel Rigger
Thanks for your quick response! On Mon, May 13, 2019 at 1:17 AM Simon Slavin wrote: > On 12 May 2019, at 11:56pm, Manuel Rigger wrote: > > > Is this intended? > > Yes. Because the temp database disappears when you close your connection. > So you would open a database and find that either a

Re: [sqlite] Mixing main and temp databases in foreign keys is not supported

2019-05-12 Thread Simon Slavin
On 12 May 2019, at 11:56pm, Manuel Rigger wrote: > Is this intended? Yes. Because the temp database disappears when you close your connection. So you would open a database and find that either a parent or a child table had disappeared. Which would mean the database was corrupt. Actually

[sqlite] Mixing main and temp databases in foreign keys is not supported

2019-05-12 Thread Manuel Rigger
Hi everyone, It seems that a table created in the temp database cannot have a parent table that is created in the main database and vice versa: PRAGMA foreign_keys=true; CREATE TABLE t0 (c0 PRIMARY KEY); CREATE TEMP TABLE t1 (c0, FOREIGN KEY(c0) REFERENCES t0(c0)); INSERT INTO t1(c0) VALUES (1);

Re: [sqlite] CTE to Get Path In a Tree

2019-05-12 Thread Philip Bennefall
On 5/12/2019 2:14 PM, Igor Tandetnik wrote: On 5/12/2019 6:19 AM, Philip Bennefall wrote: Hi everyone, I have a tree of folders and I want to find the complete path from any arbitrary point back to the top level directory. The schema is: CREATE TABLE IF NOT EXISTS folders( id INTEGER

Re: [sqlite] CTE to Get Path In a Tree

2019-05-12 Thread Igor Tandetnik
On 5/12/2019 6:19 AM, Philip Bennefall wrote: Hi everyone, I have a tree of folders and I want to find the complete path from any arbitrary point back to the top level directory. The schema is: CREATE TABLE IF NOT EXISTS folders(     id INTEGER PRIMARY KEY,     parentFolderId INTEGER

Re: [sqlite] How to retrieve "latest" fileio.c, test_windirect.c/h files?

2019-05-12 Thread Justin Clift
On 2019-05-12 21:39, Warren Young wrote: On May 11, 2019, at 10:46 PM, Justin Clift wrote: One of the steps uses curl to download fileio.c, test_windirent.c/.h from fossil [snip] Is there a way to always get "the latest" version of the file? :) $ curl -L -o src/extensions/fileio.c

Re: [sqlite] How to retrieve "latest" fileio.c, test_windirect.c/h files?

2019-05-12 Thread Warren Young
On May 11, 2019, at 10:46 PM, Justin Clift wrote: > > One of the steps uses curl to download fileio.c, test_windirent.c/.h > from fossil [snip] > Is there a way to always get "the latest" version of the file? :) $ curl -L -o src/extensions/fileio.c

Re: [sqlite] Partial NOT NULL index malfunctions with IS NOT/!=

2019-05-12 Thread Manuel Rigger
Great, thanks, Dan! Best, Manuel On Sat, May 11, 2019 at 4:05 PM Dan Kennedy wrote: > > On 11/5/62 16:54, Manuel Rigger wrote: > > Hi everyone, > > > > I found another test case that demonstrates a malfunctioning index: > > > > CREATE TABLE IF NOT EXISTS t0 (c0); > > CREATE INDEX IF NOT EXISTS

Re: [sqlite] SQLite with single writer on Windows network share

2019-05-12 Thread Warren Young
On May 11, 2019, at 5:52 PM, Jose Isaias Cabrera wrote: > > Warren Young, on Saturday, May 11, 2019 06:20 PM, wrote... >> >> On May 11, 2019, at 4:10 PM, Thomas Kurz wrote: >> >> It should run under Cygwin and WSL. > > I tried to build it. I fould out that I needed brew Cygwin’s own package

[sqlite] How to retrieve "latest" fileio.c, test_windirect.c/h files?

2019-05-12 Thread Justin Clift
Hi all, Is there a way to grab the "latest" version of a SQLite source file? In this instance, we have an automatic nightly process (shell script) that builds the DB Browser for SQLite nightly builds. One of the steps uses curl to download fileio.c, test_windirent.c/.h from fossil, so the

[sqlite] CTE to Get Path In a Tree

2019-05-12 Thread Philip Bennefall
Hi everyone, I have a tree of folders and I want to find the complete path from any arbitrary point back to the top level directory. The schema is: CREATE TABLE IF NOT EXISTS folders( id INTEGER PRIMARY KEY, parentFolderId INTEGER REFERENCES folders(id) ON DELETE CASCADE ON UPDATE