Re: [sqlite] Support for named foreign keys?

2017-09-24 Thread Scott Robison
Ah, I misread. Sorry for the noise. On Sep 24, 2017 4:59 PM, "Keith Medcalf" wrote: > > I don't think so. The question is about interpreting the schema, not > about executing anything at all. > > > --- > The fact that there's a Highway to Hell but only a Stairway to Heaven

Re: [sqlite] Support for named foreign keys?

2017-09-24 Thread Keith Medcalf
I don't think so. The question is about interpreting the schema, not about executing anything at all. --- 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-

Re: [sqlite] Support for named foreign keys?

2017-09-24 Thread Scott Robison
I think he's asking for FK constraint names to be reported in conflict messages which has been requested in the past, but not included up until now because of the approach taken. On Sep 24, 2017 4:16 PM, "Keith Medcalf" wrote: > > Why do you think this? > > The syntax

Re: [sqlite] Support for named foreign keys?

2017-09-24 Thread Keith Medcalf
Why do you think this? The syntax diagrams are quite clear that FOREIGN KEY constraints can be named. sqlite> create table parent ...> (id integer primary key); sqlite> create table child ...> (fk integer null, ...> constraint dippydoo foreign key (fk) references parent(id)); sqlite>

Re: [sqlite] Support for named foreign keys?

2017-09-24 Thread petern
Definitely what Clemens said: https://www.sqlite.org/syntax/table-constraint.html But you probably want to see all the FK's, not merely named ones. I suggest parsing for the 'REFERENCES' keyword of the table schemas stored in sqlite_master (or .schema report of the shell tool). You can fix the

Re: [sqlite] Support for named foreign keys?

2017-09-24 Thread Clemens Ladisch
Csányi Pál wrote: > when will SQLite support the named foreign keys? It does support named foreign keys: CREATE TABLE t ( id PRIMARY KEY, k1 CONSTRAINT name_here REFERENCES t, k2, CONSTRAINT another_name FOREIGN KEY(k2) REFERENCES t ); Regards, Clemens

Re: [sqlite] Bash script error - sqlite3.c

2017-09-24 Thread Jens Alfke
> On Sep 23, 2017, at 8:32 PM, Gashi Lulzim wrote: > > Then I need to run ./build.sh to build libraries but I'm getting this error > while trying to execute ./build.sh on mac. Please anyone can help what to > do ? This isn’t a SQLite-related issue; it’s related to

[sqlite] Support for named foreign keys?

2017-09-24 Thread Csányi Pál
Hi, when will SQLite support the named foreign keys? I am using SchemaCrawler to visualize my SQLite databases and because SQLite does not support it yet, foreign keys get automatically generated foreign key names in the diagram. So it would be nice if SQLite would support it one day. Is'n it?

Re: [sqlite] Is this behavior expected?

2017-09-24 Thread Keith Medcalf
Yes. last_insert_rowid() returns data stored in the connection. It is "loaded" with a value when an insert occurs on the connection. Even if you rollback the transaction, the value of the data item stored in the connection is not changed -- the last inserted rowid on the connection was

Re: [sqlite] Is this behavior expected?

2017-09-24 Thread Clemens Ladisch
Baruch Burstein wrote: > sqlite> select last_insert_rowid(); > 2 > sqlite> rollback; > sqlite> select last_insert_rowid(); > 2 > > In other words, the rollback doesn't roll back the rowid. says: | For the purposes of this routine, an INSERT is

Re: [sqlite] Is this behavior expected?

2017-09-24 Thread Igor Korot
Hi, On Sun, Sep 24, 2017 at 7:46 AM, Baruch Burstein wrote: > SQLite version 3.20.1 2017-08-24 16:21:36 > sqlite> create table T(C); > sqlite> insert into T values("test 1"); > sqlite> select last_insert_rowid(); > 1 > sqlite> begin; > sqlite> insert into T values("test

[sqlite] Is this behavior expected?

2017-09-24 Thread Baruch Burstein
SQLite version 3.20.1 2017-08-24 16:21:36 sqlite> create table T(C); sqlite> insert into T values("test 1"); sqlite> select last_insert_rowid(); 1 sqlite> begin; sqlite> insert into T values("test 2"); sqlite> select last_insert_rowid(); 2 sqlite> rollback; sqlite> select last_insert_rowid(); 2

Re: [sqlite] checking if a table exists

2017-09-24 Thread John McMahon
On 23/09/2017 05:36, mikeegg1 wrote: I’m using the statement: select count(*) from sqlite_master where type = 'table' and name = ‘$NAME’; This statement works fine in the sqlite3 shell. This statement does not work in my API. Is there a PRAGMA I need to issue so I can check for table

[sqlite] Bash script error - sqlite3.c

2017-09-24 Thread Gashi Lulzim
I'm trying to get ARToolkit5 Android Examples and run on my device from this official repo ARToolkit5 GithubRepo . Then I need to run ./build.sh to build libraries but I'm getting this error while trying to execute ./build.sh on mac. Please anyone can help