Re: [sqlite] Making blob as a sqlite database.

2019-05-28 Thread Keith Medcalf

https://sqlite.org/c3ref/deserialize.html
https://sqlite.org/c3ref/serialize.html

---
The fact that there's a Highway to Hell but only a Stairway to Heaven says a 
lot about anticipated traffic volume.

>-Original Message-
>From: sqlite-users [mailto:sqlite-users-
>boun...@mailinglists.sqlite.org] On Behalf Of Mohd Radzi Ibrahim
>Sent: Tuesday, 28 May, 2019 21:23
>To: SQLite mailing list
>Subject: Re: [sqlite] Making blob as a sqlite database.
>
>Hi Don,
>I am working on sales and stock management systems where all outlets
>run on
>it's own local database. I was thinking of a solution for all outlets
>to
>backup to central server and perhaps thru web interface do some
>queries on
>the backup database. I know postgres has binary interface that allow
>read/write to blob record which is quite promising to have a vfs
>system
>that can just store database in that record.
>
>But it seems that the blob in SQLite could not do that.
>
>
>On Tue, Apr 30, 2019 at 10:44 PM Don V Nielsen
>
>wrote:
>
>> Sorry to bother, Mohd. What is your use case? I mentioned this to
>> developers around me and they are intrigued. You are storing a
>database
>> file as blob in a database? We are curious as to the application. I
>am
>> assuming the database being stored is a collection of sensor or
>event data?
>>
>> On Fri, Apr 26, 2019 at 5:48 PM Mohd Radzi Ibrahim
>
>> wrote:
>>
>> > Hi, is there a vfs that could be used to open a blob column as a
>> database?
>> >
>> >
>> > thanks.
>> >
>> > Radzi.
>> > ___
>> > sqlite-users mailing list
>> > sqlite-users@mailinglists.sqlite.org
>> > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-
>users
>> >
>> ___
>> sqlite-users mailing list
>> sqlite-users@mailinglists.sqlite.org
>> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-
>users
>>
>___
>sqlite-users mailing list
>sqlite-users@mailinglists.sqlite.org
>http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users



___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Crash in sqlite3fts5BufferAppendBlob

2019-05-28 Thread bhandari_nikhil
Please help as to what parameters could have gone wrong when I see the crash
here:

#0  sqlite3Fts5BufferAppendBlob (pRc=pRc@entry=0xf54139c8,
pBuf=pBuf@entry=0xf5afeb90, nData=*4294967295*, pData=0xf49fff76
"90246ture") at sqlite3.c:180474

#1  0xf717b6f8 in fts5WriteAppendTerm (p=p@entry=0xf54139a8,
pWriter=pWriter@entry=0xf5afeb84, nTerm=5, pTerm=0xf49fff70
"06280290246ture") at sqlite3.c:188868

The nData became negative and a big value because it is u32. I t became
negative in frame #1 which did nTerm - nPrefix, nTerm =5 and nPrefix turned
out to be 6. Can anyone help as to how this can happen and what this means ?



--
Sent from: http://sqlite.1065341.n5.nabble.com/
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Making blob as a sqlite database.

2019-05-28 Thread Simon Slavin
On 29 May 2019, at 4:22am, Mohd Radzi Ibrahim  wrote:

> But it seems that the blob in SQLite could not do that.

You can read/write to a BLOB as if it's a file.



You just can't address the BLOB as if it's a SQLite database.  To do that you'd 
have to write your own VFS, and I'm not sure that that would work.


___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Making blob as a sqlite database.

2019-05-28 Thread Mohd Radzi Ibrahim
Hi Don,
I am working on sales and stock management systems where all outlets run on
it's own local database. I was thinking of a solution for all outlets to
backup to central server and perhaps thru web interface do some queries on
the backup database. I know postgres has binary interface that allow
read/write to blob record which is quite promising to have a vfs system
that can just store database in that record.

But it seems that the blob in SQLite could not do that.


On Tue, Apr 30, 2019 at 10:44 PM Don V Nielsen 
wrote:

> Sorry to bother, Mohd. What is your use case? I mentioned this to
> developers around me and they are intrigued. You are storing a database
> file as blob in a database? We are curious as to the application. I am
> assuming the database being stored is a collection of sensor or event data?
>
> On Fri, Apr 26, 2019 at 5:48 PM Mohd Radzi Ibrahim 
> wrote:
>
> > Hi, is there a vfs that could be used to open a blob column as a
> database?
> >
> >
> > thanks.
> >
> > Radzi.
> > ___
> > sqlite-users mailing list
> > sqlite-users@mailinglists.sqlite.org
> > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
> >
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] bug in sqlite3??

2019-05-28 Thread Stephen Chrzanowski
 Let's not forget that the size of the database is going to grow above and
beyond the "number of rows" due to pages that aren't reserved for your
data, such index pages, etc.

On Tue, May 28, 2019 at 1:49 PM Jens Alfke  wrote:

>
>
> > On May 26, 2019, at 7:21 PM, John Brigham  wrote:
> >
> > The size of the file reflects the number of rows that should be
> present.  And furthermore, the size of the file nicely reflects the number
> of days. […]  Trust me when I say that this file is way to big for the
> number of rows.
>
> SQLite files can contain free space after rows are deleted. (The free
> space will eventually be reused for new data, or it can be reclaimed using
> the VACUUM pragma.) So the size of the file does not necessarily reflect
> the amount of data it currently contains.
>
> Try opening a copy of the database with the `sqlite3` CLI tool and
> entering “PRAGMA vacuum;”. Then exit and look at the file size.
>
> —Jens
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] bug in sqlite3??

2019-05-28 Thread Simon Slavin
On 28 May 2019, at 6:49pm, Jens Alfke  wrote:

> Try opening a copy of the database with the `sqlite3` CLI tool and entering 
> “PRAGMA vacuum;”. Then exit and look at the file size.

Alternatively use the sqlite3_analyze tool and read the "Pages on the freelist" 
figures.
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] bug in sqlite3??

2019-05-28 Thread Jens Alfke


> On May 26, 2019, at 7:21 PM, John Brigham  wrote:
> 
> The size of the file reflects the number of rows that should be present.  And 
> furthermore, the size of the file nicely reflects the number of days. […]  
> Trust me when I say that this file is way to big for the number of rows.

SQLite files can contain free space after rows are deleted. (The free space 
will eventually be reused for new data, or it can be reclaimed using the VACUUM 
pragma.) So the size of the file does not necessarily reflect the amount of 
data it currently contains.

Try opening a copy of the database with the `sqlite3` CLI tool and entering 
“PRAGMA vacuum;”. Then exit and look at the file size.

—Jens
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] round function inconsistent

2019-05-28 Thread Jose Isaias Cabrera

Lifepillar, on Friday, May 24, 2019 02:48 PM, wrote...
>On 24 May 2019, at 19:53, Warren Young  wrote:
>>
>>https://chiselapp.com/user/lifepillar/repository/sqlite3decimal/index
>
>sqlite3decimal’s author here: be warned that the extension is still in
> development. In particular, it’s far from being optimized and the syntax
> is cumbersome. But the computations should give correct results wrt to
> decimal arithmetic (and you may choose the rounding algorithm)! I am
> currently working on different projects that are consuming all my time,
> but I plan to bring the extension to production level. Eventually :)
> Knowing that there is a need out there for this type of calculations is a
> strongly motivating factor.

I would be very interested when it has been completed.  However, I will 
download it and test it now. Maybe it will save me lots of programming outside 
sqlite.  :-)  Thanks.

josé
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] [EXTERNAL] Re: round function inconsistent

2019-05-28 Thread Jose Isaias Cabrera

Hick Gunter, on Tuesday, May 28, 2019 02:42 AM, wrote...
>Think of floating point as a knapsack problem.

Thanks for the nice explanation...


>So instead of complaining that the IEEE cylinder set causes undue
> stress on your knapsacks, please choose a more suitable set of
> cylinders for your specific application.

Indeed.  Thanks.

josé
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users