mirror of
https://github.com/khibino/haskell-relational-record.git
synced 2025-01-07 13:46:41 +03:00
relational-query: update along with deprecations.
This commit is contained in:
parent
aeec06631d
commit
200f6c3d6f
@ -37,7 +37,7 @@ import Database.Record.ToSql (unsafeUpdateValuesWithIndexes)
|
||||
import Database.Relational.SqlSyntax (Record)
|
||||
|
||||
import Database.Relational.Table (Table, TableDerivable)
|
||||
import Database.Relational.Pi.Unsafe (Pi, unsafeExpandIndexes)
|
||||
import Database.Relational.Pi (Pi, expandIndexes)
|
||||
import qualified Database.Relational.Record as Record
|
||||
import Database.Relational.Projectable (placeholder, (.=.), (!))
|
||||
import Database.Relational.Monad.Class (wheres)
|
||||
@ -106,7 +106,7 @@ updateValuesWithKey :: ToSql q r
|
||||
=> Pi r p
|
||||
-> r
|
||||
-> [q]
|
||||
updateValuesWithKey = unsafeUpdateValuesWithIndexes . unsafeExpandIndexes
|
||||
updateValuesWithKey = unsafeUpdateValuesWithIndexes . expandIndexes
|
||||
|
||||
-- | Typed 'KeyUpdate' using specified constraint key.
|
||||
updateByConstraintKey :: Table r -- ^ 'Table' to update
|
||||
|
@ -35,8 +35,7 @@ import Database.Record.ToSql (untypedUpdateValuesIndex)
|
||||
import Database.Relational.Internal.String
|
||||
(StringSQL, stringSQL, showStringSQL, rowConsStringSQL, )
|
||||
|
||||
import Database.Relational.Pi (Pi)
|
||||
import qualified Database.Relational.Pi.Unsafe as UnsafePi
|
||||
import Database.Relational.Pi (Pi, expandIndexes')
|
||||
import Database.Relational.Table (Table, name, columns, recordWidth)
|
||||
import qualified Database.Relational.Record as Record
|
||||
|
||||
@ -88,7 +87,7 @@ updateOtherThanKeySQL :: Table r -- ^ Table metadata
|
||||
-> Pi r p -- ^ Key columns
|
||||
-> String -- ^ Result SQL
|
||||
updateOtherThanKeySQL tbl key =
|
||||
updateOtherThanKeySQL' (name tbl) (columns tbl) (UnsafePi.unsafeExpandIndexes' (recordWidth tbl) key)
|
||||
updateOtherThanKeySQL' (name tbl) (columns tbl) (expandIndexes' (recordWidth tbl) key)
|
||||
|
||||
-- | Generate prefix string of insert SQL.
|
||||
insertPrefixSQL :: Pi r r' -> Table r -> StringSQL
|
||||
|
Loading…
Reference in New Issue
Block a user