relational-query: update along with deprecations.

This commit is contained in:
Kei Hibino 2019-05-03 22:15:42 +09:00
parent aeec06631d
commit 200f6c3d6f
2 changed files with 4 additions and 5 deletions

View File

@ -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

View File

@ -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