Re: [sqlite] [EXTERNAL] Preupdate hook column name

2018-04-13 Thread João Ramos
nglists.sqlite.org] > Im Auftrag von João Ramos > Gesendet: Donnerstag, 12. April 2018 20:54 > An: SQLite mailing list <sqlite-users@mailinglists.sqlite.org> > Betreff: [EXTERNAL] [sqlite] Preupdate hook column name > > Hi, > > I've successfully added support for the sq

[sqlite] Preupdate hook column name

2018-04-12 Thread João Ramos
need the name of the column and I can't find a way to do this. Is this even possible? Thank you, -- *João Ramos* ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] Possible bug in the SQL parser

2016-03-21 Thread João Ramos
Sorry for the late reply. That output (--1 etc.) was me manually "formatting" the results. I came across this issue using SQLiteStudio v3.0.7 on Windows. I just create a new DB and run that script: it outputs two rows, with one column each, with the values 1 and 2 respectively, instead of an

[sqlite] Possible bug in the SQL parser

2016-02-29 Thread João Ramos
Maybe this has been fixed then? This is what I'm getting: select sqlite_version(); -- 3.8.10 select sqlite_source_id(); -- 2015-05-04 19:13:25 850c11866686a7b39d7b163fb60898c11283688e WITH tA(id, name) AS ( SELECT 1, "a" UNION ALL SELECT 2, "b" ), tB(name) AS ( SELECT "a" UNION ALL

[sqlite] Possible bug in the SQL parser

2016-02-26 Thread João Ramos
I'm using SQLite 3.8.10.2 and the following query illustrates the problem: WITH tA(id, name) AS ( SELECT 1, "a" UNION ALL SELECT 2, "b" ), tB(name) AS ( SELECT "a" UNION ALL SELECT "b" ) SELECT tB.id FROM tA INNER JOIN tB ON (tA.name = tB.name); There is no _id_ column in the tB table,

Re: [sqlite] Best approach for "notifications"

2014-07-14 Thread João Ramos
On Mon, Jul 14, 2014 at 3:57 PM, Simon Slavin wrote: > > The update hook function is an ideal way to do what you're doing. There > is also a pre-update hook: > > > > If you cannot use these, then my instinct is to

[sqlite] Best approach for "notifications"

2014-07-14 Thread João Ramos
question is: is this the best approach? This method works but is also a bit complex and I wasn't able to come up with something simpler (for example I know we cannot use sqlite3_update_hook to retrieve data). Thanks, João Ramos ___ sqlite-users mailing

Re: [sqlite] Planner chooses incorrect index

2014-07-09 Thread João Ramos
When I can I'll try with the latest release. Thanks for all your help. On Tue, Jul 8, 2014 at 4:05 PM, Dan Kennedy <danielk1...@gmail.com> wrote: > On 06/25/2014 04:44 PM, João Ramos wrote: > >> The sample column has some sensitive data that I can't share, so I'll

Re: [sqlite] Data visibility problem

2014-06-26 Thread João Ramos
OK, thank you all for your support. On Thu, Jun 26, 2014 at 3:22 AM, Igor Tandetnik <i...@tandetnik.org> wrote: > On 6/25/2014 8:48 PM, João Ramos wrote: > >> Now that you mentioned the WAL, shouldn't this actually help prevent this >> scenario? >> > > Q

Re: [sqlite] Data visibility problem

2014-06-25 Thread João Ramos
On Wed, Jun 25, 2014 at 8:04 PM, Sohail Somani <soh...@taggedtype.net> wrote: > On 22/06/2014 6:33 PM, João Ramos wrote: > >> The issue appeared with the following scenario: - using SQLite v3.8.4.3 - >> the DB is in WAL mode and running with multi-thread mode - every thre

Re: [sqlite] Data visibility problem

2014-06-25 Thread João Ramos
On Wed, Jun 25, 2014 at 2:19 PM, Igor Tandetnik <i...@tandetnik.org> wrote: > On 6/25/2014 5:19 AM, João Ramos wrote: > >> And I understand the limitations a shared-cache mode may have, but if this >> is to be the case, it should be documented. I can be wrong, but I

Re: [sqlite] Planner chooses incorrect index

2014-06-25 Thread João Ramos
014 05:48 AM, João Ramos wrote: > >> Here you go: >> >> sqlite_stat1 (before - good planning) >> HistoryEntry idx_HistoryEntry_uri_historyOrder 14992 44 5 >> HistoryEntry idx_HistoryEntry_historyOrder_historyTimestamp 14992 6 2 >> HistoryEntry i

Re: [sqlite] Data visibility problem

2014-06-25 Thread João Ramos
On Mon, Jun 23, 2014 at 3:31 PM, Simon Slavin <slav...@bigfraud.org> wrote: > > On 23 Jun 2014, at 11:17am, João Ramos <joao.si...@gmail.com> wrote: > > > On Mon, Jun 23, 2014 at 10:58 AM, Simon Slavin <slav...@bigfraud.org> > wrote: > > > >>

Re: [sqlite] Data visibility problem

2014-06-25 Thread João Ramos
On Mon, Jun 23, 2014 at 3:03 PM, Igor Tandetnik <i...@tandetnik.org> wrote: > On 6/23/2014 5:43 AM, João Ramos wrote: > >> If multiple connections in shared cache mode are treated as a single >> "real" >> connection, should I change the thread mode to Ser

Re: [sqlite] Planner chooses incorrect index

2014-06-23 Thread João Ramos
idx_HistoryEntry_sourceType_sourceId 24 1 1 15468 15478 15478 4 15415 15478 On Sun, Jun 22, 2014 at 9:46 PM, Richard Hipp <d...@sqlite.org> wrote: > On Sun, Jun 22, 2014 at 2:05 PM, João Ramos <joao.si...@gmail.com> wrote: > > > > > Everything looks fine and the query runs

Re: [sqlite] Data visibility problem

2014-06-23 Thread João Ramos
On Mon, Jun 23, 2014 at 10:58 AM, Simon Slavin <slav...@bigfraud.org> wrote: > > On 22 Jun 2014, at 11:33pm, João Ramos <joao.si...@gmail.com> wrote: > > > What happens is this: - a thread acquires the write DB connection - that > > thread inserts a n

Re: [sqlite] Data visibility problem

2014-06-23 Thread João Ramos
; wrote: > On 6/22/2014 6:33 PM, João Ramos wrote: > >> What happens is this: - a thread acquires the write DB connection - that >> thread inserts a new row in a table and gets its id - the thread releases >> the write DB connection (so that other threads can use it) -

[sqlite] Data visibility problem

2014-06-22 Thread João Ramos
Hi, The issue appeared with the following scenario: - using SQLite v3.8.4.3 - the DB is in WAL mode and running with multi-thread mode - every thread has a read-only DB connection (using thread-local-storage) - a single DB connection is shared between threads to write - this write DB

[sqlite] Planner chooses incorrect index

2014-06-22 Thread João Ramos
Hi, I'm using SQLite v3.8.4.3 and the issue happens in a table with the following schema: CREATE TABLE HistoryEntry ( id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, sourceType INTEGER NOT NULL, sourceId INTEGER, uri TEXT NOT NULL, historyOrder BIGINT NOT NULL CHECK (historyOrder >= 0) DEFAULT