Re: [sqlite] Upon table creation, multiple CHECK constraints do not work with FTS3

2010-08-30 Thread Dan Kennedy
On Aug 30, 2010, at 12:22 PM, Benoit Mortgat wrote: Hello, The following table creation fails under latest release : CREATE VIRTUAL TABLE foo USING FTS3 ( bar TEXT, othercolumns TEXT, CHECK(1), CHECK(1) ); Error message: vtable constructor failed Maybe it thinks the two CHECK(1)

Re: [sqlite] Upon table creation, multiple CHECK constraints do not work with FTS3

2010-08-30 Thread Benoit Mortgat
The 1 expression was here only for simplification, but it also fails to run the statement whatever expressions are specified. Thank you for your answer. I now am aware that checks must be done by the upper-level application. Benoit On Mon, Aug 30, 2010 at 08:19, Dan Kennedy

[sqlite] Sqlite on NAND flash devices...

2010-08-30 Thread Pankaj Chawla
Hi I have a Sqlite db on an embedded device on which there are inserts happening at a rate of 1 insert every 3 seconds. That being the case if Sqlite does file close/sync every 3 seconds it is going to wear off the NAND in no time. I tried to instead put 2 mins worth of inserts inside a

Re: [sqlite] Sqlite on NAND flash devices...

2010-08-30 Thread Black, Michael (IS)
Can you keep your database in-memory and just copy it to your flash periodically? That would give you the most control and minimize the # of writes as much as you want. It's good you recognize that you'll burn your flash out quickly with what you're doing now. There's also the

Re: [sqlite] Is there a design doc for the virtual machine re-write?

2010-08-30 Thread Max Vlasov
That is *EXACTLY* what I'm reffering to. Is there any design info, rationale or pointers to what changes were made, and why the switch from a stack to register machine?? Also, is there any performance data? There's a video where D. Richard Hipp talks about sqlite (interesting in many other

Re: [sqlite] Sqlite on NAND flash devices...

2010-08-30 Thread Richard Hipp
Use WAL mode. Set PRAGMA synchronous=NORMAL. Do transactions that last 2 minutes each, starting a new transaction after each COMMIT. Run checkpoints in a background thread. On Mon, Aug 30, 2010 at 6:29 AM, Pankaj Chawla pankaj...@gmail.com wrote: Hi I have a Sqlite db on an embedded device

Re: [sqlite] Sqlite on NAND flash devices...

2010-08-30 Thread Pankaj Chawla
HI Michael, Thanks for the reply. Wont keeping things in memory lead to chances of db getting corrupt especially in cases of power failure or device reboots. I am not sure but since Sqlite is now used so frequently in embedded devices and most devices use flash memories how are these situations

Re: [sqlite] Sqlite on NAND flash devices...

2010-08-30 Thread Black, Michael (IS)
WAL mode still writes the journal to disk. Perhaps combining this with SQLITE_TEMP_STORE=3 would be the best of all worlds? Then his current situation of writing a 2-minute transaction should work just fine and minimize the # of writes. Michael D. Black Senior Scientist Advanced

Re: [sqlite] Sqlite on NAND flash devices...

2010-08-30 Thread Black, Michael (IS)
Well...yeh...but you were complaining about the logs being written to your flash...you gotta' pick your poison. If you keep only the temporary files in memory you should be OK. That's what the compilation flag is for. Keeping your entire database in memory is probably on an option if it's

[sqlite] Question for any python+sqlite3 users.

2010-08-30 Thread Denis Gomes
Hi Everyone, I am using sqlite3 with python2.5 and the pysqlite wrapper. I am trying to copy tables from one database (in memory) to another database (file) using ATTACH. I looked on the internet and found a couple of sites that show how to do this but the table schema is not copied. def

[sqlite] next value in sequence

2010-08-30 Thread Scott Frankel
Hi all, How does one find the next value of a serial item? Given a simple table with a serial primary key, I'd like to get the next available integer key value. eg: CREATE TABLE foo ( foo_id SERIAL PRIMARY KEY, nametext