Changelog for postgresql-connection-string-0.1
0.1.0.0
Initial release of postgresql-connection-string as a standalone library.
This library was extracted from the hasql project to provide a focused, reusable component for parsing and constructing PostgreSQL connection strings.
Features
- Parse PostgreSQL connection URIs (
postgresql://
andpostgres://
schemes) - Parse keyword/value format connection strings
- Construct connection strings programmatically using composable combinators
- Convert between URI and keyword/value formats
- Support for multiple host specifications (for failover/load balancing)
- Automatic percent-encoding/decoding of special characters
- Type-safe representation with
ConnectionString
data type
API
Constructors
hostAndPort
- Specify a host and optional portuser
- Set the usernamepassword
- Set the passworddbname
- Set the database nameparam
- Add a connection parameter
Accessors
toHosts
- Get list of hosts and portstoUser
- Get usernametoPassword
- Get passwordtoDbname
- Get database nametoParams
- Get parameter map
Rendering
toUrl
- Convert to URI formattoKeyValueString
- Convert to keyword/value format
Parsing
parseText
- Parse from Text with error reportingparserOf
- Get the underlying Megaparsec parser
Transformations
interceptParam
- Extract and remove a parameter