[prev in list] [next in list] [prev in thread] [next in thread]
List: haskell-beginners
Subject: [Haskell-beginners] Sqlite3 pragma statements
From: Paul Higham <polygame () mac ! com>
Date: 2013-04-28 16:02:27
Message-ID: D2B631F2-FE36-403D-8A94-F9F4443D304D () mac ! com
[Download RAW message or body]
I am using sqlite3 as a backend database for an application that I am writing in \
Haskell. In the database schema there are a number of foreign key constraints but \
sqlite3 has the referential integrity constraint checking turned off by default. To \
turn on the constraint checking one needs to have issued the following command
pragma foreign_keys = ON;
for every connection to the database. This works if done directly in the sqlite3 \
shell, but I want to do in from Haskell code. The obvious thing to try would be
runRaw conn "pragma foreign_keys = on"
and this does in fact run with no errors. However the constraint checking does not \
appear to be happening since I can subsequently add rows to a table that violate the \
foreign key constraint.
I have found no documented way to issue pragma commands in either Database.HDBC or \
Database.HDBC.Sqlite3, nor has a google search turned up anything that works.
Does anyone have any ideas?
Thanx!
> > paul
_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic