RE: [sqlite] Re: File Syste

2006-12-13 Thread Pat Wibbeler
The public C API is well-documented here: http://www.sqlite.org/capi3.html There may be other documentation of the internals, but I'd imagine the public API will get you pretty far. Pat -Original Message- From: Cesar Rodas [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 13, 2006

RE: [sqlite] windows dll

2006-12-11 Thread Pat Wibbeler
All static goodness aside, I think the OP's question is still reasonable. The best suggestion I've heard for those who want to version the DLL is to do it themselves, but many feel much more comfortable with a project-approved binary. Perhaps someone who feels strongly enough about a versioned

RE: [sqlite] about call back of sqlite.

2006-12-08 Thread Pat Wibbeler
You might also be able to watch the database file itself for changes using a platform specific mechanism. On UNIX, you could use kqueue's and on Windows a combination of FindFirstChangeNotification, FindNextChangeNotification and WaitForMultipleObjects. This would allow you to watch for

RE: [sqlite] outputting select in cpp file?

2006-07-28 Thread Pat Wibbeler
Check out the callback parameter to sqlite_exec (the third parameter). The quickstart gives an example of this: http://www.sqlite.org/quickstart.html Alternatively, check out sqlite3_prepare, sqlite3_bind, and sqlite3_step, sqlite3_result*, and sqlite3_finalize. All of these functions are

RE: [sqlite] help with win32/iis install

2006-07-22 Thread Pat Wibbeler
The error probably comes from this line of code: $db = sqlite_open("test.db") or die("failed to open/create the database"); I know nothing about this configuration, but when sqlite_open fails, my first instinct is a permissions issue. sqlite_open("test.db") attempts to create or open a file

RE: [sqlite] Encoding with spanish characters

2006-07-13 Thread Pat Wibbeler
It depends (I know, not the answer you had hoped for!) How are your query and parameter strings obtained (command line, compiled static strings, files, gui, other)? What encoding are these input strings? Are you using sqlite3_exec, sqlite3_prepare or sqlite3_prepare16 to execute the query?

RE: [sqlite] sqlite3 on MacOSX

2006-07-09 Thread Pat Wibbeler
On my mac, sqlite3 -version shows 3.1.3 which is not forward compatible with the default format for 3.3.6 unless you use the PRAGMA: PRAGMA legacy_file_format=TRUE; Before you create the database. To use the old version as the default, you can compile the lib yourself with:

RE: [sqlite] endian-specific code in pure c source release?

2006-07-03 Thread Pat Wibbeler
ows source. If you make any extensions to Sqlite, such as your own functions, they will be platform independent. By using the regular Sqlite source distribution you will be able to upgrade easily, and not have your application rev-locked. Pat Wibbeler wrote: > For a couple of reasons: > *

RE: [sqlite] endian-specific code in pure c source release?

2006-07-03 Thread Pat Wibbeler
release? Why not use the regular source and run configure? Pat Wibbeler wrote: > I'd like to build an xcode project for sqlite. One straightforward > approach is to take the sqlite-source-3_3_6.zip "pure c" source release > and build the xcode project from that. > > Is there

RE: [sqlite] default value in hex

2006-07-03 Thread Pat Wibbeler
Are you performing computations with that number? For example, will you be performing addition, subtraction, or bitwise and/or? If not, you could just leave it as a string (and likely change the create to be "... text(32) default '0xFF'"). I'm not an expert on the topic, but sqlite uses

[sqlite] endian-specific code in pure c source release?

2006-07-03 Thread Pat Wibbeler
I'd like to build an xcode project for sqlite. One straightforward approach is to take the sqlite-source-3_3_6.zip "pure c" source release and build the xcode project from that. Is there any endian specific code in that source release that might trip me up on power pc processors? I ask this

RE: [sqlite] real time gui updates

2006-06-29 Thread Pat Wibbeler
Another alternative might be using an API that waits for events on the database file - for instance kqueues some unix variants or WaitForMultipleObjects and FindFirstChangeNotification/FindNextChangeNotification on windows. I agree that polling causes issues. It doesn't require much CPU if you

RE: [sqlite] Problems with multiple threads?

2006-06-08 Thread Pat Wibbeler
: [sqlite] Problems with multiple threads? * Pat Wibbeler <[EMAIL PROTECTED]> [2006-06-07 22:55]: > It's entirely possible I'm reading these docs incorrectly, but > this strategy has worked quite well for me. No, I don't see any error in your reading. My apologies; I should have consulted the

RE: [sqlite] Problems with multiple threads?

2006-06-07 Thread Pat Wibbeler
Beginning everything with BEGIN IMMEDIATE should eliminate the possibility of deadlock, but you will serialize read-only operations. If your transactions are short or contention is low, using BEGIN IMMEDIATE makes things easy. However, if you find that you have a set of read-only operations that

RE: [sqlite] Problems with multiple threads?

2006-06-07 Thread Pat Wibbeler
Do you have any transactions that look like: BEGIN SELECT INSERT/DELETE/UPDATE COMMIT If you do, you may have multiple threads trying to escalate from a SHARED to a RESERVED lock as described here: http://sqlite.org/capi3ref.html#sqlite3_busy_handler It's important that if you have

RE: [sqlite] BEGIN and Backup [was Re: [sqlite] Problems with multiple threads?]

2006-06-07 Thread Pat Wibbeler
You can use BEGIN IMMEDIATE or BEGIN EXCLUSIVE depending on the type of lock you'd like. SQLite BEGIN syntax: http://sqlite.org/lang_transaction.html SQLite locks: http://sqlite.org/lockingv3.html SQLite Busy Handler: http://sqlite.org/capi3ref.html#sqlite3_busy_handler Pat -Original

RE: [sqlite] Problems with multiple threads?

2006-06-06 Thread Pat Wibbeler
One means of troubleshooting this is to emit a log statement that includes the thread id with every BEGIN/COMMIT (e.g. printf("%d - %s", thread, sql)). It may be useful to log other sql statements this way as well. This sort of troubleshooting has always shown the mistake to be mine, not

RE: [sqlite] Memory DB: Load from file

2006-06-06 Thread Pat Wibbeler
This sounded fun, so I thought I'd give it a try. Here's a sample pulling schema and data from an on-disk to an in-memory database in c. I've omitted error handling and debug output to make it shorter. int process_ddl_row(void * pData, int nColumns, char **values, char **columns); int

RE: [sqlite] Multithreading. Again.

2006-06-02 Thread Pat Wibbeler
I don't think it's that uncommon to ask the user of the statement to finalize database resources explicitly, even in a managed environment. For example, Java collects memory, but the programmer must explicitly close network, file, database, and other resources. In java, I do this in a finally

RE: [sqlite] Multithreading. Again.

2006-06-01 Thread Pat Wibbeler
I was reading sqlite3_open documentation earlier this week and noticed that the docs say: "The returned sqlite3* can only be used in the same thread in which it was created. It is an error to call sqlite3_open() in one thread then pass the resulting database handle off to another thread to use.

[sqlite] sqlite3_exec returning SQLITE_CANTOPEN

2006-05-22 Thread Pat Wibbeler
I'm periodically seeing sqlite3_exec return SQLITE_CANTOPEN. Unfortunately, I haven't boiled this down to a simple sample that I can send to this list, but I thought I'd check to see if there is a known solution before I dive too deep. I'm using sqlite version 3.2.7 on windows. Thanks! Pat The

[sqlite] means for explicitly escalating a transaction from RESERVED to PENDING/EXCLUSIVE

2006-05-04 Thread Pat Wibbeler
Is there a means for explicitly escalating an existing transaction from RESERVED to EXCLUSIVE (either through issuing sql statements or the C API)? I'm using the following locking strategy: * Read only transactions start with a BEGIN and allow sqlite to escalate to SHARED on read. * Transactions