Re: [sqlite] How to install REGEXP support?

2019-09-19 Thread Keith Medcalf
SELECT LOAD_EXTENSION('regexp'); assuming that the regexp dynamic library is located where it can be found. >-Original Message- >From: sqlite-users On >Behalf Of Peng Yu >Sent: Thursday, 19 September, 2019 20:20 >To: SQLite mailing list >Subject: Re: [sqlite] How to install REGEXP

Re: [sqlite] How to install REGEXP support?

2019-09-19 Thread Peng Yu
My question is `But it is not clear how to install it for sqlite3 installed by homebrew.` On 9/19/19, Warren Young wrote: > On Sep 18, 2019, at 8:33 AM, Peng Yu wrote: >> >> But I don't want to always specify a full path. I am asking where is >> the standard place to put the library file so

Re: [sqlite] How to install REGEXP support?

2019-09-19 Thread Warren Young
On Sep 18, 2019, at 8:33 AM, Peng Yu wrote: > > But I don't want to always specify a full path. I am asking where is > the standard place to put the library file so that I don't have to > always specify the whole path. You’re verging into “How do I program my computer?” or even “How do I use my

Re: [sqlite] [EXTERNAL] Group-by and order-by-desc does not work as expected

2019-09-19 Thread Hick Gunter
-Ursprüngliche Nachricht- Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im Auftrag von Fredrik Larsen Gesendet: Donnerstag, 19. September 2019 17:29 An: SQLite mailing list Betreff: Re: [sqlite] [EXTERNAL] Group-by and order-by-desc does not work as expected

Re: [sqlite] [EXTERNAL] Group-by and order-by-desc does not work as expected

2019-09-19 Thread Fredrik Larsen
Simen; ANALYZE and PRAGMA reverse_unordered_selects = YES does not affect results. Hick; ORDER BY x DESC >is< covered by index. Btree-indexes allows traversal both ways. You can see this if you remove GROUP_BY. Got an answer on StackOverflow that seems to be from somebody that knows internal

Re: [sqlite] [EXTERNAL] Group-by and order-by-desc does not work as expected

2019-09-19 Thread Hick Gunter
An ORDER BY clause will omit sorting only if the visitation order exactly fulfills the clause. A GROUP BY clause is able to avoid creating a temporary table if the visitation order exactly fulfills the clause. If a SELECT references only fields present in an index, that (covering) index may

Re: [sqlite] using lower function with utf8

2019-09-19 Thread x
Yes, I’m using v5 JcD. Thanks. From: sqlite-users on behalf of Jean-Christophe Deschamps Sent: Thursday, September 19, 2019 3:49:39 PM To: SQLite mailing list Subject: Re: [sqlite] using lower function with utf8 >I was messing about with this and tried the

Re: [sqlite] using lower function with utf8

2019-09-19 Thread Jean-Christophe Deschamps
I was messing about with this and tried the following in sqlite expert professional select unicode(lower(char(256))); I was quite surprised when it responded with the correct result 257. Looking at the sqlite3.c code I can’t see anything that suggests sqlite would handle lower() for

[sqlite] using lower function with utf8

2019-09-19 Thread x
I was messing about with this and tried the following in sqlite expert professional select unicode(lower(char(256))); I was quite surprised when it responded with the correct result 257. Looking at the sqlite3.c code I can’t see anything that suggests sqlite would handle lower() for

Re: [sqlite] Group-by and order-by-desc does not work as expected

2019-09-19 Thread Simon Slavin
On 19 Sep 2019, at 1:14pm, Fredrik Larsen wrote: > I have a aggregate query that works as expected when the ordering is > ascending, but uses a TMP B-TREE when changing order to descending, see > stackoverflow link below. For experimental purposes, you might take a backup copy of your database

Re: [sqlite] Undo sqlite3_snapshot_open?

2019-09-19 Thread Gwendal Roué
Woohoo, thanks Dan! I'm going to try this very soon :-) Gwendal On Thu, Sep 19, 2019 at 1:18 PM Dan Kennedy wrote: > > On 19/9/62 18:13, Gwendal Roué wrote: > > Hello, > > > > I am looking at the snapshot experimental APIs, and it looks like once a > > connection has been sent to an

[sqlite] Group-by and order-by-desc does not work as expected

2019-09-19 Thread Fredrik Larsen
I have a aggregate query that works as expected when the ordering is ascending, but uses a TMP B-TREE when changing order to descending, see stackoverflow link below. Is there something I'm missing? I would expect same performance when ordering both directions. Link:

Re: [sqlite] Undo sqlite3_snapshot_open?

2019-09-19 Thread Dominique Devienne
On Thu, Sep 19, 2019 at 1:13 PM Gwendal Roué wrote: > I am looking at the snapshot experimental APIs > How long do experimental APIs remain experimental? Snapshot is over 3.75 years old now. Will it ever graduate to a fully supported API? As far as I understood the doc, a snapshot remains

Re: [sqlite] Undo sqlite3_snapshot_open?

2019-09-19 Thread Dan Kennedy
On 19/9/62 18:13, Gwendal Roué wrote: Hello, I am looking at the snapshot experimental APIs, and it looks like once a connection has been sent to an "historical snapshot" with sqlite3_snapshot_open (https://www.sqlite.org/c3ref/snapshot_open.html), the connection can never be restored back to

[sqlite] Undo sqlite3_snapshot_open?

2019-09-19 Thread Gwendal Roué
Hello, I am looking at the snapshot experimental APIs, and it looks like once a connection has been sent to an "historical snapshot" with sqlite3_snapshot_open (https://www.sqlite.org/c3ref/snapshot_open.html), the connection can never be restored back to regular operations. Is it correct?

Re: [sqlite] The best way to check if a file is a sqlite3 DB file?

2019-09-19 Thread Dominique Devienne
On Thu, Sep 19, 2019 at 10:20 AM Rowan Worth wrote: > On Thu, 19 Sep 2019 at 16:03, Dominique Devienne > > On Wed, Sep 18, 2019 at 6:43 PM Clemens Ladisch > > > Peng Yu wrote: > > > > Is there a better way to just return an exit status of 0 for > > > > a sqlite3 DB file and 1 otherwise? > > >

Re: [sqlite] The best way to check if a file is a sqlite3 DB file?

2019-09-19 Thread Rowan Worth
On Thu, 19 Sep 2019 at 16:03, Dominique Devienne wrote: > On Wed, Sep 18, 2019 at 6:43 PM Clemens Ladisch > wrote: > > > Peng Yu wrote: > > > Is there a better way to just return an exit status of 0 for > > > a sqlite3 DB file and 1 otherwise? > > > > Extract the magic header string from a

Re: [sqlite] The best way to check if a file is a sqlite3 DB file?

2019-09-19 Thread Dominique Devienne
On Wed, Sep 18, 2019 at 6:43 PM Clemens Ladisch wrote: > Peng Yu wrote: > > Is there a better way to just return an exit status of 0 for > > a sqlite3 DB file and 1 otherwise? > > Extract the magic header string from a known DB file: > > dd bs=16 count=1 < some.db > sqlite3-signature > > Then