Re: [sqlite] Only allow child record if another field in parent is false.

2014-07-31 Thread James K. Lowden
On Fri, 1 Aug 2014 09:26:14 +1200 Richard Warburton wrote: > This way, you can't change the leaver field if enrolmentItems are > attached, and you can't add an enrolmentItem if leaver is set to 1. IIUC, you have tables A and B, and the rules are you can add/delete rows in B while A.bo

Re: [sqlite] Only allow child record if another field in parent is false.

2014-07-31 Thread Simon Slavin
On 31 Jul 2014, at 10:26pm, Richard Warburton wrote: > I'm looking for an elegant way to prevent enrolments having enrolmentItems > if leaver is set to 1. > [...] > Ideally, I'd like a check in enrolmentItem that can examine a different > field in the referenced enrolment record. TRIGGERs are

[sqlite] Only allow child record if another field in parent is false.

2014-07-31 Thread Richard Warburton
Hi, Consider: CREATE TABLE enrolment ( id INTEGER PRIMARY KEY, child INT NOT NULL REFERENCES child (id), start INT NOT NULL, leaver INT NOT NULL DEFAULT 0 CHECK (leaver BETWEEN 0 AND 1), -- BOOL ); CREATE TABLE enrolmentItem ( id INTEGER PRIMARY KEY, enrolment INT NOT NULL

Re: [sqlite] Misleading example of INSTEAD OF trigger

2014-07-31 Thread Richard Hipp
On Thu, Jul 31, 2014 at 2:42 PM, Christian Höhne wrote: > The CREATE TRIGGER example shown in the INSTEAD OF page ( > http://www.sqlite.org/lang_createtrigger.html#instead_of_trigger) is > misleading because it does not show the correct use of the INSTEAD OF > clause in the trigger statement, it

[sqlite] Misleading example of INSTEAD OF trigger

2014-07-31 Thread Christian Höhne
The CREATE TRIGGER example shown in the INSTEAD OF page ( http://www.sqlite.org/lang_createtrigger.html#instead_of_trigger) is misleading because it does not show the correct use of the INSTEAD OF clause in the trigger statement, it actually misses this clause altogether: Examples Assuming that c

Re: [sqlite] Long execution time since sqlite 3.8

2014-07-31 Thread Richard Hipp
I can't find any difference in the query plans for 3.7.17 and 3.8.5. Can you send me the database file (as an attachment to a private email) so that I can run experiments on the original content? On Thu, Jul 31, 2014 at 10:06 AM, Michael wrote: > I also tried to remove the views of some querie

Re: [sqlite] Long execution time since sqlite 3.8

2014-07-31 Thread Richard Hipp
I have attempted to reformat your query to make it more readable. Did I translate it correctly? CREATE TABLE infos( idINTEGER PRIMARY KEY, name TEXT, text TEXT, zone INTEGER DEFAULT 3, dateAdded DATATIME, lastModified DATETIME, votes

Re: [sqlite] Long execution time since sqlite 3.8

2014-07-31 Thread Michael
I also tried to remove the views of some queries and create index. But nothing worked so far. Anyway it couldn't be the reason for the "parser stack overflow" of my other question. Is the information I sent sufficient? *Gesendet:* Dienstag, 29. Juli 2014 um 15:17 Uhr *Von:* Michael *An:* sqlite-u

Re: [sqlite] Logging and timing queries

2014-07-31 Thread Simon Slavin
On 31 Jul 2014, at 1:41pm, Ketil Froyn wrote: > I find it would be > very useful to log some or all queries sent to the database, ideally also > with timing information on how long it took to gather and send the > response, so that it can be determined what queries are received and how > long ea

Re: [sqlite] Logging and timing queries

2014-07-31 Thread Dominique Pellé
Ketil Froyn wrote: > Hi, > > In debugging and inspecting applications using sqlite, I find it would be > very useful to log some or all queries sent to the database, ideally also > with timing information on how long it took to gather and send the > response, so that it can be determined what que

Re: [sqlite] Sqlite querie delete bug

2014-07-31 Thread Rob Richardson
This doesn't sound like an SQLite problem to me. Instead it sounds like a problem with whatever visualization tool you are using. What tool are you using? If you can find a user's group for that tool, you may get more helpful answers there. RobR -Original Message- From: sqlite-users

[sqlite] Logging and timing queries

2014-07-31 Thread Ketil Froyn
Hi, In debugging and inspecting applications using sqlite, I find it would be very useful to log some or all queries sent to the database, ideally also with timing information on how long it took to gather and send the response, so that it can be determined what queries are received and how long e

Re: [sqlite] Sqlite querie delete bug

2014-07-31 Thread Richard Hipp
On Wed, Jul 30, 2014 at 8:53 AM, Oto _ wrote: > There is an issue that if entry is selected in Table view then editing in > Query view and clicking delete key then it doesn't delete query but asks to > delete database entry which is not expected behavior. > It sounds as if you are describing a p

[sqlite] Sqlite querie delete bug

2014-07-31 Thread Oto _
There is an issue that if entry is selected in Table view then editing in Query view and clicking delete key then it doesn't delete query but asks to delete database entry which is not expected behavior. ___ sqlite-users mailing list sqlite-users@sqlite.o

Re: [sqlite] Handling Timezones

2014-07-31 Thread Rob Willett
The problem with doing this is that many IPs addresses are exit IP addreses, I.e the ISP or company brings things into their own network and only has a few exit nodes, so regardless of where you connect from, everybody comes out of one time zone. I know AOL used to do this and I know that IBM do

Re: [sqlite] Handling Timezones

2014-07-31 Thread Donald Shepherd
Speaking as someone who's work routes their internet traffic through a gateway in Phoenix, AZ despite being based in Australia, guessing time zones based off IP location is a lot more prone to error than detecting it based off the client. On 31 July 2014 17:54, Stephen Chrzanowski wrote: > Look

Re: [sqlite] Handling Timezones

2014-07-31 Thread Stephen Chrzanowski
Looking back at the clarification of what the OP wanted to do, I've got this to recommend; If your users are talking to your server via the internet and not via a VPN connection, instead of relying on what time zone your users browser is giving you, look at what IP they're calling in from and do a