I am happy to announce release of Groundhog 0.3!<br><br>Groundhog is a library for high-level database access. It has support for Sqlite, PostgreSQL, and a new MySQL backend. Advanced migration capabilities allow you to precisely specify the schema description, fitting it to an existing database, or creating a migration script for a new one. Groundhog is not opinionated about schema and can bind your datatypes to a relational model which may have composite keys, references across different schemas, indexes, etc.<br>
<br>Changes:<br>* Novel mechanism for defining your own functions, operators, or other expressions and combining them in a type-safe manner. The operators LIKE and IN, which appeared in this version, are one-liners based on it. Now you can write advanced queries compositionally without resorting to raw SQL. For example:<br>
    project (upper (ZipCodeField `append` AddressField), NumberField * (NumberField + (1 :: Int))) $ lower NameField `like` &quot;jack%&quot;<br>  will be transformed into SQL query<br>    SELECT upper(zipcode || address), number * (number + ?) FROM tablename WHERE lower(name) like ?<br>
* PostgreSQL backend got support for arrays and geometric datatypes.<br>* First release of MySQL backend (influenced by persistent-mysql).<br>* New class ConnectionManager helps to extract connections from pools, application state, or other sources. Now both plain connections and pools can be run with the same function runDbConn. In particular, this class helps with integrating Groundhog into web applications.<br>
* Support for savepoints (nested transactions).<br>* Schema qualified tables. The entities can be configured with a schema parameter. It defines schema where the table, its triggers, indexes, and other related database objects are stored. Schemas are respected both during migration and when generating queries.<br>
* Custom primary keys. A unique set of fields can be defined as a constraint, index, or primary key. Composite primary keys are supported as well.<br>* Configuration of reference clauses ON DELETE and ON UPDATE.<br>* New class SchemaAnalyzer exposes Groundhog functions for database introspection. In future it can be used to build more powerful migration tools, or generate datatypes from table definitions.<br>
<br>The full description of the configuration options is available at <a href="http://hackage.haskell.org/packages/archive/groundhog-th/0.3.0/doc/html/Database-Groundhog-TH.html">http://hackage.haskell.org/packages/archive/groundhog-th/0.3.0/doc/html/Database-Groundhog-TH.html</a><br>
Please see examples at <a href="http://github.com/lykahb/groundhog/tree/master/examples">http://github.com/lykahb/groundhog/tree/master/examples</a>.<br><br>If you want to integrate Groundhog into your application which is based on Snap, Yesod, or just uses another monad to store connections, see this example  <a href="http://github.com/lykahb/groundhog/blob/master/examples/monadIntegration.hs">http://github.com/lykahb/groundhog/blob/master/examples/monadIntegration.hs</a>. Although there are many new features in this release, Groundhog API is mature enough to minimize the breaking changes. To migrate from Groundhog 2.* replace runSqliteConn/runPostgresqlConn/runSqlitePool/runPostgresqlPool with runDbConn.<br>
<br>Special thanks to MightyByte who suggested to generalize connections and helped to find the design, and to many others who gave their inspiring feedback.<br><br>* <a href="http://github.com/lykahb/groundhog">http://github.com/lykahb/groundhog</a><br>
* <a href="http://hackage.haskell.org/package/groundhog">http://hackage.haskell.org/package/groundhog</a><br>* <a href="http://hackage.haskell.org/package/groundhog-th">http://hackage.haskell.org/package/groundhog-th</a><br>
* <a href="http://hackage.haskell.org/package/groundhog-mysql">http://hackage.haskell.org/package/groundhog-mysql</a><br>* <a href="http://hackage.haskell.org/package/groundhog-postgresql">http://hackage.haskell.org/package/groundhog-postgresql</a><br>
* <a href="http://hackage.haskell.org/package/groundhog-sqlite">http://hackage.haskell.org/package/groundhog-sqlite</a><br><br>Enjoy!<br clear="all"><br>-- <br>Regards,<br>Boris