PRAGMA xxxxx[=xx] is DML not DDL, though it might not return any rows, but it 
is a query.  Have you tried running the pragma foreign_keys=1; as a DML (which 
may return results) rather than as DDL (which do not).  Perhaps the entity 
framework is not executing the statement completely.

---
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 Urs Wagner
>Sent: Thursday, 13 September, 2018 06:36
>To: SQLite mailing list
>Subject: Re: [sqlite] foreign_keys = 0N with Entity Framework 6.2.0
>
>
>Thanks for Your help
>
>I get three lines
>
>explain pragma foreign_keys = on
>
>"0"    "Init"  "0"     "1"     "0"     ""      "00"
>"1"    "Expire"        "0"     "0"     "0"     ""      "00"
>"2"    "Halt"  "0"     "0"     "0"     ""      "00"
>
>explain pragma do_what_i_want
>
>"0"    "Init"  "0"     "1"     "0"     ""      "00"
>"1"    "Halt"  "0"     "0"     "0"     ""      "00"
>
>
>Is think it has to do with the entity framework. When I am using
>ExceuteStoreQuery or SqlQuery the foreign_keys is always 0.
>
>Regards Urs
>
>
>-----Original Message-----
>From: sqlite-users [mailto:sqlite-users-
>boun...@mailinglists.sqlite.org] On Behalf Of Clemens Ladisch
>Sent: Thursday, September 13, 2018 2:23 PM
>To: sqlite-users@mailinglists.sqlite.org
>Subject: Re: [sqlite] foreign_keys = 0N with Entity Framework 6.2.0
>
>Urs Wagner wrote:
>> Simon Slavin:
>>> On 12 Sep 2018, at 2:04pm, Urs Wagner <urs.wag...@man-es.com>
>wrote:
>>>> The following code is returning 0. Why?
>>>>
>>>> ExecuteStoreQuery<int>("PRAGMA foreign_keys;").First();
>>>
>>> You coerce the result of the call into an integer.  Can you make
>the call and display (or use a debugger to see) exactly what it's
>returning ?
>>
>> The result cannot be coerced into a string (compiler error).
>
>How exactly did you try that?
>
>Anyway, how many rows does the corresponding EXPLAIN return, two or
>three?
>
> sqlite> explain pragma foreign_keys = on;
> addr  opcode         p1    p2    p3    p4             p5  comment
> ----  -------------  ----  ----  ----  -------------  --  ----------
>---
> 0     Init           0     1     0                    00  Start at 1
> 1     Expire         0     0     0                    00
> 2     Halt           0     0     0                    00
> sqlite> explain pragma do_what_i_want;
> addr  opcode         p1    p2    p3    p4             p5  comment
> ----  -------------  ----  ----  ----  -------------  --  ----------
>---
> 0     Init           0     1     0                    00  Start at 1
> 1     Halt           0     0     0                    00
>
>
>Regards,
>Clemens
>_______________________________________________
>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

Reply via email to