[sqlite] DB-Journal

2016-03-03 Thread Simon Slavin
On 2 Mar 2016, at 1:48pm, Itxaso Perez wrote: > - If this occurss (power loss) using only SQLite (without NHibernate), is > not a problem the opening of an app? > - How can I 'execute' the DB-Jounal file just to try to 'correct' the > database before execting NHibernate? [This is a simplified

[sqlite] Can I implement a scrolling window using LIMIT and OFFSET ?

2016-03-03 Thread 邱朗
Clemens Ladisch wrote: > > https://www.sqlite.org/lang_select.html talks about LIMIT & OFFSET, > > without mentioning that is a bad idea. >> Neither does it mention that it is a good idea. >> > can I do that or not (will it become sluggish if I do that) ? >> When you use large OFFSET values, the

[sqlite] Can I implement a scrolling window using LIMIT and OFFSET ?

2016-03-03 Thread 邱朗
>A better way that is very similar is to use WHERE and LIMIT instead.I know >that but as I just replied to this thread, if I do that I will then have to >record each columns I use for each table I want scroll cursor. So from the >implementation point of view, using LIMIT & OFFSET is easier.

[sqlite] Can I implement a scrolling window using LIMIT and OFFSET ?

2016-03-03 Thread 邱朗
So according to your answers and others, this limitation is always there even the document said "obsolete" ? Just want to double confirm. Thanks! Qiulang At 2016-03-03 11:06:08, "Darren Duncan" wrote: >On 2016-03-02 6:48 PM, ?? wrote: >>> A better way that is very similar is to use WHERE

[sqlite] SQLITE Porting on FreeRTOS with STM32

2016-03-03 Thread Nitin Bhosale
Hi All I am trying to port sqlite3 VFS implementation on freertos(FATFS on stm32 ARM CortexM4). I have created an amalgamation with sqlite3 version 3.12 base code. When I run the below code it runs to create a database and a query "create a table cars". But when query "insert" is run then

[sqlite] Can I implement a scrolling window using LIMIT and OFFSET ?

2016-03-03 Thread R Smith
On 2016/03/03 5:10 AM, ?? wrote: > So according to your answers and others, this limitation is always there even > the document said "obsolete" ? Just want to double confirm. > > > Thanks! To add to what Clemens already mentioned - this problem is not an SQLite problem, this problem is true

[sqlite] SQLITE Porting on FreeRTOS with STM32

2016-03-03 Thread Clemens Ladisch
Nitin Bhosale wrote: > I am trying to port sqlite3 VFS implementation on freertos(FATFS on > stm32 ARM CortexM4). I have created an amalgamation with sqlite3 > version 3.12 base code. > > When I run the below code it runs to create a database and a query > "create a table cars". But when query

[sqlite] Are BLOB stored inline with the rest of the record fields?

2016-03-03 Thread Eric Grange
> All BLOBs are stored inline. The only complication comes when the total row length is longer than a page. Ok thanks! That is besides my original question but what is the complication in that case? Is the blob partially stored in the row, or is some indirection to other pages used, with only

[sqlite] Are BLOB stored inline with the rest of the record fields?

2016-03-03 Thread Simon Slavin
> On 3 Mar 2016, at 8:16am, Eric Grange wrote: > >> All BLOBs are stored inline. The only complication comes when the total >> row length is longer than a page. > > Ok thanks! > > That is besides my original question but what is the complication in that > case? > Is the blob partially stored

[sqlite] Are BLOB stored inline with the rest of the record fields?

2016-03-03 Thread Paul Sanderson
What is the likely max length of a row in your table? if your row length is less than page length-35 then it will fit in to one page. The amount of wasted page depends on what fraction of a page size your typical record is. If you have a record that is 600 bytes long on a DB with 1024 byte page

[sqlite] Can I implement a scrolling window using LIMIT and OFFSET ?

2016-03-03 Thread Darren Duncan
On 2016-03-02 11:18 PM, R Smith wrote: > On 2016/03/03 5:10 AM, ?? wrote: >> So according to your answers and others, this limitation is always there even >> the document said "obsolete" ? Just want to double confirm. > > To add to what Clemens already mentioned - this problem is not an SQLite >

[sqlite] Porting Sqlite to Embedded Platform

2016-03-03 Thread Nitin Bhosale
Hi We were attempting to use test_onefile.c based approach (http://www.sqlite.org/src/doc/trunk/src/test_onefile.c). This is for embedded where filesystem is not available. This code works and we can create, insert, select on the database created using this test_onefile.c. However we want

[sqlite] Porting Sqlite to Embedded Platform

2016-03-03 Thread Dan Kennedy
On 03/03/2016 10:20 PM, Nitin Bhosale wrote: > Hi > > We were attempting to use test_onefile.c based approach > (http://www.sqlite.org/src/doc/trunk/src/test_onefile.c). This is for > embedded where filesystem is not available. > This code works and we can create, insert, select on the database

[sqlite] Are BLOB stored inline with the rest of the record fields?

2016-03-03 Thread Drago, William @ CSG - NARDA-MITEQ
I haven't seen any anyone else mention this yet. Another consideration when working with large blobs is to make those columns that last ones in your schema. To quote Dr. Hipp: "make the BLOB columns the last column in your tables. Or even store the BLOBs in a separate table which only has two

[sqlite] Partial index query planner questions

2016-03-03 Thread David Raymond
I've got a question or two on the query planner's use of partial indexes. It seems that the query planner isn't using a partial index unless the fields in the WHERE clause of the query are present as fields in the index, even if the WHERE of the query exactly matches the WHERE of the index.

[sqlite] Partial index query planner questions

2016-03-03 Thread Richard Hipp
On 3/3/16, David Raymond wrote: > > create table problemTable > ( > pk text primary key, > A text not null, > n int not null > --other fields here > ); > create index typicalFullIndex on problemTable (A); > create index unusedPartial on problemTable (A) where n > 1; > > sqlite>

[sqlite] Can I implement a scrolling window using LIMIT and OFFSET ?

2016-03-03 Thread James K. Lowden
On Thu, 3 Mar 2016 10:43:26 +0800 (CST) ?? wrote: > > Can anyone describe a situation for which this style of LIMIT & > > OFFSET is advisable from the application's point of view? (The > > DBMS costs are obvious enough.) > > For me this is the easiest way to implement a scrolling cursor. >

[sqlite] attach db limit

2016-03-03 Thread Tim Uy
Hi, I see that there is a default limit of 10 attached databases. And from the docs, 125 is limit. However, in the file sqliteLimit.h it says /* ** The maximum number of attached databases. This must be between 0 ** and 62. The upper bound on 62 is because a 64-bit integer bitmap ** is used

[sqlite] attach db limit

2016-03-03 Thread John McKown
In the source to 3.12.0, the source in src/main.c has: #if SQLITE_MAX_ATTACHED<0 || SQLITE_MAX_ATTACHED>125 # error SQLITE_MAX_ATTACHED must be between 0 and 125 #endif The limits.html on the Web site also says 125. As does the changes for 3.8.6. Why 125 would be a good question. The value

[sqlite] attach db limit

2016-03-03 Thread Richard Hipp
On 3/3/16, John McKown wrote: > Why 125 would be a good question. The maximum value of an signed 8-bit integer is 127. Take away two for the "main" and "temp" databases. -- D. Richard Hipp drh at sqlite.org

[sqlite] attach db limit

2016-03-03 Thread Tim Uy
So comment in sqliteLimit just needs an update? On Thu, Mar 3, 2016 at 1:20 PM, Richard Hipp wrote: > On 3/3/16, John McKown wrote: > > Why 125 would be a good question. > > The maximum value of an signed 8-bit integer is 127. Take away two > for the "main" and "temp" databases. > > -- > D.

[sqlite] attach db limit

2016-03-03 Thread Tim Uy
(Thanks Richard for the explanation of "main" and "temp".) On Thu, Mar 3, 2016 at 2:02 PM, Tim Uy wrote: > So comment in sqliteLimit just needs an update? > > On Thu, Mar 3, 2016 at 1:20 PM, Richard Hipp wrote: > >> On 3/3/16, John McKown wrote: >> > Why 125 would be a good question. >> >>

[sqlite] How to use sqlite3_blob_open when the blob column is empty?

2016-03-03 Thread zhangkai
Hello, I am using sqlite3 version 3.11.0. I use the C API.I create a table "create table device(ieee integer primary key, name text, status integer, zclversion integer,

[sqlite] How to use sqlite3_blob_open when the blob column is empty?

2016-03-03 Thread zhangkai
Hello, I am using sqlite3 version 3.11.0. I use the C API.I create a table "create table device(ieee integer primary key, name text, status integer, zclversion integer,

[sqlite] sqlite3 and tcl86

2016-03-03 Thread tombert.group
Dear SQLite Team, I am experiencing the following bug in the tcl package: First the configure script does not correctly recognize the tcl location. Anyhow I made it working using the amalgamation file and the gcc command below: gcc -v -DSQLITE_OS_WIN -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS4