File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change 1- # Description
1+ # postgresql-simple-bind
2+
3+ ## Description
24 A FFI-like bindings for PostgreSQL strored functions.
35
46 ` postgresql-simple-bind ` is an extension for ` postgresql-simple `
79 communicates with a database via API hiding the internal structure
810 of the latter.
911
10- # Example
12+ ## Example
1113 Suppose we have the following functions in our database:
1214
1315 ```
3436 get_sum conn = sum <$> (get_all_nums conn)
3537 ```
3638
37- # Behind the scenes
39+ ## Behind the scenes
3840 It worth to mention that type translation from PostrgeSQL language to haskell
3941 is two-step. Firstly, a PostgreSQL type mapped to ` PostgresType ` instance and
4042 then this type family provides us the final type.
6567 our own instances.
6668
6769
68- # On types
70+ ## On types
6971 As we mentioned in the previous section there are certain restrictions on the
7072 types that can be used in ` PostgresType ` instances.
7173
8688 supposed to return non-` null ` -values.
8789
8890
89- # Customization
90- There are not so much ways to change behaviour of ` bindFunction ` (yet).
91+ ## Customization
92+ There are not so many ways to change behaviour of ` bindFunction ` (yet).
9193 In the most cases the only required tweak is renaming stored functions.
9294 This can be done by specifying ` nameModifier ` and ` schemaModifier ` options.
9395 For example if database and application code adhere snake case and camel case
103105 }
104106 ```
105107
106- # Automated generation
108+ ## Automated generation
107109 It can be tedious to manually maintain consistent function declarations
108110 across the codebase. More convenient way is to automatically generate module
109111 during the compilation time. In case of cabal it can be done by using
You can’t perform that action at this time.
0 commit comments