Hoogle Search
Within LTS Haskell 24.40 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
connPutManySql :: SqlBackend -> Maybe (EntityDef -> Int -> Text)persistent Database.Persist.Sql.Types.Internal Some databases support performing bulk UPSERT, specifically "insert or replace many records" in a single call. This field when set, given * an entity definition * number of records to be inserted should produce a PUT MANY sql with placeholders for records When left as Nothing, we default to using defaultPutMany.
connRepsertManySql :: SqlBackend -> Maybe (EntityDef -> Int -> Text)persistent Database.Persist.Sql.Types.Internal Some databases support performing bulk an atomic+bulk INSERT where constraint conflicting entities can replace existing entities. This field when set, given * an entity definition * number of records to be inserted should produce a INSERT sql with placeholders for primary+record fields When left as Nothing, we default to using defaultRepsertMany.
-
persistent Database.Persist.SqlBackend Set the connInsertManySql field on the SqlBackend. This should only be used by the database backend library to provide an efficient implementation of a bulk insert function. If this is not set, a slow default will be used.
setConnPutManySql :: (EntityDef -> Int -> Text) -> SqlBackend -> SqlBackendpersistent Database.Persist.SqlBackend Set the 'connPutManySql field on the SqlBackend. This should only be used by the database backend library to provide an efficient implementation of a bulk insert function. If this is not set, a slow default will be used.
setConnRepsertManySql :: (EntityDef -> Int -> Text) -> SqlBackend -> SqlBackendpersistent Database.Persist.SqlBackend Set the connRepsertManySql field on the SqlBackend. This should only be set by the database backend library. If this is not set, a slow default will be used.
connInsertManySql :: SqlBackend -> Maybe (EntityDef -> [[PersistValue]] -> InsertSqlResult)persistent Database.Persist.SqlBackend.Internal SQL for inserting many rows and returning their primary keys, for backends that support this functionality. If Nothing, rows will be inserted one-at-a-time using connInsertSql.
connPutManySql :: SqlBackend -> Maybe (EntityDef -> Int -> Text)persistent Database.Persist.SqlBackend.Internal Some databases support performing bulk UPSERT, specifically "insert or replace many records" in a single call. This field when set, given * an entity definition * number of records to be inserted should produce a PUT MANY sql with placeholders for records When left as Nothing, we default to using defaultPutMany.
connRepsertManySql :: SqlBackend -> Maybe (EntityDef -> Int -> Text)persistent Database.Persist.SqlBackend.Internal Some databases support performing bulk an atomic+bulk INSERT where constraint conflicting entities can replace existing entities. This field when set, given * an entity definition * number of records to be inserted should produce a INSERT sql with placeholders for primary+record fields When left as Nothing, we default to using defaultRepsertMany.
ISRManyKeys :: Text -> [PersistValue] -> InsertSqlResultpersistent Database.Persist.SqlBackend.Internal.InsertSqlResult No documentation available.
persistManyFileWith :: PersistSettings -> [FilePath] -> Q Exppersistent Database.Persist.TH Same as persistFileWith, but uses several external files instead of one. Splitting your Persistent definitions into multiple modules can potentially dramatically speed up compile times. The recommended file extension is .persistentmodels.
Examples
Split your Persistent definitions into multiple files (models1, models2), then create a new module for each new file and run mkPersist there:-- Model1.hs share [mkPersist sqlSettings] $(persistFileWith lowerCaseSettings "models1")
-- Model2.hs share [mkPersist sqlSettings] $(persistFileWith lowerCaseSettings "models2")
Use persistManyFileWith to create your migrations:-- Migrate.hs mkMigrate "migrateAll" $(persistManyFileWith lowerCaseSettings ["models1.persistentmodels","models2.persistentmodels"])
Tip: To get the same import behavior as if you were declaring all your models in one file, import your new files as Name into another file, then export module Name. This approach may be used in the future to reduce memory usage during compilation, but so far we've only seen mild reductions. See persistent#778 and persistent#791 for more details.