[sqlite] efficient way to figure out if a table is empty

2006-10-30 Thread Xavier Noria
Not that is critical for my application, but just for curiosity which is the recommended idiom to figure out whether a table has any register? -- fxn - To unsubscribe, send email to [EMAIL PROTECTED] -

[sqlite] Re: locked implies exception?

2006-07-25 Thread Xavier Noria
On Jul 24, 2006, at 11:47, Xavier Noria wrote: I am trying to understand a crash I get very often. There are two processes accessing to the same database in a Windows XP (through Active Record) doing simple CRUDs on tables, and from any of the two at random I get an SQLite3::BusyException

Re: [sqlite] sqlite3_prepare = SQLITE_BUSY????

2006-07-24 Thread Xavier Noria
On Jul 24, 2006, at 14:49, [EMAIL PROTECTED] wrote: Daniel van Ham Colchete <[EMAIL PROTECTED]> wrote: I was trying to understand why would a sqlite3_prepare return SQLITE_BUSY. If SQLite does not already have the database schema loaded into cache, it needs to read the schema out of the SQLI

Re: [sqlite] locked implies exception?

2006-07-24 Thread Xavier Noria
On Jul 24, 2006, at 11:47, Xavier Noria wrote: The processes use transactions, Not necessarily. Could it have to do with AR asking for metadata about the schema? Just an idea.

[sqlite] locked implies exception?

2006-07-24 Thread Xavier Noria
I am trying to understand a crash I get very often. There are two processes accessing to the same database in a Windows XP (through Active Record) doing simple CRUDs on tables, and from any of the two at random I get an SQLite3::BusyException, for example (copied by hand): SQLite3::BusyEx

Re: [sqlite] updating SQLite to implement The Third Manifesto

2006-03-11 Thread Xavier Noria
On Mar 11, 2006, at 7:58, Andrew Piskorski wrote: On Fri, Mar 10, 2006 at 04:37:36PM -0800, Darren Duncan wrote: 3. There is no such thing as a NULL. 3.1 All logic is 2VL (true, false) not 3VL (true, false, unknown). There is no such thing as null, really? So, when you do an outer join b

Re: [sqlite] Book?

2006-02-11 Thread Xavier Noria
On Feb 11, 2006, at 17:59, Clint Bailey wrote: Hi, Is there any know book in print for sqlite that is included in PHP5? I just finished "SQLite" http://www.bookpool.com/sm/067232685X and has helped me a lot, then the deltas in the web site helps to stay in sync with 3.x. I saw in Ama

Re: [sqlite] Question about Regular Expression

2006-02-10 Thread Xavier Noria
On Feb 10, 2006, at 16:51, malcom wrote: Hello, I have a sqlite column with a string. This string is composed by n different lines separated by an \n character. Each line is composed by : . So my final string is something like this: : \n : \n : Now I need to search *only* inside a particular

Re: [sqlite] Creating a (really) big table

2006-02-10 Thread Xavier Noria
On Feb 10, 2006, at 13:01, James Biggs wrote: I can do for example $dbh->do( "CREATE TABLE my_table (etc etc etc)"); but i don't know a Perl command for creating a table with many columns. I did not find one in the docs either. Thanks The idea is that you build the SQL string dynamically

Re: [sqlite] delete all tables

2006-02-09 Thread Xavier Noria
On Feb 9, 2006, at 23:02, Marian Olteanu wrote: I would say that the fastest way (CPU cycles and lines of code) to delete all tables would be to delete the file in which the database is stored. Clever!

[sqlite] delete all tables

2006-02-09 Thread Xavier Noria
In the schema definition I would like to avoid the combo delete if exists table_name; create table_name ( ... ); Can I query sqlite_master about tables, indexes, etc. in a way that allows the deletion of everything in one shot beforehand? -- fxn

Re: [sqlite] question about performance

2006-02-08 Thread Xavier Noria
On Feb 8, 2006, at 17:24, [EMAIL PROTECTED] wrote: If you do not do a BEGIN...COMMIT around your inserts, then each insert has an implied BEGIN...COMMIT around itself. That means you are doing 50 COMMITs. A COMMIT is slow because it is "Durable" (The "D" in ACID). That means that the operation

Re: [sqlite] question about performance

2006-02-08 Thread Xavier Noria
On Feb 8, 2006, at 17:10, Doug Nebeker wrote: When you don't wrap everything in a transaction, each statement becomes it's own transaction. And the database file is opened, updated, and closed on each transaction. So your first case had roughly 50 times the amount of file I/O and transacti

[sqlite] question about performance

2006-02-08 Thread Xavier Noria
I have a simple schema and a sql loader that fills a table with initial values: delete from foo; insert into foo ...; insert into foo ...; ... about 50 inserts ... To my surprise, the execution of these inserts took a few seconds (SQLite is 3.3.3). However, if I wrapped the entire lo

[sqlite] about character encodings

2006-02-06 Thread Xavier Noria
I have a couple questions regarding character encodings in SQLite 3: * Do databases or tables have an associated character encoding? If they do how is it configured? * The description for the TEXT class mentions "using the database encoding (UTF-8, UTF-16BE or UTF-16-LE)", is there support

[sqlite] OT: in-memory for testing in Rails

2005-12-23 Thread Xavier Noria
I asked this in a couple of Rails places without luck. I guess this is actually related to Rails, just ask it here in case someone knows about it. The file config/database.yml rails generates has as SQLite database for testing ":memory:", but the simplest of the tests in the Agile book do

[sqlite] advice on schema evolution

2005-12-11 Thread Xavier Noria
Say you are doing some web development with SQLite in the backend. You progressively fill the database with the very web interface you are writing, throwing that data is not desirable in general. But at the same time the schema evolves with the project, tables are added, columns are renamed