Re: [sqlite] Number of open connections

2019-03-11 Thread Richard Hipp
On 3/11/19, Chris Locke wrote: > Does SQLite keep a count of the number of current open connections to the > database? No. SQLite can find out if some other connection has the database open in WAL mode, or if some other database has an active transaction, because it needs to know those things.

[sqlite] sqlar: makeDirectory called with permission bits of file

2019-03-11 Thread Winter, Martin
Hi, when extracting files in subdirectories from an sqlar archive, or when otherwise using the writefile function to create a file in a subdirectory, the makeDirectory function is called with the permission bits of the file. If e.g. the file has permission bits 0664, then the directory will

Re: [sqlite] [EXTERNAL] where did my data go ? Re: Import data into a temporary table

2019-03-11 Thread Hick Gunter
Are you aware of the fact that your csv file describes a table containting three columns (name a, b, and c) whereas your SQL describes a single column named a,b,c with embedded commas in the values too? Also please note that a temp table is disposed of when the connection is closed. So what

Re: [sqlite] [EXTERNAL] where did my data go ? Re: Import data into a temporary table

2019-03-11 Thread Hick Gunter
And omitting .mode csv is probably messing up the .import -Ursprüngliche Nachricht- Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im Auftrag von Luuk Gesendet: Samstag, 09. März 2019 10:32 An: sqlite-users@mailinglists.sqlite.org Betreff: [EXTERNAL] [sqlite]

[sqlite] Recursive CTE on tree with doubly linked items

2019-03-11 Thread heribert
I've a tree with doubly linked items. I want to get all siblings of a tree node (e.g. ID=2 or harder to implement ID=3). I tried to solve this problem with CTE of SQLite by myself - but I can not find the solution. I looked for any exemplary solution - but do not find some. DROP TABLE IF

Re: [sqlite] Recursive CTE on tree with doubly linked items

2019-03-11 Thread Jean-Luc Hainaut
Your implementation of trees is that of network databases at the pointer-based physical level but definitely not relational. Try this: create table TREE( ID integer not null primary key, Parent integer references TREE on delete ... on update cascade); -- Notice the absence of "not null"

Re: [sqlite] [EXTERNAL] Recursive CTE on tree with doubly linked items

2019-03-11 Thread Hick Gunter
You might like to consider writing the phrase INTEGER PRIMARY KEY to make ID an alias for the rowid, or adding the phrase WITHOUT ROWID to make ID the "true" primary key. What is your definition of "sibling"? Is it not the set of nodes reachable via the PrevIdx and (respecitvely in the case of

Re: [sqlite] [EXTERNAL] Recursive CTE on tree with doubly linked items

2019-03-11 Thread heribert
Siblings (in my case) are nodes have the same parent - the NextIDX and PrevIDX are only used for ordering sibling nodes. Every node may be parent of other nodes. The ParentIDX is the downward ID of the parent node. Yes, you are right: If i delete a node (parent node) all childs of the node

[sqlite] Difference between ".import" and tcl/sqlite3 "copy"

2019-03-11 Thread Graham Holden
I'm using SQLite through Tcl, and am having a problem with the sqlite3/Tcl "copy" command (similar to the shell's ".import" command). Given "test.csv" 1,"aaa","bbb ccc" Using the shell, I get the following -- the double-quotes from the CSV are not stored in the database: create table test ( id

Re: [sqlite] Recursive CTE on tree with doubly linked items

2019-03-11 Thread Clemens Ladisch
heribert wrote: > I've a tree with doubly linked items. I want to get all siblings of a tree > node. If you want them in order, you have to walk through the linked list: WITH SiblingsOf3 AS ( SELECT * FROM Tree WHERE ParentIDX = (SELECT ParentIDX FROM Tree

Re: [sqlite] Recursive CTE on tree with doubly linked items

2019-03-11 Thread heribert
Thx clemens, it works perfect - but i do not understand why. The 'inital-select' results with the head node - only one result set. SELECT * FROM Tree WHERE ParentIDX = (SELECT ParentIDX FROM Tree WHERE ID = 3) AND PrevIDX IS NULL Points

[sqlite] Number of open connections

2019-03-11 Thread Chris Locke
Does SQLite keep a count of the number of current open connections to the database? On the DB4S mailing list, there is an enquiry ( https://github.com/sqlitebrowser/sqlitebrowser/issues/1798) about encryption failing due to the database being open. Was wondering whether a PRAGMA or function

Re: [sqlite] Difference between ".import" and tcl/sqlite3 "copy"

2019-03-11 Thread E.Pasma
> Op 11 mrt. 2019, om 13:20 heeft Graham Holden het > volgende geschreven: > > I'm using SQLite through Tcl, and am having a problem with the > sqlite3/Tcl "copy" command (similar to the shell's ".import" command). > > Given "test.csv" > 1,"aaa","bbb ccc" > > Using the shell, I get the

Re: [sqlite] Recursive CTE on tree with doubly linked items

2019-03-11 Thread Keith Medcalf
On Monday, 11 March, 2019 09:42, heribert wrote: >it works perfect - but i do not understand why. See https://sqlite.org/lang_with.html for a description of recursive queries ... >The 'inital-select' results with the head node - only one result set. >SELECT * > FROM Tree > WHERE

Re: [sqlite] Maximum result set size

2019-03-11 Thread Simon Slavin
On 11 Mar 2019, at 7:30pm, Tim Streater wrote: > What is the maximum size in bytes that a result set may be? And what happens > if that size were to be exceeded? [The following is simplified for clarity. I discuss only worst cases and ignore caching.] SQLite does not prepare an entire

Re: [sqlite] Difference between ".import" and tcl/sqlite3 "copy"

2019-03-11 Thread Graham Holden
Monday, March 11, 2019, 6:59:56 PM, E.Pasma wrote: > I can confirm that this has nothing to do with the sqlite version, > as it is so in the tcl binding from the current release (3.28.0.). > There is no "mode" method or paramater like in the shell. I'd > probably work around this by an update

[sqlite] Maximum result set size

2019-03-11 Thread Tim Streater
What is the maximum size in bytes that a result set may be? And what happens if that size were to be exceeded? -- Cheers -- Tim ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org

Re: [sqlite] Maximum result set size

2019-03-11 Thread Wout Mertens
Don't listen to me, Simon's answer is way better :) Wout. On Mon, Mar 11, 2019 at 9:22 PM Wout Mertens wrote: > There is no fixed limit, and the sqlite API just walks through the > results, so any memory overrun that happens is due to application level > code. > > Wout. > > > On Mon, Mar 11,

Re: [sqlite] Maximum result set size

2019-03-11 Thread Wout Mertens
There is no fixed limit, and the sqlite API just walks through the results, so any memory overrun that happens is due to application level code. Wout. On Mon, Mar 11, 2019 at 8:30 PM Tim Streater wrote: > What is the maximum size in bytes that a result set may be? And what > happens if that

Re: [sqlite] Maximum result set size

2019-03-11 Thread Tim Streater
On 11 Mar 2019, at 20:21, Simon Slavin wrote: > On 11 Mar 2019, at 7:30pm, Tim Streater wrote: > >> What is the maximum size in bytes that a result set may be? And what happens >> if that size were to be exceeded? > > [The following is simplified for clarity. I discuss only worst cases and >

Re: [sqlite] Maximum result set size

2019-03-11 Thread Simon Slavin
On 11 Mar 2019, at 8:32pm, Wout Mertens wrote: > Don't listen to me, Simon's answer is way better :) Your answer was absolutely correct. I just answered some other stuff too. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org