mirror of
https://github.com/khibino/haskell-relational-record.git
synced 2025-01-06 04:16:21 +03:00
Renamed.
This commit is contained in:
parent
e18c8f508c
commit
8f8c59b064
@ -36,7 +36,7 @@ import qualified Language.SQL.SqlWord as SQL
|
||||
import Database.HDBC.Schema.Driver (Driver, getFields, getPrimaryKey, emptyDriver)
|
||||
|
||||
|
||||
$(Base.defineTableDefault'
|
||||
$(Base.defineRecordDefault
|
||||
"SYSCAT" "columns"
|
||||
[
|
||||
-- column schema type length NULL
|
||||
|
@ -7,7 +7,7 @@ import Database.HDBC.SqlValueExtra ()
|
||||
import Database.HDBC.TH (derivingShow)
|
||||
import qualified Database.HDBC.TH as Base
|
||||
|
||||
$(Base.defineTableDefault
|
||||
$(Base.defineRecordDefault
|
||||
"PG_CATALOG" "pg_attribute"
|
||||
|
||||
[
|
||||
|
@ -7,7 +7,7 @@ import Database.HDBC.SqlValueExtra ()
|
||||
import Database.HDBC.TH (derivingShow)
|
||||
import qualified Database.HDBC.TH as Base
|
||||
|
||||
$(Base.defineTableDefault
|
||||
$(Base.defineRecordDefault
|
||||
"PG_CATALOG" "pg_type"
|
||||
|
||||
[
|
||||
|
@ -30,8 +30,8 @@ module Database.HDBC.TH (
|
||||
definePersistableInstance,
|
||||
defineRecordDecomposeFunction,
|
||||
|
||||
defineTable,
|
||||
defineTableDefault',
|
||||
defineRecord,
|
||||
defineRecordDefault,
|
||||
|
||||
defineConstantSql,
|
||||
defineSqlPrimarySelect,
|
||||
@ -258,13 +258,13 @@ defineRecordDecomposeFunction funName' typeCon fields = do
|
||||
[] ]
|
||||
return [sig, var]
|
||||
|
||||
defineTable :: (VarName, VarName)
|
||||
defineRecord :: (VarName, VarName)
|
||||
-> (String, ConName)
|
||||
-> (VarName, VarName, VarName)
|
||||
-> [((VarName, TypeQ), String)]
|
||||
-> [ConName]
|
||||
-> Q [Dec]
|
||||
defineTable
|
||||
defineRecord
|
||||
(cF, dF) (tableSQL, tyC)
|
||||
(tableN, fldsN, widthN)
|
||||
schemas' drvs = do
|
||||
@ -281,15 +281,15 @@ defineTable
|
||||
instSQL <- definePersistableInstance widthN typeCon cF dF width
|
||||
return $ typ : fromSQL ++ toSQL ++ tableI ++ instSQL
|
||||
|
||||
defineTableDefault' :: String
|
||||
defineRecordDefault :: String
|
||||
-> String
|
||||
-> [(String, TypeQ)]
|
||||
-> [ConName]
|
||||
-> Q [Dec]
|
||||
defineTableDefault' schema table fields drives = do
|
||||
defineRecordDefault schema table fields drives = do
|
||||
let tableSQL = nameOfTableSQL schema table
|
||||
fields' = map (uncurry fieldInfo) fields
|
||||
defineTable
|
||||
defineRecord
|
||||
(table `varNameWithPrefix` "fromSqlOf",
|
||||
table `varNameWithPrefix` "toSqlOf")
|
||||
(tableSQL, recordTypeNameDefault table)
|
||||
@ -401,7 +401,7 @@ defineTableDefault :: String
|
||||
-> [ConName]
|
||||
-> Q [Dec]
|
||||
defineTableDefault schema table fields derives = do
|
||||
recD <- defineTableDefault' schema table fields derives
|
||||
recD <- defineRecordDefault schema table fields derives
|
||||
sqlD <- defineSqlsDefault schema table fields
|
||||
return $ recD ++ sqlD
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user