Skip to content

Commit 5609b96

Browse files
committed
Tidy up
1 parent db918bc commit 5609b96

3 files changed

Lines changed: 10 additions & 15 deletions

File tree

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ Database-agnostic interface to generically persisted data.
55
## Introduction
66

77
Explanation of the above:
8-
- Database-agnostic interface: the typeclass is called `MonadDb`, and you must
9-
specify how it can communicate with your database (we provide an example for
10-
connecting to a PostgreSQL server).
11-
- Generically persisted data: you can derive the necessary instances for your
12-
data types via `Generics`. This will enable `MonadDb` to read/write instances
13-
of your data types to/from your database.
8+
- Database-agnostic: the typeclass is called `MonadDb`, and you must specify how
9+
an instance can communicate with your database. We provide an example for
10+
connecting to PostgreSQL in the [tutorial](tutorial/tutorial/main.hs).
11+
- Generically persisted data: you can derive the necessary instances in one line
12+
via `Generics`, to enable `MonadDb` to read/write instances of your data types
13+
to/from your database.
1414

1515
A key intended feature of this library is that the typeclass `MonadDb` can be
1616
used either server-side or client-side. Allowing your client application (e.g.
@@ -23,7 +23,8 @@ to your database without having to write the usual server boilerplate.
2323

2424
## Quick Start
2525

26-
A tutorial as code exists [here](tutorial/tutorial/Main.hs).
26+
The [tutorial as code](tutorial/tutorial/Main.hs) is the recommended way of
27+
becoming familiar with `database-generic`.
2728

2829
To run the tutorial on your machine:
2930
1. Clone this repo.

database-generic/src/Database/Generic/Entity/FromDb.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
module Database.Generic.Entity.FromDb where
44

5-
import Database.Generic.Prelude
65
import Database.Generic.Entity.DbColumns (HasDbColumns)
76
import Database.Generic.Entity.DbTypes (DbT(..), DbValue)
7+
import Database.Generic.Prelude
88
import Generics.Eot qualified as G
99

1010
data FromDbError dbv

tutorial/tutorial/Main.hs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,7 @@ main = do
7676
info "Create table if not exists" $ createTable @Person True
7777
info "Delete all" $ deleteAll @Person -- Clear table before tutorial.
7878

79-
let x = returning $ insertOne john -- Insert One (Just Person) Person
80-
--
81-
-- HasOutputType (Insert o (Just Person) a) where
82-
-- outputType = OutputTypeRows
83-
--
84-
-- ParseOutput DbValue s where
85-
info "Insert one" x
79+
info "Insert one" $ insertOne john
8680

8781
info "Insert many" $
8882
insertMany [Person 25 "Alice" True, Person 25 "Bob" False]

0 commit comments

Comments
 (0)