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
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
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
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
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
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?
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:
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:
> *
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
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
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
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
: [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
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
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
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
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
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
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
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.
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
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
22 matches
Mail list logo