[sqlite] Json paths

2019-04-14 Thread Charles Leifer
Many of the sqlite json1 functions accept a path parameter, which the documents describe as: For functions that accept PATH arguments, that PATH must be well-formed or else the function will throw an error. A well-formed PATH is a text value that begins with exactly one '$' character followed by z

[sqlite] SQLite v3.27.2 memory usage

2019-04-14 Thread David Ashman - Zone 7 Engineering, LLC
Hello - I have a question on SQLite memory usage. I'm successfully using SQLite v3.27.2 amalgamation on an embedded ARM processor from STMicro with SD card and no OS.  The database file size is about 3.8GB.  The file system is Segger emFile FAT32.  I've configured SQLite to use 3.7MB RAM for

Re: [sqlite] Help with sqlite3_value_text

2019-04-14 Thread J Decker
On Sun, Apr 14, 2019 at 5:40 AM x wrote: > On second thoughts JD, can’t use strlen or sqlite3_value_bytes in case > values(1) contains more than a single unicode character. This looks OK. > > Bytes are what you need though; it doesn't matter how big the buffer is, as long as you have all of it.

Re: [sqlite] Database corruption check.

2019-04-14 Thread Richard Hipp
On 4/14/19, Lullaby Dayal wrote: > > For Sqlite database, as per my understanding, implementing pragma > integrity_check won't guarantee all errors to be detected. Maybe you are confused with "PRAGMA quick_check"? The "PRAGMA integrity_check" takes a little longer, but does a better job. There

[sqlite] Database corruption check.

2019-04-14 Thread Lullaby Dayal
Hi, We are using sqlite for our embedded automotive system based on QNX. We have a requirement to check whether database is corrupted on start-up and replace it with default database if such a scenario happens. For Sqlite database, as per my understanding, implementing pragma integrity_check won'

Re: [sqlite] Help with sqlite3_value_text

2019-04-14 Thread x
On second thoughts JD, can’t use strlen or sqlite3_value_bytes in case values(1) contains more than a single unicode character. This looks OK. # define CHARLEN(x) !(x & 128) ? 1 : (x & 16 ? 4 : (x & 32 ? 3 : 2)) char *c = (char *)sqlite3_value_text(values[0]); char *Sep = (char *)sqlite3_value_t

Re: [sqlite] Help with sqlite3_value_text

2019-04-14 Thread x
From: J Decker Sent: 13 April 2019 20:05 To: SQLite mailing list Subject: Re: [sqlite] Help with sqlite3_value_text >> char *c = (char *)sqlite3_value_text(values[0]); >> char *Sep = (char *)sqlite3_value_text(values[1]); >> i

Re: [sqlite] Inserting the same column multiple times

2019-04-14 Thread Shawn Wagner
On Sun, Apr 14, 2019 at 1:16 AM Luuk wrote: > > > Because, i do think, that it would never be possible to specify more > than the number of columns in an insert statement? > > The original issue was with some java/android sqlite binding that has a method that builds an insert statement on the fly

Re: [sqlite] Inserting the same column multiple times

2019-04-14 Thread Luuk
On 14-4-2019 09:36, Shawn Wagner wrote: Discovered this tonight answering a question on stack overflow: sqlite> create table foo(a, b); sqlite> insert into foo(a,b,a,b) values(1,2,3,4); sqlite> select * from foo; a b -- -- 1 2 Inserting a column multiple ti

[sqlite] Inserting the same column multiple times

2019-04-14 Thread Shawn Wagner
Discovered this tonight answering a question on stack overflow: sqlite> create table foo(a, b); sqlite> insert into foo(a,b,a,b) values(1,2,3,4); sqlite> select * from foo; a b -- -- 1 2 Inserting a column multiple times only uses the first corresponding value