Re: [sqlite] WAL mode

2017-02-08 Thread Niti Agarwal
Yes, I am closing the DB before program exits. Like this: db.Close(). I am using Sqlite3 with Golang. Regards, Niti On Wed, Feb 8, 2017 at 11:08 PM, Jens Alfke wrote: > > > On Feb 8, 2017, at 9:21 AM, Niti Agarwal wrote: > > > > According to the

Re: [sqlite] sqlite3_complete

2017-02-08 Thread James K. Lowden
On Thu, 9 Feb 2017 00:41:34 +0200 R Smith wrote: > In the end, accurately judging the effect and validity of a statement > without actually running it to completion, is just not useful. Agreed. Since you have to test the return code from preparing the statement anyway,

Re: [sqlite] sqlite3_complete

2017-02-08 Thread R Smith
On 2017/02/08 8:47 PM, x wrote: Thanks, it certainly looks more useful with that additional info. I sometimes have to pass SQL to my own currently unsophisticated parser before I can send it to prepare and hoped it would help with that. Given what you’ve told me It will help to a degree but

Re: [sqlite] Beginning of release testing for version 3.17.0

2017-02-08 Thread Cecil Westerhof
2017-02-08 16:49 GMT+01:00 Richard Hipp : > On 2/8/17, Cecil Westerhof wrote: > > > > ​I use SQLite, but only for relative simple things. Is there a way I can > > help with testing, or do you need a ‘heavy’ application to do that? > > > > All tests are

Re: [sqlite] Help with Backup API please

2017-02-08 Thread Barry
Ok. My bad for singling out SQLite, I should have rather mentioned that the problem exists with all memory allocation routines (malloc/free or new/delete), at least on windows. A workaround is to pass around allocator / deallocator function pointers with any data structure which contains pointers

Re: [sqlite] sqlite3_complete

2017-02-08 Thread x
Thanks, it certainly looks more useful with that additional info. I sometimes have to pass SQL to my own currently unsophisticated parser before I can send it to prepare and hoped it would help with that. Given what you’ve told me It will help to a degree but when I first saw it I hoped it

Re: [sqlite] WAL mode

2017-02-08 Thread Simon Slavin
On 8 Feb 2017, at 6:26pm, Jens Alfke wrote: > On Feb 8, 2017, at 9:46 AM, Simon Slavin wrote: > >> Does your program execute sqlite3_shutdown() and check to see whether it >> returns an error code ? > > Never noticed that function before … the docs

Re: [sqlite] WAL mode

2017-02-08 Thread Jens Alfke
> On Feb 8, 2017, at 9:46 AM, Simon Slavin wrote: > > Does your program execute sqlite3_shutdown() and check to see whether it > returns an error code ? Never noticed that function before … the docs say it’s "designed to aid in process initialization and shutdown on

Re: [sqlite] WAL mode

2017-02-08 Thread Simon Slavin
On 8 Feb 2017, at 5:21pm, Niti Agarwal wrote: > The databases I'm working with are write ahead logging (WAL) databases. > According to the SQLite documentation, the shm and wal files are supposed > to be deleted upon completion of the program. However, these files are >

Re: [sqlite] WAL mode

2017-02-08 Thread Jens Alfke
> On Feb 8, 2017, at 9:21 AM, Niti Agarwal wrote: > > According to the SQLite documentation, the shm and wal files are supposed > to be deleted upon completion of the program. Are you explicitly closing the database before your program exits? (In other words, I think

Re: [sqlite] WAL mode

2017-02-08 Thread R Smith
On 2017/02/08 7:21 PM, Niti Agarwal wrote: The databases I'm working with are write ahead logging (WAL) databases. According to the SQLite documentation, the shm and wal files are supposed to be deleted upon completion of the program. However, these files are still there after execution of

[sqlite] WAL mode

2017-02-08 Thread Niti Agarwal
The databases I'm working with are write ahead logging (WAL) databases. According to the SQLite documentation, the shm and wal files are supposed to be deleted upon completion of the program. However, these files are still there after execution of this program. The documentation says the files

Re: [sqlite] Help with Backup API please

2017-02-08 Thread Richard Hipp
On 2/8/17, Barry Smith wrote: > > I believe SQLite doesn't use the standard memory allocation routines, but > instead has its own routines. SQLite has its on memory allocation routines (if you use the right compile-time and start-time options) but it uses system

Re: [sqlite] Help with Backup API please

2017-02-08 Thread Barry Smith
Hi Brett, I believe SQLite doesn't use the standard memory allocation routines, but instead has its own routines. These (might) use global variables. If each module of your application statically links to the SQLite source rather than having SQLite in a common DLL, then each module will have

Re: [sqlite] sqlite3_complete

2017-02-08 Thread R Smith
On 2017/02/08 6:45 PM, x wrote: OK, thanks Richard. When I first discovered the function I was hoping it would do more than it said on the tin. Do more? Like what? Perhaps Richard's effort to be brief disguised the true power of the function. If I can put it in a more descriptive manner,

Re: [sqlite] Virtual table vs real table query performance

2017-02-08 Thread Dimitris Bil
I see, so in the native implementation you already have the whole table in memory and only use the clustered b-tree index to search for tuples. So I would not expect a large improvement from the virtual table implementation, but the virtual table being 5 times slower is strange. Maybe not the

Re: [sqlite] sqlite3_complete

2017-02-08 Thread x
OK, thanks Richard. When I first discovered the function I was hoping it would do more than it said on the tin. Sent from Mail for Windows 10 From: Richard Hipp Sent: 08 February 2017 16:36 To: SQLite mailing

Re: [sqlite] sqlite3_complete

2017-02-08 Thread Richard Hipp
On 2/8/17, Richard Hipp wrote: > On 2/8/17, x wrote: >> >> It checks the input is appended with a semi-colon? Surely I’m missing >> something? >> > > It also verifies that the semicolon at the end is not part of a > string, or comment, nor in the middle of

Re: [sqlite] Bulk Insert in Sqlite3

2017-02-08 Thread Warren Young
On Feb 6, 2017, at 10:36 PM, Niti Agarwal wrote: > I read about SQLITE_MAX_SQL_LENGTH, If this is why you’re making many transactions, there’s no requirement that all of the SQL that’s part of a single transaction be in a single SQL string given to the DB. You can

Re: [sqlite] sqlite3_complete

2017-02-08 Thread Richard Hipp
On 2/8/17, x wrote: > > It checks the input is appended with a semi-colon? Surely I’m missing > something? > It also verifies that the semicolon at the end is not part of a string, or comment, nor in the middle of a CREATE TRIGGER statement. -- D. Richard Hipp

[sqlite] sqlite3_complete

2017-02-08 Thread x
Determine If An SQL Statement Is Complete int sqlite3_complete(const char *sql); int sqlite3_complete16(const void *sql); These routines are useful during command-line input to determine if the currently entered text seems to form a complete SQL statement or if additional input is needed before

Re: [sqlite] Virtual table vs real table query performance

2017-02-08 Thread Dominique Devienne
On Wed, Feb 8, 2017 at 4:50 PM, Hick Gunter wrote: > This is with a generic, user definable table and index structure capable > virtual table implementation; it is not a "one module per table" statically > typed heavily optimized implementation. > Ah, that makes complete sense

Re: [sqlite] Virtual table vs real table query performance

2017-02-08 Thread Bob Friesenhahn
On Wed, 8 Feb 2017, Dimitris Bil wrote: Do you perform the benchmark on the native database table using cold cache or warm cache? Also, can you briefly describe what the benchmark does and give the schema for the native database table? My benchmark repeatedly reads all of the columns one by

Re: [sqlite] Virtual table vs real table query performance

2017-02-08 Thread Hick Gunter
This is with a generic, user definable table and index structure capable virtual table implementation; it is not a "one module per table" statically typed heavily optimized implementation. -Ursprüngliche Nachricht- Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org]

Re: [sqlite] Beginning of release testing for version 3.17.0

2017-02-08 Thread Richard Hipp
On 2/8/17, Cecil Westerhof wrote: > > ​I use SQLite, but only for relative simple things. Is there a way I can > help with testing, or do you need a ‘heavy’ application to do that? > All tests are welcomed. The extensive SQLite test suite probably already covers most of

Re: [sqlite] Virtual table vs real table query performance

2017-02-08 Thread Dominique Devienne
On Wed, Feb 8, 2017 at 4:30 PM, Hick Gunter wrote: > Values are for retrieving 100.000 rows with a where clause not satisfiable > from the index but true for alle rows > > asql> select count() from ; > CPU Time: user 0.092986 sys 0.00 > > asql> select count() from where

Re: [sqlite] Virtual table vs real table query performance

2017-02-08 Thread Hick Gunter
Values are for retrieving 100.000 rows with a where clause not satisfiable from the index but true for alle rows asql> select count() from ; CPU Time: user 0.092986 sys 0.00 asql> select count() from where =4; CPU Time: user 0.189971 sys 0.00 CPU Time: user 0.199969 sys 0.00 CPU

Re: [sqlite] Retrieve INTEGER PRIMARY KEY

2017-02-08 Thread Clyde Eisenbeis
I have a solution, thanks to Alex Smith. This works: sqliteCmd.CommandText = "INSERT INTO " System.Data.SQLite.SQLiteTransaction sqliteTran = sqliteConnection.BeginTransaction(); sqliteCmd.ExecuteNonQuery(); long lKeyID = sqliteConnection.LastInsertRowId;

Re: [sqlite] Virtual table vs real table query performance

2017-02-08 Thread Dimitris Bil
Hello, Do you perform the benchmark on the native database table using cold cache or warm cache? Also, can you briefly describe what the benchmark does and give the schema for the native database table? thanks From: sqlite-users

Re: [sqlite] Beginning of release testing for version 3.17.0

2017-02-08 Thread Cecil Westerhof
2017-02-07 15:32 GMT+01:00 Richard Hipp : > In a few days, we will begin the official release testing for SQLite > version 3.17.0. > > A recent snapshot of the code can be found on the > https://www.sqlite.org/download.html page or directly from Fossil at >

Re: [sqlite] Beginning of release testing for version 3.17.0

2017-02-08 Thread jose isaias cabrera
Just thinking out loud for those of us that use the DLL provided in your site... It would be nice that this email would be accompanied by ready made DLLs also. Perhaps under, https://www.sqlite.org/draft/ [1]download.html [2] This is because some of us may not have the time to create the

Re: [sqlite] Virtual table vs real table query performance

2017-02-08 Thread Bob Friesenhahn
On Wed, 8 Feb 2017, Hick Gunter wrote: Having imlemented a memory-based virtual table complete with indices, full table scan and direct access via rowid (which happens to be the memory address of the row) I can do a batch delete of 100.000 rows (in a table with 1 composite index) in about 2

Re: [sqlite] Help with Backup API please

2017-02-08 Thread Clemens Ladisch
Brett Goodman wrote: > When I call sqlite3_backup_init it throws this error: _/"library /__/ > /__/routine called out of sequence"/_. To you get an error code, or an exception? In the first case, try calling sqlite3_errmsg(). The documentation says: | A call to sqlite3_backup_init() will fail,

[sqlite] Help with Backup API please

2017-02-08 Thread Brett Goodman
Hello Sqlite users. I have a problem I can't solve. I have a C++ DLL project in which I compile the Sqlite amalgamation code. The purpose is to wrap the key Sqlite functions with exported functions I can call from another C++ COM DLL. I'm using VS2003 for this because its part of a legacy

Re: [sqlite] SQLITE_ENABLE_UPDATE_DELETE_LIMIT (Was: Patch Etiquette)

2017-02-08 Thread Jan Nijtmans
2017-02-06 23:25 GMT+01:00 Ziemowit Laski: > Here is my approach to the SQLITE_ENABLE_UPDATE_DELETE_LIMIT problem. [If > the attachment does not arrive intact, please let me know.] Hi Ziemowit, I tried your patch, and it works fine! Below is an additional patch, which makes the resulting

Re: [sqlite] New pre-release snapshot with performance enhancements

2017-02-08 Thread Jake Thaw
Hi Dan, I can confirm that the current snapshot works for me as expected. I was linking against sqlite-snapshot-201701170010, which predates the session enhancement. Thank you for your time. -Jake ___ sqlite-users mailing list

Re: [sqlite] Virtual table vs real table query performance

2017-02-08 Thread Hick Gunter
Having imlemented a memory-based virtual table complete with indices, full table scan and direct access via rowid (which happens to be the memory address of the row) I can do a batch delete of 100.000 rows (in a table with 1 composite index) in about 2 seconds (3.7 seconds with the condition)

Re: [sqlite] SQLITE_ENABLE_UPDATE_DELETE_LIMIT (Was: Patch Etiquette)

2017-02-08 Thread Ziemowit Laski
Hello, I checked the message archive and it appears that the attachment got stripped from my previous message. So I'm plastering it inline below. Thank you, --Zem diff -C5 sqlitesrc2/sqlite-src-3160200/main.mk sqlitesrc3/sqlite-src-3160200/main.mk *** sqlitesrc2/sqlite-src-3160200/main.mk

Re: [sqlite] FOREIGN KEY question

2017-02-08 Thread J Decker
On Wed, Feb 8, 2017 at 12:24 AM, Clemens Ladisch wrote: > Igor Korot wrote: > > Does SQLite supports the FK name? > > If yes, what is the proper syntax? > > CREATE TABLE t ( > x PRIMARY KEY, > y, > CONSTRAINT this_is_the_name FOREIGN KEY (y) REFERENCES t(x) >

Re: [sqlite] FOREIGN KEY question

2017-02-08 Thread Clemens Ladisch
Igor Korot wrote: > Does SQLite supports the FK name? > If yes, what is the proper syntax? CREATE TABLE t ( x PRIMARY KEY, y, CONSTRAINT this_is_the_name FOREIGN KEY (y) REFERENCES t(x) ); or CREATE TABLE t ( x PRIMARY KEY, y CONSTRAINT this_is_the_name REFERENCES t(x)