createSession :: Connection 
              -> Int -- ^ User ID
              -> ActionM (Maybe CardUserSession)
createSession conn userId = 
    liftIO $ listToMaybe <$> query conn createQuery (Only userId)
  where
    createQuery = "INSERT INTO carduser_session (id, user_id, expires) VALUES (gen_random_uuid(), ?, NOW() + '2 WEEKS') RETURNING *"
createSession :: Connection 
              -> Int -- ^ User ID
              -> ActionM (Maybe CardUserSession)
createSession conn userId = 
    liftIO $ listToMaybe <$> query conn createQuery (Only userId)
  where
    createQuery = "INSERT INTO carduser_session (id, user_id, expires) VALUES (gen_random_uuid(), ?, NOW() + '2 WEEKS') RETURNING *"
createSession conn userId = 
    liftIO $ listToMaybe <$> query conn createQuery (Only userId)
  where
    createQuery = "INSERT INTO carduser_session (id, user_id, expires) VALUES (gen_random_uuid(), ?, NOW() + '2 WEEKS') RETURNING *"