Re: [sqlite] sluggish operation on os x?
Very much so. And even to make it a runtime-changeable pragma. (Because, otherwise things like fink packages would have a difficult decision to make. only the application really knows, whether syncing is absolutely required, and to which degree. If the fink author needs to make the choice, I'd opt for regular 'fsync()', too (who plugs out their OS X anyway.. ;) 21.2.2005 kello 21:00, Curtis King kirjoitti: My application does this and the performance was still very poor on OS X with F_FULLSYNC on. Since OS X is the only OS which has F_FULLFSYNC it would be nice to make the use of it a configure option. ck
[sqlite] sluggish operation on os x?
Finally getting my SQLite3 code working, I'm experiencing awfully slow performance when writing individual data on OS X. Linux (Ubuntu) is lightning fast, Win32 is.. tolerable, but OS X really crawls. I've tried both with built-in sources, and the new SQLite3 fink module. Same behaviour. Is there something I should be aware of concerning this (is the OS X port somehow special?) or might it just be a 'bug' in the implementation? For a sample, writing 100 integers takes 30+ seconds! Here's the code I'm using, as you see, it's not only about writing the data, I also need to remove any possible 'subtables' (not going into details here?) that might be on the way. Therefore, any write is a transaction such as: "BEGIN;" "DELETE FROM '%q' WHERE key LIKE ?1;" -- ?1 = "key.%" "INSERT OR REPLACE INTO '%q' (key,val) VALUES( ?1, ?2 );" -- ?1=key (str), ?2=val (int) "COMMIT;" I do precompile the SQL in advance, that is not causing the delay. Any ideas?? -ak :)
Re: [sqlite] Basic insert statement - syntax problem
Still, shouldn't the 'mri_output' (table name) be quoted? 17.2.2005 kello 11:45, Anirban Sarkar kirjoitti: I am really very sorry. I mistyped the entire sql statement. This is what my actual code looks like: sqlite db1 "cesc_simputer.db" #Inserting data into mri_output table set connection_no { } set insert_normal "insert into mri_output (pwd,ac_my,con_no) values ('$pass','$ac_mth$ac_yr','$sel_con')" db1 eval insert_normal {} { } Please note that the problem is with the syntax of the sql statement. Regards, Anirban Sarkar - Original Message - From: "Asko Kauppi" <[EMAIL PROTECTED]> To: <sqlite-users@sqlite.org> Sent: Thursday, February 17, 2005 2:46 PM Subject: Re: [sqlite] Basic insert statement - syntax problem The error messages provided by SQLite seem to be very helpful, can you use them? like: if (rc) glua_errorN( "sqlite3 error %d: %s", rc, sqlite3_errmsg(db) ); Aside that, shouldn't the table name (mri) have quotes ('mri')? What's the $con_no doing without quotes as well. Use ?1 for binding stuff if that's what you need. -ak 17.2.2005 kello 11:04, Anirban Sarkar kirjoitti: Hi all, I am having syntax problem with a basic sqlite insert statement. I know it's very simple but just could'nt make out where I am going wrong. set insert_details "insert into mri (pwd,con_no) values ('$pwd',$con_no)" Where am I going wrong? Thanks and regards, Anirban Sarkar
Re: [sqlite] Basic insert statement - syntax problem
The error messages provided by SQLite seem to be very helpful, can you use them? like: if (rc) glua_errorN( "sqlite3 error %d: %s", rc, sqlite3_errmsg(db) ); Aside that, shouldn't the table name (mri) have quotes ('mri')? What's the $con_no doing without quotes as well. Use ?1 for binding stuff if that's what you need. -ak 17.2.2005 kello 11:04, Anirban Sarkar kirjoitti: Hi all, I am having syntax problem with a basic sqlite insert statement. I know it's very simple but just could'nt make out where I am going wrong. set insert_details "insert into mri (pwd,con_no) values ('$pwd',$con_no)" Where am I going wrong? Thanks and regards, Anirban Sarkar
Re: [sqlite] Re: AUTOINCREMENT Functionality by default required in 3.0.8 (Is it possible?)
Didn't SQLite provide commercial support somewhere..? I'm sure this is not an open source issue, since no-one dealing there would "not have time to upgrade". Funny, I'm sad for your timetables. -ak 17.2.2005 kello 10:02, [EMAIL PROTECTED] kirjoitti: Hi, A soft reminder. Please inform if the below mentioned request is a possibility? Regards, Sankara Narayanan. Sankara Narayanan/BTC/PIN/PHILIPS 02/14/2005 05:40 PM To SQLITE cc Subject AUTOINCREMENT Functionality by default required in 3.0.8 Hi, I am currently using Sqlite3.0.8 in our application. We have a functional requirement wherein we need for our tables to have unique Primary key value irrespective of deletions/additions. To be in detail, even if i delete the last row in a table, the subsequent addition should not reuse the integer primary key of the last deleted row. I find that this functionality is available in Sqlite 3.1 by defining AUTOINCREMENT for the primary key column. But porting to 3.1.1 is a tedious task the sqlite database engine is ported onto an ARM 7 platform and I dont have time to perform port to 3.1. I request details of what code needs to be modified so that I get this AUTOINCREMENT functionality implementation as a default functionality in 3.0.8. i.e. for all tables in my database running on the modified Sqlite engine, I require that the integer primary key is never reused. Please help in this regard. Thanks in advance, With regards, Sankara Narayanan Balasubramanian.
Re: [sqlite] would someone check my SQL..
Is it true that in SQLite one has no way to check (at CREATE TABLE statement itself) whether the table already is there? I got this from a person more accustomed to MySQL: >in mysql, the CREATE TABLE command has a 'IF NOT EXISTS' option, but as i >said, it's a non-standard extension. > >you could do a "SELECT * FROM table LIMIT 1" and check only if there's an >error to verify the existence of the table. Sure, I can do that but.. shouldn't there be a less elaborate way? -ak
[sqlite] would someone check my SQL..
I'm crafting a storage module based on SQLite internally. Think about it as 'ini files, but with a database'. Since this is my first touch to SQL, and the number of statements I need is rediculously small, I'd like some kind soul to 'proof-read' these and give comments. Each SQL block is a single statement, and I precompile them with a certain 'section' name baked into the code. Here goes.. Table creation: Loc_PrepareSql( db, , "CREATE TABLE '%q' ( key TEXT UNIQUE ON CONFLICT REPLACE," " val VARIANT );", section ); Q #1: What happens if the table already exists? Should I check for that? How? Value setting & getting: Loc_PrepareSql( db, >sql_set, "UPDATE '%q' SET val=?2 WHERE key='?1';", section ); Loc_PrepareSql( db, >sql_remove_key, "DELETE FROM '%q' WHERE key='?1';", section ); Loc_PrepareSql( db, >sql_get, "SELECT val FROM '%q' WHERE key='?1';", section ); Key enumeration (returns 1..N keys): Loc_PrepareSql( db, >sql_all_keys, "SELECT key FROM '%q';", section ); Key enumeration with a prefix (ie. "subtable.b."): Loc_PrepareSql( db, >sql_like_keys, "SELECT key FROM '%q' WHERE key= LIKE '?1.%';", section ); Similar, returns 1..N key + value pairs: Loc_PrepareSql( db, >sql_like_dump, "SELECT key,val FROM '%q' WHERE key= LIKE '?1.%';", section ); Loc_PrepareSql( db, >sql_transaction_begin, "BEGIN;", NULL ); Loc_PrepareSql( db, >sql_transaction_commit, "COMMIT;", NULL ); Thanks for help, feedback, and encouragement. :) -ak
Re: [sqlite] Using SQLite3 under Visual C++
I need to do that for OS X, since 'fink' does not currently have SQLite3 ported to it, yet. The solution is multi-OS (Win32, Linux, OS X, *BSD, .. WinCE) so I don't want to carry things statically. For some situation, it might suit. -ak 9.2.2005 kello 13:40, Dennis Volodomanov kirjoitti: I use it under Visual C++ by simply including all the files in the project, so that they're compiled in and linked statically. Dennis // MCP, MCSD // ASP Developer Member // Software for animal shelters! // www.smartpethealth.com // www.amazingfiles.com - Original Message - From: "Asko Kauppi" <[EMAIL PROTECTED]> To: <sqlite-users@sqlite.org> Sent: Wednesday, February 09, 2005 6:58 PM Subject: [sqlite] Using SQLite3 under Visual C++ The binary package of SQLite 3.0.8 for Win32 only has the .def and .dll files. While this is totally okay for MinGW (gcc) the lack of a .lib import library creates problems for Visual C++ users. Am I missing something obvious, or what should I do? Shouldn't this be a FAQ item? -ak -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 265.8.6 - Release Date: 07-Feb-05 -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 265.8.6 - Release Date: 07-Feb-05