mirror of
https://github.com/khibino/haskell-relational-record.git
synced 2024-12-27 14:02:35 +03:00
relational-query: drop old internal API.
This commit is contained in:
parent
ed871187e5
commit
c8fbad4cb9
@ -15,14 +15,10 @@ module Database.Relational.SimpleSql (
|
||||
QuerySuffix, showsQuerySuffix,
|
||||
|
||||
-- * Update SQL
|
||||
updatePrefixSQL,
|
||||
updateOtherThanKeySQL,
|
||||
|
||||
-- * Insert SQL
|
||||
insertPrefixSQL,
|
||||
|
||||
-- * Delete SQL
|
||||
deletePrefixSQL
|
||||
) where
|
||||
|
||||
import Data.Array (listArray, (!))
|
||||
@ -47,10 +43,6 @@ type QuerySuffix = [Keyword]
|
||||
showsQuerySuffix :: QuerySuffix -> StringSQL
|
||||
showsQuerySuffix = mconcat
|
||||
|
||||
-- | Generate prefix string of update SQL.
|
||||
updatePrefixSQL :: Table r -> StringSQL
|
||||
updatePrefixSQL table = UPDATE <> stringSQL (name table)
|
||||
|
||||
-- | Generate update SQL by specified key and table.
|
||||
-- Columns name list of table are also required.
|
||||
updateSQL' :: String -- ^ Table name
|
||||
@ -94,8 +86,3 @@ insertPrefixSQL :: Pi r r' -> Table r -> StringSQL
|
||||
insertPrefixSQL pi' table =
|
||||
INSERT <> INTO <> stringSQL (name table) <> rowConsStringSQL cols where
|
||||
cols = Record.columns . Record.wpi (recordWidth table) (Record.unsafeFromTable table) $ pi'
|
||||
|
||||
-- | Generate all column delete SQL by specified table.
|
||||
deletePrefixSQL :: Table r -- ^ Table metadata
|
||||
-> StringSQL -- ^ Result SQL
|
||||
deletePrefixSQL table = DELETE <> FROM <> stringSQL (name table)
|
||||
|
Loading…
Reference in New Issue
Block a user