From 50ab897862df6c9a924186370bf34f0e69322574 Mon Sep 17 00:00:00 2001 From: Kei Hibino Date: Tue, 26 Mar 2013 21:38:42 +0900 Subject: [PATCH] Renamed. --- schema-th/src/Database/HDBC/TH.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/schema-th/src/Database/HDBC/TH.hs b/schema-th/src/Database/HDBC/TH.hs index 190250dc..635f63d9 100644 --- a/schema-th/src/Database/HDBC/TH.hs +++ b/schema-th/src/Database/HDBC/TH.hs @@ -40,7 +40,7 @@ module Database.HDBC.TH ( defineSqls, defineSqlsDefault, - defineTableDefault, + defineWithTableDefault, defineWithPrimaryKeyDefault, defineWithNotNullKeyDefault, @@ -395,12 +395,12 @@ defineSqlsWithPrimaryKeyDefault schema table fields idx = sel = table `varNameWithPrefix` "select" upd = table `varNameWithPrefix` "update" -defineTableDefault :: String +defineWithTableDefault :: String -> String -> [(String, TypeQ)] -> [ConName] -> Q [Dec] -defineTableDefault schema table fields derives = do +defineWithTableDefault schema table fields derives = do recD <- defineRecordDefault schema table fields derives sqlD <- defineSqlsDefault schema table fields return $ recD ++ sqlD @@ -441,7 +441,7 @@ defineTableFromDB connect drv scm tbl derives = do return (cols, notNullIdxs, mayPrimaryIdx) ) (cols, notNullIdxs, mayPrimaryIdx) <- runIO getDBinfo - tblD <- defineTableDefault scm tbl cols derives + tblD <- defineWithTableDefault scm tbl cols derives primD <- mayDeclare (defineWithPrimaryKeyDefault scm tbl cols) mayPrimaryIdx nnD <- mayDeclare (defineWithNotNullKeyDefault tbl) (listToMaybe notNullIdxs) return $ tblD ++ primD ++ nnD