Re: [sqlite] Delphi dbExpress driver for SQLite3 ?

2008-04-22 Thread LacaK
Thank you Fred, but I need multi-DB connectivity. User can set up in ini file, which driver use. Hm. -Laco. > Try this: > http://www.aducom.com/sqlite/ > You can dump DBExpress completely. > Fred ___ sqlite-users mailing list

Re: [sqlite] SQLITE_OMIT_PAGER_PRAGMAS

2008-04-22 Thread D. Richard Hipp
On Apr 22, 2008, at 8:37 PM, Richard Klein wrote: > I've generated and compiled the SQLite sources > with the option SQLITE_OMIT_PAGER_PRAGMAS. > > If I call sqlite_prepare() and sqlite3_step() > on the SQL statement "PRAGMA cache_size = 100;", > I get return codes of SQLITE_OK and SQLITE_DONE,

[sqlite] SQLITE_OMIT_PAGER_PRAGMAS

2008-04-22 Thread Richard Klein
I've generated and compiled the SQLite sources with the option SQLITE_OMIT_PAGER_PRAGMAS. If I call sqlite_prepare() and sqlite3_step() on the SQL statement "PRAGMA cache_size = 100;", I get return codes of SQLITE_OK and SQLITE_DONE, respectively, but the cache_size doesn't seem to change. Is

Re: [sqlite] Writer Starvation Question

2008-04-22 Thread Teg
Hello Fin, It sounds like you're creating inserts faster than you can actually insert them in the DB so, things are backing up. In this case, it's the second worker that's backing up. I'd use a single worker thread that accepts DB requests from the other worker threads then queue jobs to the

[sqlite] How to execute the statment file using sqlite API

2008-04-22 Thread Joanne Pham
Hi all, I have the serveral sql statement in the one file call : getData.sql and I want to use the sqlite API to call this file to execute all sql statements in this file at once. Can you tell me what API I should use. I had the code to execute the statment but I don't know how to call the file.

Re: [sqlite] Writer Starvation Question

2008-04-22 Thread Fin Springs
On Apr 22, 2008, at 6:52 PM, Igor Tandetnik itandetnik-at-mvps.org | sqlite| wrote: > Have thread B let thead A know that it wants in by using some > synchronization primitive. E.g on Windows I'd use a manual reset > event. > Thread A waits on the event at the top of the loop. The event is

Re: [sqlite] Writer Starvation Question

2008-04-22 Thread Fin Springs
On Apr 22, 2008, at 6:52 PM, Scott Hess shess-at-google.com |sqlite| wrote: > Weirdo response, but ... make sure you have HAVE_USLEEP defined. We > kept seeing something similar, and kept looking at the code for > sqliteDefaultBusyCallback(), and the code looked right, but the > problem

Re: [sqlite] Writer Starvation Question

2008-04-22 Thread Igor Tandetnik
Fin Springs <[EMAIL PROTECTED]> wrote: > I am using SQLite 3.5.7. This is a simplified example, but I have 2 > threads in the same process, each with their own connection, and cache > sharing disabled. > > Thread A does: > > while (some condtion) > BEGIN IMMEDIATE > do some INSERTs > COMMIT > >

Re: [sqlite] Writer Starvation Question

2008-04-22 Thread Scott Hess
Weirdo response, but ... make sure you have HAVE_USLEEP defined. We kept seeing something similar, and kept looking at the code for sqliteDefaultBusyCallback(), and the code looked right, but the problem remained, until we eventually started questioning every assumption. At which point we found

Re: [sqlite] How to retrieve number of cached pages in memory?

2008-04-22 Thread Richard Klein
You're right! A grep of the source code confirms that. My mistake. - Richard Jay A. Kreibich wrote: > On Tue, Apr 22, 2008 at 03:33:27PM -0700, Richard Klein scratched on the wall: >> You can call sqlite3_memory_highwater() to find >> the maximum amount of memory (in bytes) that your >> app

[sqlite] Writer Starvation Question

2008-04-22 Thread Fin Springs
I am using SQLite 3.5.7. This is a simplified example, but I have 2 threads in the same process, each with their own connection, and cache sharing disabled. Thread A does: while (some condtion) BEGIN IMMEDIATE do some INSERTs COMMIT Thread B occasionally wants to

Re: [sqlite] How to retrieve number of cached pages in memory?

2008-04-22 Thread Jay A. Kreibich
On Tue, Apr 22, 2008 at 03:33:27PM -0700, Richard Klein scratched on the wall: > You can call sqlite3_memory_highwater() to find > the maximum amount of memory (in bytes) that your > app has used. > > Then you can divide this number by 2000 (the default > size of a page) to determine the max

Re: [sqlite] How to retrieve number of cached pages in memory?

2008-04-22 Thread Jay A. Kreibich
On Wed, Apr 23, 2008 at 12:19:45AM +0200, Ralf Junker scratched on the wall: > I need to retrieve the number of pages a SQLite database connection has > currently allocated in memory. The documentation unfortunately turned up > no results. I know about "PRAGMA cache_size", but this returns the >

Re: [sqlite] How to retrieve number of cached pages in memory?

2008-04-22 Thread Richard Klein
You can call sqlite3_memory_highwater() to find the maximum amount of memory (in bytes) that your app has used. Then you can divide this number by 2000 (the default size of a page) to determine the max number of pages that have been cached. - Richard Klein Ralf Junker wrote: > I need to

Re: [sqlite] Trigger on an attached db.

2008-04-22 Thread Igor Tandetnik
Federico Granata <[EMAIL PROTECTED]> wrote: > I have two db, the main one is used from mine sw (call this db A), > the other is used from another sw (call this db B). > I open A, attach B, create a temp trigger in A triggered by insert > into a table in B and writing in a table in A > > If I

[sqlite] How to retrieve number of cached pages in memory?

2008-04-22 Thread Ralf Junker
I need to retrieve the number of pages a SQLite database connection has currently allocated in memory. The documentation unfortunately turned up no results. I know about "PRAGMA cache_size", but this returns the maximum number of pages possibly allowed in the cache, not the actual number of

[sqlite] Trigger on an attached db.

2008-04-22 Thread Federico Granata
Hi, I hope this question isn't a noob one like my last one ... I have two db, the main one is used from mine sw (call this db A), the other is used from another sw (call this db B). I open A, attach B, create a temp trigger in A triggered by insert into a table in B and writing in a table in A

Re: [sqlite] OMIT_VIEW / TRIGGER bug?

2008-04-22 Thread Richard Klein
While your solution will eliminate the link errors, I think that my solution -- replacing && with || in the conditional expression -- is actually the correct one, for two reasons: (1) In the source code, every other conditional expression involving OMIT_VIEW and OMIT_TRIGGER uses not && but ||.

Re: [sqlite] Creating a Database from RealBasic code

2008-04-22 Thread Thomas E. Wright
Thanks Denis. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Denis Crowther Sent: Tuesday, April 22, 2008 10:54 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] Creating a Database from RealBasic code Hi Thomas, No need to shell out,

Re: [sqlite] Creating a Database from RealBasic code

2008-04-22 Thread Denis Crowther
Hi Thomas, No need to shell out, you create from within the realbasic application. I'll pluck some example code and email it to you. Regards Denis On 04/23/2008 12:44 AM, Thomas E. Wright wrote: > This should be simple but does anyone know how to create a new database from > within realbasic

Re: [sqlite] OMIT_VIEW / TRIGGER bug?

2008-04-22 Thread Mark Spiegel
This was a problem for me too. I just chalked it up to deleting options and using the amalgamated source. (Seem to recall reading that this is not recommended.) Replace: SQLITE_PRIVATE void sqlite3MaterializeView(Parse*, Select*, Expr*, u32, int); with: #if !defined(SQLITE_OMIT_VIEW) &&

[sqlite] Creating a Database from RealBasic code

2008-04-22 Thread Thomas E. Wright
This should be simple but does anyone know how to create a new database from within realbasic code? I try to shell out using the shell command but it's not liking that too much and there seems to be no create database function for sqlite. Dim s As Shell s= New Shell f = GetFolderItem("")

Re: [sqlite] restricting access to sqlite database

2008-04-22 Thread Brad House
I'm assuming you're using mod_php. For a virtual-hosted environment, I don't think that can be made 'secure'. You probably need to switch to suexec and fastcgi php. That way the php scripts are run as your user rather than the 'www' user. You might glance at this:

Re: [sqlite] restricting access to sqlite database

2008-04-22 Thread Brandon, Nicholas (UK)
> > Thanks for your reply! However, apache has to be able to > access /a/ totally/different/path/to/db, so this means that > any user on the same server can access it via e.g. a PHP web > page, if they know that path, is that correct? > Yes, but > > >> In MySQL for example, this is

Re: [sqlite] restricting access to sqlite database

2008-04-22 Thread Thomas Robitaille
> Just because "apache" the user account on your compute can access the > db, doesn't mean apache the webserver is serving that file. > > My webserver runs as user "www" > > My db is under ~/Data//database.db owned by me, but chmod- > ed to 666 > > The webserver serves only files under ~/Sites//

Re: [sqlite] restricting access to sqlite database

2008-04-22 Thread P Kishor
On 4/22/08, Thomas Robitaille <[EMAIL PROTECTED]> wrote: > Thanks for your reply! However, apache has to be able to access > /a/totally/different/path/to/db, so this means that any > user on the same server can access it via e.g. a PHP web page, if they know > that path, is that correct? Just

Re: [sqlite] restricting access to sqlite database

2008-04-22 Thread Thomas Robitaille
Thanks for your reply! However, apache has to be able to access /a/ totally/different/path/to/db, so this means that any user on the same server can access it via e.g. a PHP web page, if they know that path, is that correct? Thomas On 22 Apr 2008, at 15:14, P Kishor wrote: > On 4/22/08,

Re: [sqlite] restricting access to sqlite database

2008-04-22 Thread P Kishor
On 4/22/08, Thomas Robitaille <[EMAIL PROTECTED]> wrote: > Hi everyone, > > I am in the process of setting up a forum which uses SQLite on a web > server which has ~50 other users. I can create a directory for the > sqlite database, which I chown to 'apache' (the user under which the > web

[sqlite] restricting access to sqlite database

2008-04-22 Thread Thomas Robitaille
Hi everyone, I am in the process of setting up a forum which uses SQLite on a web server which has ~50 other users. I can create a directory for the sqlite database, which I chown to 'apache' (the user under which the web server is run). However, because the database is then writable by

Re: [sqlite] Delphi dbExpress driver for SQLite3 ?

2008-04-22 Thread Fred Williams
Try this: http://www.aducom.com/sqlite/ You can dump DBExpress completely. Fred -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of LacaK Sent: Tuesday, April 22, 2008 2:15 AM To: sqlite-users@sqlite.org Subject: [sqlite] Delphi dbExpress driver for SQLite3 ?

Re: [sqlite] blob api

2008-04-22 Thread Robert Bielik
Igor Tandetnik skrev: >> Ok, I was kinda hoping for a more "permanent" solution such as: >> >> int sqlite3_cast_column_type(sqlite3* db, const char* zDBname, const >> char* zTable, const char* zColumn, int newColumnType); > > Perhaps > > update tableName set b = cast(b as text); Hah! Of course!

Re: [sqlite] blob api

2008-04-22 Thread Igor Tandetnik
"Robert Bielik" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > D. Richard Hipp skrev: >> Perhaps: SELECT CAST(b AS TEXT) FROM table >> > > Ok, I was kinda hoping for a more "permanent" solution such as: > > int sqlite3_cast_column_type(sqlite3* db, const char* zDBname, const >

[sqlite] Delphi dbExpress driver for SQLite3 ?

2008-04-22 Thread LacaK
Hi All, I have downloaded dbExpress driver for SQLite3 from http://www.bcp-software.nl/artikelen/sqlite.html When I am using it under Delphi6 (also in Turbo Delphi Explorer) I receive often error "Library used incorrectly" ... I have uploaded reproducible test case (+sources - very simple) at

Re: [sqlite] blob api

2008-04-22 Thread Ralf Junker
>> I'm using the sqlite3_blob_* api to write a larger text stream >> incrementally. Works a charm, but is there a way to >> change the datatype of the blob to text afterwards ? I'd like to see >> the text easily in f.i. SQLiteSpy. > >Perhaps: SELECT CAST(b AS TEXT) FROM table Yes, this

Re: [sqlite] blob api

2008-04-22 Thread Ralf Junker
>Ok, I was kinda hoping for a more "permanent" solution such as: Did you consider creating a view? >int sqlite3_cast_column_type(sqlite3* db, const char* zDBname, const char* >zTable, const char* zColumn, int newColumnType); > >that would cast the column into the desired type, returning