Re: [sqlite] Widen output of file field for .databases CLI command

2011-08-25 Thread Clark Christensen
Hi Keith, How about pragma database_list;  -Clark From: Keith Christian To: sqlite-users@sqlite.org Sent: Thursday, August 25, 2011 8:55 AM Subject: [sqlite] Widen output of file field for .databases CLI command Is there a parameter that will widen the "file

Re: [sqlite] When open / close database on IOS ?

2011-08-25 Thread Simon Slavin
On 25 Aug 2011, at 11:00pm, François wrote: > I just have a last question: you are telling that opening connection > at app launch and close it only at app exit (scenario A) may be less > secure than open/close database at each transaction (scenario B), on a > data integrity point of view. But yo

Re: [sqlite] When open / close database on IOS ?

2011-08-25 Thread François
OK thank you for these new explanations. I just have a last question: you are telling that opening connection at app launch and close it only at app exit (scenario A) may be less secure than open/close database at each transaction (scenario B), on a data integrity point of view. But you gave the c

Re: [sqlite] When open / close database on IOS ?

2011-08-25 Thread Simon Slavin
On 25 Aug 2011, at 9:54pm, François wrote: > On 25 août, 19:29, Simon Slavin wrote: >> When you use sqlite3_open() a database file that routine checks for many >> signs that the database wasn't closed properly -- in other >> words that an app which previously had it open crashed rather than usi

Re: [sqlite] When open / close database on IOS ?

2011-08-25 Thread François
On 25 août, 19:29, Simon Slavin wrote: > On 25 Aug 2011, at 5:19pm, François wrote: > > > 3) So SQLite correctly deals with crashes (this is amazing!) But when > > app crashes, database connection may be not closed. Could it be a > > problem? For example, preventing from re-opening or reading data

Re: [sqlite] When open / close database on IOS ?

2011-08-25 Thread Simon Slavin
On 25 Aug 2011, at 5:19pm, François wrote: > 3) So SQLite correctly deals with crashes (this is amazing!) But when > app crashes, database connection may be not closed. Could it be a > problem? For example, preventing from re-opening or reading database > later ? When you use sqlite3_open() a da

Re: [sqlite] INTEGER PRIMARY KEY and SQLITE_ENABLE_STAT2

2011-08-25 Thread GB
Simon Slavin schrieb am 25.08.2011 02:00: > Had you thought of creating an explicit index on the rowid column, then > running ANALYZE again ? > > Simon. > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailma

Re: [sqlite] When open / close database on IOS ?

2011-08-25 Thread François
Simon, Thank you for this so fast answer! 1) OK, this is exactly what I was expecting. 2) OK, you perfectly understood my question. Let me add two linked questions: 3) So SQLite correctly deals with crashes (this is amazing!) But when app crashes, database connection may be not closed. Could i

[sqlite] Widen output of file field for .databases CLI command

2011-08-25 Thread Keith Christian
Is there a parameter that will widen the "file" column when ".databases" is typed at the sqlite> prompt? Occasionally the database is several directories deep and the filename is lost or truncated if the complete path is more than 58 characters wide. If no parameter exists, could the "file" field

Re: [sqlite] When open / close database on IOS ?

2011-08-25 Thread Simon Slavin
On 25 Aug 2011, at 4:32pm, François wrote: > 1) Do you suggest to open only one connection for all database > requests in the application, and to close it when user exits from the > application (scenario A) ? Or to use one connection for each > transaction (scenario B) ? One connection for all t

[sqlite] When open / close database on IOS ?

2011-08-25 Thread François
Hello, Just two questions concerning iPhone/iPad apps: 1) Do you suggest to open only one connection for all database requests in the application, and to close it when user exits from the application (scenario A) ? Or to use one connection for each transaction (scenario B) ? 2) If scenario A, ho

Re: [sqlite] Split Function for SQLite?

2011-08-25 Thread Max Vlasov
On Thu, Aug 25, 2011 at 9:34 AM, Max Vlasov wrote: > > Also theoretically it is possible to use virtual tables for this. So > when your virtual query implementation accepts list in some way ('23, > 14, 1, 7, 9') and returns the table when querying > I tried to implement something like this and it

Re: [sqlite] INTEGER PRIMARY KEY and SQLITE_ENABLE_STAT2

2011-08-25 Thread Carlos Rocha
> > It seems equally logical to me that one of A or B might be evaluated, and if > it were false, then the other might not be evaluated. I don't think so if efficiency matters. Of course the rule could be to evaluated from right to left instead, but it's good to have just one rule, and again,

Re: [sqlite] Custom Collation comparing only firt character?

2011-08-25 Thread Simon Slavin
On 25 Aug 2011, at 6:58am, Roberto Colnaghi wrote: > int collationAnyCIAI(void *arg1, int str1Length, const void *str1, int > str2Length, const void *str2) { > NSString *strA = [NSString hexStringWithData:str1 ofLength:1]; > NSString *strB = [NSString hexStringWithData:str2 ofLength:

Re: [sqlite] Custom Collation comparing only firt character?

2011-08-25 Thread Michael Stephenson
Most likely, since you say only the first character is being compared, is that you have an ANSI/Unicode issue. Specifically, it sounds like a Unicode string is being passed to your collation function, which is expecting ANSI and then finding a 0 at the second byte is determining that that is the e

Re: [sqlite] Determining size of insert row/query before inserting

2011-08-25 Thread Stephan Beal
On Thu, Aug 25, 2011 at 2:29 PM, Simon Slavin wrote: > I think your overall best strategy here it not to run any system so close > to the margin it's likely to fail. Define some amount of free space for > your system -- for example 10Kb for an embedded system or 1Meg for a desktop > computer --

Re: [sqlite] Determining size of insert row/query before inserting

2011-08-25 Thread Simon Slavin
On 25 Aug 2011, at 10:52am, Pero Mirko wrote: > I want to determine how much disk space a certain insert will take before > actually executing it so I can fail insert before doing it rather than > trying to insert, then receive SQLite Disk I/O error when the disk is > filled. > > So I would dete

Re: [sqlite] Custom Collation comparing only firt character?

2011-08-25 Thread Igor Tandetnik
Roberto Colnaghi wrote: > It works though only the FIRST character seems to be compared instead of the > whole "Name". > Is there anything missing here? > > int collationAnyCIAI(void *arg1, int str1Length, const void *str1, int > str2Length, const void *str2) { > NSString *strA = [NSString hexS

Re: [sqlite] SQL-Beginner question about filtering

2011-08-25 Thread Igor Tandetnik
Scholz Maik (CM-AI/PJ-CF42) wrote: > I am little bit confused about filtering SQL query's. > > My table: > ROWID V A B > === > 1 0 0 1 > 2 0 0 2 > 3 0 1 1 > 4 0 1 2 > 5 1 0 2 >

Re: [sqlite] System.Data.SQLite.xml -- documentation for the wrongassembly

2011-08-25 Thread Joe Mistachkin
Jonas Bähr wrote: > > The zip archives with the precompiled binaries for version 1.0.74.0 > include a file System.Data.SQLite.xml, which is supposed to hold the xml > documentation for the System.Data.SQLite.dll. However, this file > contains the code documentation of the "testlinq" assembly whil

[sqlite] SQL-Beginner question about filtering

2011-08-25 Thread Scholz Maik (CM-AI/PJ-CF42)
Hi, I am little bit confused about filtering SQL query's. My table: ROWID V A B === 1 0 0 1 2 0 0 2 3 0 1 1 4 0 1 2 5 1 0 2 6 2 0 2 With my SQL knowledge I am

[sqlite] Custom Collation comparing only firt character?

2011-08-25 Thread Roberto Colnaghi
Hi, I'm using iOS SQLite with a custom collation. I've registered it: sqlite3_create_collation(sqlDatabase, "anyCIAI", SQLITE_UTF16, nil, collatio

Re: [sqlite] INTEGER PRIMARY KEY and SQLITE_ENABLE_STAT2

2011-08-25 Thread Alex Bowden
logical? It seems equally logical to me that one of A or B might be evaluated, and if it were false, then the other might not be evaluated. And it would be logical to choose which of A or B to evaluated on a predicted cost and probability of an advantageous false result. but hay. Who said th

[sqlite] System.Data.SQLite.xml -- documentation for the wrong assembly

2011-08-25 Thread Jonas Bähr
Hi, The zip archives with the precompiled binaries for version 1.0.74.0 include a file System.Data.SQLite.xml, which is supposed to hold the xml documentation for the System.Data.SQLite.dll. However, this file contains the code documentation of the "testlinq" assembly while the actual documentatio

[sqlite] Determining size of insert row/query before inserting

2011-08-25 Thread Pero Mirko
How would you recommend to approach this problem: I want to determine how much disk space a certain insert will take before actually executing it so I can fail insert before doing it rather than trying to insert, then receive SQLite Disk I/O error when the disk is filled. So I would determine fir