[sqlite] How to backup a memory database to a memory stream?

2019-02-21 Thread heribert
Is there any way to backup a memory database directly to a memory stream? In my case i have to backup a small memory database directly into a byte array, without using any os based temp file. ___ sqlite-users mailing list

Re: [sqlite] [EXTERNAL] WITHOUT ROWID tables with a ROWID

2019-02-21 Thread Hick Gunter
The magic aliasing of rowid to the internal "record number" of a rowid table only works for a single row declared as exactly INTEGER PRIMARY KEY and in a rowid table. If a table contains a field name rowid that has any different definition (even INT PRIMARY KEY), it will be just an ordinary

Re: [sqlite] [EXTERNAL] Opening a DataBase file with a custom "user data" parameter

2019-02-21 Thread Hick Gunter
Use the URI format to specify the name of your cipher object and dynamically locate it within your vfs code. e.g. ATTACH 'file:custom.db?vfs=myvfs=mylib:entry' as secret; -Original Message- From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Esenthel

Re: [sqlite] WITHOUT ROWID tables with a ROWID

2019-02-21 Thread David Raymond
Take a look at https://www.sqlite.org/lang_createtable.html Under the section "ROWIDs and the INTEGER PRIMARY KEY" "If a table contains a user defined column named "rowid", "oid" or "_rowid_", then that name always refers the explicitly declared column and cannot be used to retrieve the integer

Re: [sqlite] WITHOUT ROWID tables with a ROWID

2019-02-21 Thread J. King
On 2019-02-21 15:02:23, "Tom Bassel" wrote: Are tables t3, t4, and t5 below working as designed? Yes. See : > The rowid value can be accessed using one of the special case-independent names "rowid", "oid", or "_rowid_" in place of a column

[sqlite] WITHOUT ROWID tables with a ROWID

2019-02-21 Thread Tom Bassel
Hi, this is my first post to this group. I am not trying to be difficult. I work on an app that uses SQLite as the underlying database engine. At one time years ago I remember assuming that the ROWID column in a table in SQLite would always be an integer. However, I can see a user who is not

[sqlite] Pragma integrity_check

2019-02-21 Thread Voronin, Konstantin
Hi, I have few questions regarding "Pragma integrity_check" 1. I have test table: PRAGMA ignore_check_constraints = true; CREATE TABLE dtest1(the_key INTEGER NOT NULL, versionId INTEGER , primary key (the_key), check( versionId <> 0 ) ) WITHOUT ROWID INSERT into dtest1 values (0,0);

[sqlite] Opening a DataBase file with a custom "user data" parameter

2019-02-21 Thread Esenthel
I'm trying to use "sqlite3_open_v2" with a custom VFS (file system), and pass a pointer "void *user_data" to the sqlite3_open_v2 function, so it gets passed down to the "sqlite3_vfs::xOpen" However there's no option for that, so how to do that? The reason is that for opening files in the custom

Re: [sqlite] Fossil problem ?

2019-02-21 Thread Richard Hipp
On 2/21/19, Domingo Alvarez Duarte wrote: > Hello ! > > I follow the fossil and sqlite3 repository frequently and times to times > this thing happen again: > > Suddenly the my repositories stop following trunk with no clear reason, > like now the sqlite3 repository stopped following trunk for

[sqlite] Fossil problem ?

2019-02-21 Thread Domingo Alvarez Duarte
Hello ! I follow the fossil and sqlite3 repository frequently and times to times this thing happen again: Suddenly the my repositories stop following trunk with no clear reason, like now the sqlite3 repository stopped following trunk for some days and I've tried several times merge the

Re: [sqlite] [EXTERNAL] Choosing one value from the group with priority

2019-02-21 Thread Hick Gunter
There is some magic in SQLite regarding non-aggregate columns in an aggregate query: If there is a single MIN or MAX aggregate function in the GROUP BY, then the non-aggegate columns will be chosen from tha particular row SELECT id, MIN(source_id),value FROM test WHERE id IN (1,2) GROUP BY 1;