Shane O'Brien
1c73ec6814
Add reify and unreify to Table class
...
Previously these were implemented with `unsafeCoerce`, which was mostly correct, but was incorrect for certain instances of `HList`. With this change, `deriving Rel8able` will now fail to type check in those instances.
2021-04-27 17:04:40 +01:00
Shane O'Brien
1276bebbb0
Use FCF to decouple GTable from Table
2021-04-27 17:04:40 +01:00
Oliver Charles
3e8f632cd1
Rough documentation for constructing orderings
2021-04-24 22:30:13 +01:00
Shane O'Brien
26ccab33c8
Change arguments to listAggWithOrder
2021-04-23 11:22:33 +01:00
Shane O'Brien
5160431df3
Add ability to specify ordering with list aggregations
2021-04-22 15:48:46 +01:00
Ollie Charles
675dc60a24
Correct encoders for Infinity, -Infinity and NaN
...
Fixes #43
2021-04-22 11:14:15 +01:00
Shane O'Brien
93638f8bdf
Export Composite and Enum
2021-04-18 22:30:31 +01:00
Shane O'Brien
7c4c6ff930
Add Enum and Composite deriving via helpers
2021-04-18 21:34:50 +01:00
Shane O'Brien
b8ff282b10
Add instances for 6 and 7 tuples (after all, they're free now)
...
We stop at 7 though because even GHC doesn't provide Generic instances for 8-tuples and beyond.
2021-04-18 16:48:16 +01:00
Shane O'Brien
fb2107513e
Add better generic deriving for EqTable, OrdTable and ToExprs
...
This builds upon the `Rel8.Generic.Record` machinery introduced in the previous commit. It means that we can use generic implementations of the `Table`, `EqTable`, `OrdTable` and `ToExprs` for all tuple types, rendering `HPair`, `HTrio`, `HQuartet` and `HQuintet` unnecessary (this commit removes them).
2021-04-18 16:35:48 +01:00
Shane O'Brien
6d3959e9b0
Allow generic deriving of Table instances for non-record types
...
The is implemented using new machinery in `Rel8.Generic.Record`, which transforms the generic representation of any type to be as if that type was a record. Numeric labels are assigned to anonymous field selectors like `_1`, `_2`, `_3` and so on.
2021-04-18 00:52:15 +01:00
Shane O'Brien
6ca25e57dd
Add generic default for Table class, and share its implementation with Rel8able
2021-04-16 15:36:35 +01:00
Shane O'Brien
47e7842c0f
Sketch of HKD-lifting of Generic types
2021-04-16 15:17:39 +01:00
Oliver Charles
242dc79996
Add and export KRel8able
2021-04-16 13:25:52 +01:00
Shane O'Brien
04fdf2732d
Make Rel8able have kind ((X -> Type) -> Type) -> Constraint
...
Previous it was `((Type -> Type) -> Type) -> Constraint`. The problem is this clashes with things like `HKD` from `higgledy`. We can use GADTs and PolyKinds hacks to get around this while mostly retaining the same API. The only major difference is we use `Result` in places where we used `Identity` before.
2021-04-15 17:00:12 +01:00
Shane O'Brien
f6a9c968e4
Fix array1DAggExpr
2021-04-15 13:42:17 +01:00
Shane O'Brien
ba684c0585
Export Array1D
2021-04-14 20:15:47 +01:00
Shane O'Brien
b0e605305a
Add array1DAggExpr
2021-04-14 19:50:11 +01:00
Ollie Charles
e52dd759b9
Exports to allow users to define Table themselves
2021-04-14 13:11:52 +01:00
Shane O'Brien
2283f03bd2
Restore HTable superclass to Rel8able
2021-04-14 08:11:15 +01:00
Shane O'Brien
11a22291ab
Simplify Column type family
...
Now that the Field type family only needs a Necessity and a Type, we don't need to "parse" the Type to find the Necessity, we can instead just make it so that Column creates a Required field, and repurpose the name Default to be a type family that creates an Optional field.
The previous "parsing" approach was brittle sometimes, particularly in the case of polymorphism.
2021-04-14 07:25:39 +01:00
Shane O'Brien
5e4df5096c
Complete overhaul of Rel8.Schema.Generic
2021-04-13 21:35:37 +01:00
Shane O'Brien
09e449bc48
Fix typo in createView
2021-04-13 21:23:09 +01:00
Ollie Charles
ef91171265
Document LEFT JOINs
2021-04-11 12:48:46 +01:00
Ollie Charles
895e5fdc76
Document inner joins
2021-04-11 12:41:55 +01:00
Ollie Charles
820236873b
Document how to filter queries
2021-04-11 12:35:54 +01:00
Ollie Charles
55fef874e3
Document 'Limit and offset'
2021-04-11 12:28:00 +01:00
Ollie Charles
e1ea5970a9
Finish documenting the DBType hierarchy
2021-04-10 14:11:15 +01:00
Ollie Charles
9ef8fd8194
Upgrade Haskell.nix and remove data-serializer workaround
2021-04-10 13:46:32 +01:00
Ollie Charles
71aac66504
Update build.yaml
2021-04-08 13:01:16 +01:00
Shane O'Brien
197c38b4d8
Remove commented out code
2021-04-08 12:58:37 +01:00
Shane O'Brien
4e90af3265
Slightly less constraint fuckery is needed now that we don't use Opaque
2021-04-08 11:53:47 +01:00
Shane O'Brien
f1e287ea9f
Rename all the null things
2021-04-07 22:35:40 +01:00
Shane O'Brien
593e21b2df
Remove Opaque constraint synonyms
2021-04-07 21:39:03 +01:00
Shane O'Brien
84845f0484
GHC 9 support
2021-04-07 14:58:33 +01:00
Ollie Charles
444bf051c4
Have ReadShow describe what it's trying to read
2021-04-07 11:02:49 +01:00
Ollie Charles
926e5d4bf5
CAST all outputs of SELECT and RETURNING ( #35 )
2021-04-06 14:59:18 +01:00
Ollie Charles
1bcb2804d9
Try building shell.nix
2021-04-06 14:10:31 +01:00
Ollie Charles
11e75b55df
Require hasql ^>= 1.4.5.1
...
This allows TypeInformation to be coerced
2021-04-06 09:28:51 +01:00
Ollie Charles
04a7dde0bc
Bump sphinx
2021-04-05 16:41:21 +01:00
Oliver Charles
a6235ee7ec
Track another TODO
2021-04-04 20:32:14 +01:00
Oliver Charles
6289f0dab4
More todos
2021-04-04 20:30:33 +01:00
Oliver Charles
fb4e1a544e
Start documenting Query
2021-04-04 20:03:24 +01:00
Oliver Charles
ac9332c1a0
Pin docutils to 0.16
...
See https://github.com/readthedocs/sphinx_rtd_theme/issues/1111
2021-04-04 11:24:35 +01:00
Ollie Charles
6a3913b2b6
Trying to sort out the nav bar
2021-04-03 17:00:58 +01:00
Ollie Charles
fe6fdf410a
Split concepts into separate files
2021-04-03 16:54:33 +01:00
Ollie Charles
81b78ea471
More concepts
2021-04-03 16:28:18 +01:00
Ollie Charles
b693fba350
Use a flatter hierarchy
2021-04-03 15:43:05 +01:00
Ollie Charles
a683d3cecd
Squeeze in mapTypeInformation
2021-04-03 15:42:16 +01:00
Ollie Charles
e6b7de25cb
Document JSONEncoded
2021-04-03 15:40:34 +01:00