[sqlite] synchronous=OFF on multithreads

2007-08-21 Thread Daniel Önnerby
Hi all! I have a multithreaded application where every thread (almost) has it's own sqlite connection to the same database. The database is only accessed by this application and the application always run on the same computer as the database. My question: Is it "safe" to set "PRAGMA

Re: [sqlite] Towards SQLite version 3.5.0

2007-08-29 Thread Daniel Önnerby
Hi! The new multithread-features will be great. Do you think that it will be better to share one connection between all theads in an application or is better to have each thread open a new connection and use the sqlite3_enable_shared_cache? Best regards Daniel [EMAIL PROTECTED] wrote: The

Re: [sqlite] Towards SQLite version 3.5.0

2007-08-30 Thread Daniel Önnerby
Klemens Friedl wrote: 2007/8/29, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: I think you will be much much better off to put every thread it is own private address space. In other words, turn each thread into a separate process. Threads are an invention of the devil. Stay as far away from

[sqlite] 3.5.0 alpha TryEnterCriticalSection linker error

2007-09-04 Thread Daniel Önnerby
Hi all! Tried upgrading to the 3.5.0 alpha from 3.4.2 using VS 2005 on XP. I downloaded the ZIP with preprocessed C code. Compiling SQLite to a .lib was no problem, but when linking it to an .exe I got the following: sqlite.lib(mutex_w32.obj) : error LNK2019: unresolved external symbol

Re: [sqlite] 3.5.0 alpha TryEnterCriticalSection linker error

2007-09-05 Thread Daniel Önnerby
[EMAIL PROTECTED] wrote: - Original Message From: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> To: sqlite-users@sqlite.org Sent: Tuesday, September 4, 2007 3:32:38 PM Subject: Re: [sqlite] 3.5.0 alpha TryEnterCriticalSection linker error =?ISO-8859-1?Q?Daniel_=D6nnerby?= <[EMAIL

Re: [sqlite] C/C++ API

2007-09-05 Thread Daniel Önnerby
This code is totaly untested. But something like this: std::string sUsername; sqlite3 *db; if( sqlite3_open("db/users.db",) ){ // prepare the statement sqlite3_stmt *oStmt; if( sqlite3_prepare_v2(db,"SELECT username FROM users WHERE

Re: [sqlite] Re: Re: C/C++ API

2007-09-05 Thread Daniel Önnerby
Your SQL-strings seem a little strange. You are trying to select from a table named as the content of nick, this would assume that you have a table for each "nick" witch seems unlikely. How is your database modeled? Severin Müller wrote: Hey Sorry for my unclearness. I want to access

[sqlite] what extension do you recommend

2007-10-23 Thread Daniel Önnerby
Hi all! I have developed a small windows application that use a SQLite database as it's main format. The file is NOT a kind of document, it's more of a settings-file stored in the users "Application data"-directory and the extension will not be associated with the application. I know I can

Re: AW: [sqlite] INSERT OR IGNORE and sqlite3_last_insert_rowid()

2007-10-30 Thread Daniel Önnerby
Why are you using the INSERT OR IGNORE? If you read the http://www.sqlite.org/lang_conflict.html it states that the IGNORE will not return any errors. Isn't the default behavior INSERT OR ABORT (or just plain INSERT) what you are looking for? The default INSERT will return an error

Re: [sqlite] INSERT OR IGNORE and sqlite3_last_insert_rowid()

2007-10-30 Thread Daniel Önnerby
t- Von: Daniel Önnerby [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 30. Oktober 2007 12:03 An: sqlite-users@sqlite.org Betreff: Re: AW: [sqlite] INSERT OR IGNORE and sqlite3_last_insert_rowid() Why are you using the INSERT OR IGNORE? If you read the http://www.sqlite.org/lang_conflict.html

Re: [sqlite] Converting date from d/m/yy format

2007-11-02 Thread Daniel Önnerby
Sorry for this off topic comment: John, about the dates, could you please fix your system clock, your emails all appear at the top when sorting by date ;) Again, sorry for the off topic. Hope I'm not intruding :) Best regards Daniel John Stanton wrote: Our business for many years was

Re: [sqlite] Request for help with the SQLite Website

2007-11-14 Thread Daniel Önnerby
I have to agree about the amount of text on the front page. What happened to the download-page, I only see the "Direct Access To The Sources Via Anonymous CVS"? Samuel R. Neff wrote: Limiting the width is good, but the pixel-based limit can cause variations on different resolutions and font

Re: [sqlite] Request for help with the SQLite Website

2007-11-15 Thread Daniel Önnerby
I guess letting developers having opinions about the website is like to many chefs making a soup. Everyone have different opinions. I like the new design but have a small comment about the rounded corners in the menu. If there are rounded corners in the menu - the content below the menu

Re: [sqlite] String manipulation with pure sqlite3?

2007-11-20 Thread Daniel Önnerby
This should be a simple task for any programming language to do once the results has been retrieved. With the current expressions in SQLite I believe there is no way to do this unless you extend SQLite with your own "string_find_last" or "replace_last" function. Alexander Skwar wrote: Hello.

[sqlite] benchmarking UTF8 vs UTF16 encoded databases

2007-11-22 Thread Daniel Önnerby
When I started using SQLite I found it natural to use the sqlite3_open16 and use UTF16 encoding on strings since my applications always use wchar_t when handeling strings. I never questioned this until now when I decided to do some benchmark, and I found it interesting enough to share with

Re: [sqlite] Unicode support for Sqlite?

2007-12-12 Thread Daniel Önnerby
utf-8 and utf-16 ARE unicode formats. But there are some things that sqlite does not handle without the ICU extension. The ICU extension extends SQLite with the following functionallity: 1.1 SQL Scalars upper() and lower() 1.2 Unicode Aware LIKE Operator 1.3 ICU Collation

Re: [sqlite] Default Encoding In Sqlite

2007-12-15 Thread Daniel Önnerby
Unicode questions seems to come up at least once a week on the mailinglist. Maybe there should be something about this in the FAQ or the features page? Trevor Talbot wrote: I wrote: The default storage encoding on disk is UTF-8, but it can be changed to UTF-16 with a PRAGMA. As

Re: [sqlite] Default Encoding In Sqlite

2007-12-15 Thread Daniel Önnerby
I figure I'll keep it short since it's only for the FAQ. English is my primary language, but here my suggestion: Question: Does SQLite handle unicode? Short answer: Yes! Answer: SQLite handles unicode very well. SQLite stores texts in either UTF-16 or UTF-8 format depending on how the

Re: [sqlite] Default Encoding In Sqlite

2007-12-16 Thread Daniel Önnerby
Sorry.. meant English is NOT my primary language :) Daniel Önnerby wrote: I figure I'll keep it short since it's only for the FAQ. English is my primary language, but here my suggestion: Question: Does SQLite handle unicode? Short answer: Yes! Answer: SQLite handles unicode very well. SQLite

Re: [sqlite] For Better Performance

2008-01-08 Thread Daniel Önnerby
Please read the following pages: http://www.sqlite.org/cvstrac/wiki?p=PerformanceTuning http://www.sqlite.org/cvstrac/wiki?p=PerformanceTuningWindows Sreedhar.a wrote: Hi, I am using sqlite for meta data storage of audio files. I am storing the sqlite database in hard disk. The sector size

Re: [sqlite] Using sqlite3 from multiple threads

2008-01-09 Thread Daniel Önnerby
[EMAIL PROTECTED] wrote: I see this idea expressed often, Andreas. Please help me to understand how I can improve the SQLite website or documentation to make it clear that SQLite does *not* need to be "installed"? I think the sqlite.org make this very clear, but people just can't believe

[sqlite] C precompiler to bytecode

2006-08-08 Thread Daniel Önnerby
needs to be smaller): The executable does not need to contain the part of sqlite that interprets the SQL-statements since this was made at compile time. Just a thought :) Best regards Daniel Önnerby

Re: [sqlite] ip2long

2006-12-08 Thread Daniel Önnerby
I havn't followed the whole thread, but from what I understand you store the data as numbers and not IP-strings. The most common way of checking a range is to use a IP-mask, and this should work fine in this case as well. Something like: SELECT * FROM myiptable WHERE (ip & "maskvalue") ==

Re: [sqlite] is blob compression worth it

2006-12-08 Thread Daniel Önnerby
Just out of curiosity. If I for instants have 1000 rows in a table with a lot of blobs and a lot of them have the same data in them, is there any way to make a plugin to sqlite that in this case would just save a reference to another blob if it's identical. I guess this could save a lot of

Re: [sqlite] is blob compression worth it

2006-12-08 Thread Daniel Önnerby
this type of functionality implemented in SQLite Best regards Daniel John Stanton wrote: Your solution here is to normalize your database. Third normal form will do it for you. Daniel Önnerby wrote: Just out of curiosity. If I for instants have 1000 rows in a table with a lot of blobs and a lot of

[sqlite] multiuser DB on network share

2007-01-09 Thread Daniel Önnerby
Hi all! At the company I work we have a windows application that use sqlite for the document format and this works great. We are now thinking about if it would be possible to have multiple users to access the db simultaneously from different computers (like a enterprise edition :) ). I have

Re: [sqlite] multiuser DB on network share

2007-01-09 Thread Daniel Önnerby
if you are using the SMB networking? Daniel Önnerby wrote: Well.. I do not mean that I will use the socketserver to run queries against it. What I mean is that the database is opened by the applications from a windows share. The socketserver is only used to ask permission to write to the database

Re: [sqlite] multiuser DB on network share

2007-01-10 Thread Daniel Önnerby
) if you're interested in understanding what it's doing. I was reading it the other day and thought it might be the key to making it work correctly if you could turn oplocks off in windows. On 1/9/07, Daniel Önnerby <[EMAIL PROTECTED]> wrote: I thought I read somewhere in th

Re: [sqlite] SQLite in Adobe Lightroom

2007-02-22 Thread Daniel Önnerby
This is great! I can imagine that there will be several opensource galleries taking advantage of this in the future. [EMAIL PROTECTED] wrote: "Jeff Godfrey" <[EMAIL PROTECTED]> wrote: Though it's only a matter of curiosity, I wonder if anyone here knows how/where Adobe employed SQLite in

[sqlite] Why no sqlite3_exec16?

2007-03-01 Thread Daniel Önnerby
Why isn't there a sqlite3_exec16 function? I've seem this question before, but haven't found any answer. Best regards Daniel - To unsubscribe, send email to [EMAIL PROTECTED]

Re: [sqlite] Fastest way of UPDATE'ing

2007-03-08 Thread Daniel Önnerby
If you attach both databases I guess you can use the replace-command since the uniqueID exists in both databases. REPLACE INTO server.table SELECT * FROM client.table; It would also be helpful to keep a local track of what ID has not been updated on the server yet, so you do not need to

Re: [sqlite] Saving binary files

2007-03-18 Thread Daniel Önnerby
The questions about saving files in a database is a reoccurring subject of this mailing list. How about adding a feature request for something like a sqlite3_bind_file() to load a file into a statement and maybe a sqlite3_column_savefile(). I guess this could solve some things like not loading

Re: [sqlite] Saving binary files

2007-03-18 Thread Daniel Önnerby
I agree! My statement was meant "in general", hence my proposal of the sqlite3_bind_file-functions that I think would be a nice feature in SQLite. Dimitris Servis wrote: Hello Daniel, Personally I think that files should be save like files on the filesystem. Personally I think that each

[sqlite] 3.5.8 alot slower than 3.5.7

2008-04-25 Thread Daniel Önnerby
Hi all! I have a db looking like this: http://onnerby.se/~daniel/mc2db.png and in my tracks table I have a column named sort_order1. When my application is running I try to optimize the database by doing a pretty massive SELECT to set this sort_order looking like this: SELECT t.id FROM tracks t

Re: [sqlite] 3.5.8 alot slower than 3.5.7

2008-04-25 Thread Daniel Önnerby
Thank you! This helped. didn't find this before. Best regards Daniel Eric Minbiole wrote: >> This works great but when I upgraded from 3.5.7 to 3.5.8 the speed of >> this select went from 0.2s to around 1 minute. And 3.5.8 is stealing >> ALOT more memory. >> > > D. Richard Hipp had a very

[sqlite] interrupting sqlite3_prepare_v2

2008-05-16 Thread Daniel Önnerby
Hi all! My application is running all my SQLite stuff on one thread and sometimes I run a sqlite3_interrupt from another thread to cancel the current execution. Sometimes this interrupt occur in the middle of a sqlite3_prepare_v2 and in some cases this will cause my application to break in

Re: [sqlite] interrupting sqlite3_prepare_v2

2008-05-16 Thread Daniel Önnerby
Forgot to say that I'm using SQLite 3.5.9 compiled from the amalgamation with threadsafety on. Daniel Önnerby wrote: > Hi all! > > My application is running all my SQLite stuff on one thread and > sometimes I run a sqlite3_interrupt from another thread to cancel the > cu

Re: [sqlite] interrupting sqlite3_prepare_v2

2008-06-02 Thread Daniel Önnerby
I have investigated futher and noticed that it will break when preparing statements like creating tables from a select. I filed a bugreport with example code at: http://www.sqlite.org/cvstrac/tktview?tn=3155 Dennis Cote wrote: > Daniel Önnerby wrote: > >> Sometimes this int

[sqlite] busy_timeout and shared_cache

2008-07-20 Thread Daniel Önnerby
Hi all! I usually set the sqlite3_busy_timeout to 10 seconds or something like that to make sure that my db isn't locked by any other connection at the same time. This way I usually do not need to check for SQLITE_BUSY. Now I just tried out the sqlite3_enable_shared_cache and has enabled

Re: [sqlite] concurrent users?

2008-10-07 Thread Daniel Önnerby
I'm using SQLite in a commercial application where the db is used as a document, often located at a network share (windows only). The db is used as a multiuser document where many users can connect and read/write to the db simultaneously, and it's working perfect. Although, mostly the users will

Re: [sqlite] Adding index to table makes SELECT much slower. Why?

2008-10-09 Thread Daniel Önnerby
Have you tried running VACUUM and ANAYZE on the indexed table? Not that I think it will matter, but who knows :) Daniel James Pringle wrote: > Hi- > > I am new to sqlite, and am having a puzzling problem. I have read > that adding an INDEX to a sqlite table can never make a SELECT >