Re: [sqlite] is this possible

2019-03-28 Thread Amit Yaron
From the page https://sqlite.org/lang_createview.html : "The CREATE VIEW command assigns a name to a pre-packaged SELECT statement ..." So, it seems that the command "CREATE VIEW" just creates a name for a SELECT statement, and checks nothing more than syntax. On 28.3.2019 21:21, Mark Wagne

Re: [sqlite] How to refer to `this` table?

2019-02-22 Thread Amit Yaron
Try creating a trigger(https://sqlite.org/lang_createtrigger.html) instead of the constraint "noCircularRef_when the table already exists. On 23.2.2019 8:43, Rocky Ji wrote: If I do CREATE TABLE Sample ( id INTEGER PRIMARY KEY AUTOINCREMENT, parent_id INTEGER, CONSTRAINT p FOREIGN KEY

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

2019-02-22 Thread Amit Yaron
Is "sqlite3_serialize" (https://sqlite.org/c3ref/serialize.html) helpful? On 22.2.2019 8:57, heribert wrote: 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

Re: [sqlite] why no unique columns on alter table

2019-02-12 Thread Amit Yaron
Probably because altering a table is done by changing the value of column SQL in table 'sqlite_master'. Adding a unique constraint requires value checks. On 12.2.2019 6:15, Mark Wagner wrote: This is mainly for my curiosity. Is there any particular reason that one can't add a unique column on