Commit Graph

10 Commits

Author SHA1 Message Date
Ben Levy
ea4ff33b93
Destroy all GADTs; Removes the From GADT and SqlExpr GADT (#228)
* Explode the From GADT. Move runFrom into the ToFrom typeclass removing the need for the intermediate structure. Extract the parts of the Experimental module into submodules.

* Reorganize Experimental folder. Move Subquery into core Experimental.From module.

* Cleanup hackage documentation. Make sure stylish ran correctly. Update changelog and bump version

* Update ERaw to change the direction of NeedParens (parent now tells child context). Removed need for composite key constructor

* Get rid of AliasedValue and ValueReference; added sqlExprMetaAlias to SqlExprMeta

* Remove EList and EEmptyList; ERaw is now technically possible in each case since it is generalized to all

* Remove entity specific constructors from SqlExpr

* Remove EOrderBy, EDistinctOn; Change PreprocessedFrom a to just be an independent datatype

* Remove EOrderByRandom, calling distinctOnOrderBy with rand will choke the db but you shouldnt be using rand anyway. distinctOnOrderBy seems dangerous though

* Remove ESet

* Remove EInsert and EInsertFinal

* Make postgres tests pass

* Change aliased val to be legal value by waiting until expr materialization in select clause before adding AS <alias>

* Cleanup ToAliasRefernce; Add isReference meta to value reference even though that info isnt currently used anywhere

* Expose Experimental submodules

* Update changelog

* Create a FromRaw to replace FromSubquery and FromIdent in from clause. Modify Experimental to only use FromRaw.

* Convert all of experimental to use new From type instead of From type class. Make the data constructors second class, functions should be used. Introduce *Lateral functions, using the same type for lateral and non lateral queries was probably a mistake.

* Expose the new functions and fix the mysql test compilation error (type inference was wonky with `Union` replaced with `union_`

* Bump version and add more comments

* ValidOnClause was too restrictive, ToFrom is actually the correct amount of leniency. ValidOnClause would not catch use of on for a cross join but would prevent nested joins

* Unbreak lateral joins by introducing a completely different ValidOnClause constraint

* Fixe error introduced in merge with master

* Dont realias alias references

* Never realias an already aliased Entity or Value

* reindex value references to the latest 'source'
2021-05-26 12:12:11 -06:00
Matt Parsons
96331257e4
get persistent 2.12 going (#243)
* run mysql tests

* uhhh why are you like this

* stuff

* tests pass locally

* make the example work

* minor bump

* fix gha

* k

* no persistent-template dependency please

* it passed?

* ci nonsense

* uh

* i think that should do it

* ok no really

* i miss file-watch

* sigh

* come on pls

* stylish haskell

* i hate this
2021-03-29 14:47:20 -06:00
Matt Parsons
4ea3d5da59
Github Actions (#223)
* Create haskell.yml
2020-10-29 15:10:54 -06:00
Ben Levy
2b5b561f6e
Add new SetOperation constructor for parenthesized query (#195)
* Add new SetOperation constructor for parenthesized query. Automatically detect when parentheses are needed on SelectQuery usage (only works for MySQL).

* Add Parens to SelectQueryP and create a pattern synonym for SelectQuery. SelectQueryP is hidden as end users should only be using SelectQuery.
2020-08-30 13:15:11 -06:00
parsonsmatt
c0d2d67f74 Removed from tests 2019-02-01 16:52:40 -07:00
Thiago Rodrigues de Paula
78cc8dd508 Fix travis mysql tests 2018-10-29 23:37:31 +01:00
Chris Allen
0acb568445 Updating for UnliftIO, Conduit 1.3, Persistent 2.8 2018-02-27 17:45:25 -06:00
Fintan Halpenny
1a88bd85e3 Fixed up some mysql kinks and split out test function. Added new test format to travis yaml. 2017-08-10 21:21:26 +01:00
Fintan Halpenny
6b0028ed69 Cleaning up code 2017-08-09 22:49:18 +01:00
Fintan Halpenny
1262c3fef9 Split into multiple testing stanzas and modules for backends
Common/Test.hs holds all common tests and functionality for the backends
2017-08-09 22:44:30 +01:00