Skip to content

v1.3.0

Latest
Compare
Choose a tag to compare
@mpscholten mpscholten released this 05 May 00:45
· 51 commits to master since this release

IHP is a modern batteries-included haskell web framework, built on top of Haskell and Nix. Blazing fast, secure, easy to refactor and the best developer experience with everything you need - from prototype to production.

This release brings many small quality of life improvements to IHP, fixes lots of bugs and comes with several helpful documentation improvements. There's been over 190 commits since v1.2.0

Major Changes

  • New CLI command: new-session-secret:
    Until now it's always been a bit tricky to get a new secret for the IHP_SESSION_SECRET env var. To fix that we've added a new new-section-secret command. Run it from the command line inside your IHP project, and it will generate a new random key to use for the IHP_SESSION_SECRET env var:

    $ new-session-secret
    1J8jtRW331a0IbHBCHmsFNoesQUNFnuHqY8cB5927KsoV5sYmiq3DMmvsYk5S7EDma9YhqZLZWeTFu2pGOxMT2F/5PnifW/5ffwJjZvZcJh9MKPh3Ez9fmPEyxZBDxVp
  • Proper support for non id primary keys:
    Previously IHP assumed that your tables primary keys are called id, and that you don't use composite primary keys.

    With this release the following SQL schema will compile without any errors:

    CREATE TABLE bits (
        bit_arbitrary_ident UUID DEFAULT uuid_generate_v4() PRIMARY KEY NOT NULL
    );
    CREATE TABLE parts (
        part_arbitrary_ident UUID DEFAULT uuid_generate_v4() PRIMARY KEY NOT NULL
    );
    CREATE TABLE bit_part_refs (
        bit_ref UUID NOT NULL,
        part_ref UUID NOT NULL,
        PRIMARY KEY(bit_ref, part_ref)
    );
  • GHC Upgrade: 9.4 -> 9.8.2

  • New Function: sqlQuerySingleRow:
    Runs a raw sql query, that is expected to return a single result row
    Like 'sqlQuery', but useful when you expect only a single row as the result

    do
        user <- sqlQuerySingleRow "SELECT id, firstname, lastname FROM users WHERE id = ?" (Only userId)
  • New Function: sqlExecDiscardResult:
    Runs a sql statement (like a CREATE statement), but doesn't return any result

    sqlExecDiscardResult "CREATE TABLE users ()" ()

    There's now also updateRecordDiscardResult, which is like updateRecord, but doesn't return the updated record.

  • Worker support exponential backoff:

    instance Job DraftEmailJob where
        backoffStrategy = ExponentialBackoff { delayInSeconds = 30 }
        perform job = do
            -- ...

Minor Changes

Docs

We've made some major improvements to the Deployment Guide. With a focus on deploying to NixOS servers running on AWS EC2 and how to connect your server to CloudWatch.

Full Changelog: v1.2.0...v1.3.0

Updating

→ See the UPGRADE.md for upgrade instructions.


If you have any problems with updating, let us know on the IHP Discourse.

📧 To stay in the loop, subscribe to the IHP release emails (right at the bottom of the page). Or follow digitally induced on twitter.