Hoogle Search
Within LTS Haskell 24.26 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
SomePostgreSqlException :: e -> SomePostgreSqlExceptionpostgresql-simple Database.PostgreSQL.Simple No documentation available.
connectPostgreSQL :: ByteString -> IO Connectionpostgresql-simple Database.PostgreSQL.Simple Attempt to make a connection based on a libpq connection string. See https://www.postgresql.org/docs/9.5/static/libpq-connect.html#LIBPQ-CONNSTRING for more information. Also note that environment variables also affect parameters not provided, parameters provided as the empty string, and a few other things; see https://www.postgresql.org/docs/9.5/static/libpq-envars.html for details. Here is an example with some of the most commonly used parameters:
host='db.somedomain.com' port=5432 ...
This attempts to connect to db.somedomain.com:5432. Omitting the port will normally default to 5432. On systems that provide unix domain sockets, omitting the host parameter will cause libpq to attempt to connect via unix domain sockets. The default filesystem path to the socket is constructed from the port number and the DEFAULT_PGSOCKET_DIR constant defined in the pg_config_manual.h header file. Connecting via unix sockets tends to use the peer authentication method, which is very secure and does not require a password. On Windows and other systems without unix domain sockets, omitting the host will default to localhost.... dbname='postgres' user='postgres' password='secret \' \\ pw'
This attempts to connect to a database named postgres with user postgres and password secret ' \ pw. Backslash characters will have to be double-quoted in literal Haskell strings, of course. Omitting dbname and user will both default to the system username that the client process is running as. Omitting password will default to an appropriate password found in the pgpass file, or no password at all if a matching line is not found. The path of the pgpass file may be specified by setting the PGPASSFILE environment variable. See https://www.postgresql.org/docs/9.5/static/libpq-pgpass.html for more information regarding this file. As all parameters are optional and the defaults are sensible, the empty connection string can be useful for development and exploratory use, assuming your system is set up appropriately. On Unix, such a setup would typically consist of a local postgresql server listening on port 5432, as well as a system user, database user, and database sharing a common name, with permissions granted to the user on the database. On Windows, in addition you will either need pg_hba.conf to specify the use of the trust authentication method for the connection, which may not be appropriate for multiuser or production machines, or you will need to use a pgpass file with the password or md5 authentication methods. See https://www.postgresql.org/docs/9.5/static/client-authentication.html for more information regarding the authentication process. SSL/TLS will typically "just work" if your postgresql server supports or requires it. However, note that libpq is trivially vulnerable to a MITM attack without setting additional SSL connection parameters. In particular, sslmode needs to be set to require, verify-ca, or verify-full in order to perform certificate validation. When sslmode is require, then you will also need to specify a sslrootcert file, otherwise no validation of the server's identity will be performed. Client authentication via certificates is also possible via the sslcert and sslkey parameters. See https://www.postgresql.org/docs/9.5/static/libpq-ssl.html for detailed information regarding libpq and SSL.-
postgresql-simple Database.PostgreSQL.Simple.Internal Superclass for postgresql exceptions
SomePostgreSqlException :: e -> SomePostgreSqlExceptionpostgresql-simple Database.PostgreSQL.Simple.Internal No documentation available.
connectPostgreSQL :: ByteString -> IO Connectionpostgresql-simple Database.PostgreSQL.Simple.Internal Attempt to make a connection based on a libpq connection string. See https://www.postgresql.org/docs/9.5/static/libpq-connect.html#LIBPQ-CONNSTRING for more information. Also note that environment variables also affect parameters not provided, parameters provided as the empty string, and a few other things; see https://www.postgresql.org/docs/9.5/static/libpq-envars.html for details. Here is an example with some of the most commonly used parameters:
host='db.somedomain.com' port=5432 ...
This attempts to connect to db.somedomain.com:5432. Omitting the port will normally default to 5432. On systems that provide unix domain sockets, omitting the host parameter will cause libpq to attempt to connect via unix domain sockets. The default filesystem path to the socket is constructed from the port number and the DEFAULT_PGSOCKET_DIR constant defined in the pg_config_manual.h header file. Connecting via unix sockets tends to use the peer authentication method, which is very secure and does not require a password. On Windows and other systems without unix domain sockets, omitting the host will default to localhost.... dbname='postgres' user='postgres' password='secret \' \\ pw'
This attempts to connect to a database named postgres with user postgres and password secret ' \ pw. Backslash characters will have to be double-quoted in literal Haskell strings, of course. Omitting dbname and user will both default to the system username that the client process is running as. Omitting password will default to an appropriate password found in the pgpass file, or no password at all if a matching line is not found. The path of the pgpass file may be specified by setting the PGPASSFILE environment variable. See https://www.postgresql.org/docs/9.5/static/libpq-pgpass.html for more information regarding this file. As all parameters are optional and the defaults are sensible, the empty connection string can be useful for development and exploratory use, assuming your system is set up appropriately. On Unix, such a setup would typically consist of a local postgresql server listening on port 5432, as well as a system user, database user, and database sharing a common name, with permissions granted to the user on the database. On Windows, in addition you will either need pg_hba.conf to specify the use of the trust authentication method for the connection, which may not be appropriate for multiuser or production machines, or you will need to use a pgpass file with the password or md5 authentication methods. See https://www.postgresql.org/docs/9.5/static/client-authentication.html for more information regarding the authentication process. SSL/TLS will typically "just work" if your postgresql server supports or requires it. However, note that libpq is trivially vulnerable to a MITM attack without setting additional SSL connection parameters. In particular, sslmode needs to be set to require, verify-ca, or verify-full in order to perform certificate validation. When sslmode is require, then you will also need to specify a sslrootcert file, otherwise no validation of the server's identity will be performed. Client authentication via certificates is also possible via the sslcert and sslkey parameters. See https://www.postgresql.org/docs/9.5/static/libpq-ssl.html for detailed information regarding libpq and SSL.-
Backend for the persistent library using postgresql. Based on the postgresql-simple package
-
persistent-postgresql Database.Persist.Postgresql Wrapper for persistent SqlBackends that carry the corresponding Connection.
RawPostgresql :: backend -> Connection -> RawPostgresql backendpersistent-postgresql Database.Persist.Postgresql No documentation available.
-
persistent-postgresql Database.Persist.Postgresql Create a PostgreSQL connection pool. Note that it's your responsibility to properly close the connection pool when unneeded. Use withPostgresqlPool for an automatic resource control.
-
persistent-postgresql Database.Persist.Postgresql Same as createPostgresqlPool, but additionally takes a callback function for some connection-specific tweaking to be performed after connection creation. This could be used, for example, to change the schema. For more information, see: https://groups.google.com/d/msg/yesodweb/qUXrEN_swEo/O0pFwqwQIdcJ