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.

  1. insertMany :: forall record (m :: Type -> Type) . (PersistStoreWrite backend, MonadIO m, PersistRecordBackend record backend, SafeToInsert record) => [record] -> ReaderT backend m [Key record]

    persistent-redis Database.Persist.Redis

    Create multiple records in the database and return their Keys. If you don't need the inserted Keys, use insertMany_. The MongoDB and PostgreSQL backends insert all records and retrieve their keys in one database query. The SQLite and MySQL backends use the slow, default implementation of mapM insert.

    Example usage

    with schema-1 and dataset-1,
    insertUsers :: MonadIO m => ReaderT SqlBackend m [Key User]
    insertUsers = insertMany [User "John" 30, User "Nick" 32, User "Jane" 20]
    
    userIds <- insertUsers
    
    The above query when applied on dataset-1, will produce this:
    +-----+------+-----+
    |id   |name  |age  |
    +-----+------+-----+
    |1    |SPJ   |40   |
    +-----+------+-----+
    |2    |Simon |41   |
    +-----+------+-----+
    |3    |John  |30   |
    +-----+------+-----+
    |4    |Nick  |32   |
    +-----+------+-----+
    |5    |Jane  |20   |
    +-----+------+-----+
    

  2. insertMany_ :: forall record (m :: Type -> Type) . (PersistStoreWrite backend, MonadIO m, PersistRecordBackend record backend, SafeToInsert record) => [record] -> ReaderT backend m ()

    persistent-redis Database.Persist.Redis

    Same as insertMany, but doesn't return any Keys. The MongoDB, PostgreSQL, SQLite and MySQL backends insert all records in one database query.

    Example usage

    With schema-1 and dataset-1,
    insertUsers_ :: MonadIO m => ReaderT SqlBackend m ()
    insertUsers_ = insertMany_ [User "John" 30, User "Nick" 32, User "Jane" 20]
    
    The above query when applied on dataset-1, will produce this:
    +-----+------+-----+
    |id   |name  |age  |
    +-----+------+-----+
    |1    |SPJ   |40   |
    +-----+------+-----+
    |2    |Simon |41   |
    +-----+------+-----+
    |3    |John  |30   |
    +-----+------+-----+
    |4    |Nick  |32   |
    +-----+------+-----+
    |5    |Jane  |20   |
    +-----+------+-----+
    

  3. putMany :: forall record (m :: Type -> Type) . (PersistUniqueWrite backend, MonadIO m, PersistRecordBackend record backend, SafeToInsert record) => [record] -> ReaderT backend m ()

    persistent-redis Database.Persist.Redis

    Put many records into db

    • insert new records that do not exist (or violate any unique constraints)
    • replace existing records (matching any unique constraint)

  4. repsertMany :: forall record (m :: Type -> Type) . (PersistStoreWrite backend, MonadIO m, PersistRecordBackend record backend) => [(Key record, record)] -> ReaderT backend m ()

    persistent-redis Database.Persist.Redis

    Put many entities into the database. Batch version of repsert for SQL backends. Useful when migrating data from one entity to another and want to preserve ids.

    Example usage

    With schema-1 and dataset-1,
    repsertManyUsers :: MonadIO m =>ReaderT SqlBackend m ()
    repsertManyusers = repsertMany [(simonId, User "Philip" 20), (unknownId999, User "Mr. X" 999)]
    
    The above query when applied on dataset-1, will produce this:
    +-----+----------------+---------+
    |id   |name            |age      |
    +-----+----------------+---------+
    |1    |SPJ             |40       |
    +-----+----------------+---------+
    |2    |Simon -> Philip |41 -> 20 |
    +-----+----------------+---------+
    |999  |Mr. X           |999      |
    +-----+----------------+---------+
    

  5. executeMany :: forall q (m :: Type -> Type) . (ToRow q, MonadIO m) => Query -> [q] -> DBT m Int64

    pg-transact Database.PostgreSQL.Transact

    Execute a multi-row INSERT, UPDATE, or other SQL query that is not expected to return results. Returns the number of rows affected. If the list of parameters is empty, this function will simply return 0 without issuing the query to the backend. If this is not desired, consider using the Values constructor instead. Throws FormatError if the query could not be formatted correctly, or a SqlError exception if the backend returns an error. For example, here's a command that inserts two rows into a table with two columns:

    executeMany [sql|
    INSERT INTO sometable VALUES (?,?)
    |] [(1, "hello"),(2, "world")]
    
    Here's an canonical example of a multi-row update command:
    executeMany [sql|
    UPDATE sometable
    SET sometable.y = upd.y
    FROM (VALUES (?,?)) as upd(x,y)
    WHERE sometable.x = upd.x
    |] [(1, "hello"),(2, "world")]
    

  6. RestartOnAny :: TerminalMode

    posix-pty System.Posix.Pty

    IXANY - Enable any character to restart output

  7. fdw_too_many_handles :: ByteString

    postgresql-typed Database.PostgreSQL.Typed.ErrCodes

    FDW_TOO_MANY_HANDLES: HV014 (Error)

  8. too_many_arguments :: ByteString

    postgresql-typed Database.PostgreSQL.Typed.ErrCodes

    TOO_MANY_ARGUMENTS: 54023 (Error)

  9. too_many_columns :: ByteString

    postgresql-typed Database.PostgreSQL.Typed.ErrCodes

    TOO_MANY_COLUMNS: 54011 (Error)

  10. too_many_connections :: ByteString

    postgresql-typed Database.PostgreSQL.Typed.ErrCodes

    TOO_MANY_CONNECTIONS: 53300 (Error)

Page 242 of many | Previous | Next