Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add foreign key support for every new created connection

  • Loading branch information...
commit 35d588bc0c464c08eab6a4dbcbc2025060d6d218 1 parent ec4f4af
Anton authored April 26, 2011

Showing 1 changed file with 4 additions and 1 deletion. Show diff stats Hide diff stats

  1. 5  backends/sqlite/Database/Sqlite.hs
5  backends/sqlite/Database/Sqlite.hs
@@ -163,7 +163,10 @@ open :: Text -> IO Connection
163 163
 open path = do
164 164
   databaseOrError <- openError path
165 165
   case databaseOrError of
166  
-    Left database -> return database
  166
+    Left database -> do
  167
+                     st <- prepare database "PRAGMA foreign_keys = ON"
  168
+                     step st
  169
+                     return database
167 170
     Right error -> sqlError Nothing ("open " `mappend` (pack $ show path)) error
168 171
 
169 172
 foreign import ccall "sqlite3_close"

0 notes on commit 35d588b

Please sign in to comment.
Something went wrong with that request. Please try again.