Commit Graph

59 Commits

Author SHA1 Message Date
Josh Berman
8579010409 INSERT INTO SELECT typo 2014-11-17 17:19:45 +02:00
Paul Berens
d690e0b425 Implement CASE support
* This seems to work but I don't have in-depth tests yet
 * I seem to still have some oddity here and there which needs to be
 nailed down
 * This only implements the "full" CASE syntax, not the simplified, and
 it makes ELSE mandatory, (its optional with CASE)
2014-11-02 01:31:54 -07:00
Michael Snoyman
05fbbba86a Support for persistent 2.0.8 2014-09-28 07:05:41 +03:00
Michael Snoyman
4febf46c6a Merge branch 'persistent2' of github.com:fpco/esqueleto
Conflicts:
	esqueleto.cabal
	src/Database/Esqueleto.hs
2014-09-08 09:05:57 +03:00
Michael Snoyman
30964d950d More persistent2 updates 2014-08-27 11:27:36 +03:00
Mitchell Rosen
e735378f90 added coalesce/coalesceDefault functions 2014-07-11 16:03:04 -07:00
Felipe Lessa
e91c625ff7 Small doc improvement. 2014-07-07 23:55:38 -03:00
Erik de Castro Lopo
41698518c9 Rename keyE to valJ and fix implementation.
As Felipe points out in the PR comments, the implementation can be
simplified to "val . unValue" but the type signature on the function
still prevents anything non-sensical happening.

See: https://github.com/prowdsponsor/esqueleto/pull/69
2014-07-08 10:47:44 +10:00
Erik de Castro Lopo
0b830771ea Add function keyE.
Give a value, keyE lifts the Key for that value into the query expression.

    keyE :: Esqueleto query expr backend =>
            Value (Key entity) -> expr (Value (Key entity))
2014-07-07 19:52:21 +10:00
Michael Snoyman
2685cdb7f7 Merge branch 'master' of github.com:meteficha/esqueleto into HEAD
Conflicts:
	esqueleto.cabal
	src/Database/Esqueleto/Internal/Sql.hs
2014-05-26 16:34:34 +03:00
Felipe Lessa
46fa0cafcf Export an unValue function. 2014-05-08 10:55:08 -03:00
Erik de Castro Lopo
d37331e04d Implement orderBy[rand] modifier. 2014-04-09 05:56:25 +10:00
Felipe Lessa
5192a2b98e Fix typo on doc (closes #36). 2014-03-04 09:51:50 -03:00
Michael Snoyman
7f6ae061da persistent2 2014-01-16 08:24:43 +02:00
Danny B
d6d528d5a9 Fix underscore. 2013-08-09 14:56:19 +11:00
Danny B
452861de78 Fix comma. 2013-08-09 09:06:48 +11:00
Danny B
e77e056f5b Handle NULL result in avg_ too. 2013-08-08 16:46:01 +11:00
Danny B
068ec9b1ae Proper NULL handling in max_, min_ and sum_.
- return expr (Value (Maybe a))
- add joinV to join nested Maybes in an expr
2013-08-08 15:51:31 +11:00
Sam Anklesaria
3641f36326 added tests for math and aggregation functions 2013-07-03 15:46:22 +09:00
Sam Anklesaria
024537b592 Merge branch 'master' of git://github.com/meteficha/esqueleto 2013-07-02 19:40:28 +09:00
Sam Anklesaria
30c321ee03 common math and aggregation sql functions 2013-07-02 19:39:17 +09:00
Felipe Lessa
66e67e1cff Final touchs on docs. 2013-07-01 11:06:53 -03:00
Sam Anklesaria
dc5baefd48 No more MPTCs, added documentation 2013-06-30 11:44:24 +09:00
Sam Anklesaria
ee8656adf0 insert select statements 2013-06-22 23:48:08 +09:00
Takahiro HIMURA
893f1cd54b Add HAVING support. 2013-05-19 08:21:52 +09:00
Felipe Lessa
1e633a8dd9 Upgrade to persistent 1.2 and bump version to 1.2.
Note that version 1.1 was skipped for the sake of bringing
esqueleto's version to parity with persistent's.
2013-04-29 18:21:44 -03:00
Mitsutoshi Aoe
0889709403 Add support for COUNT(expr) 2013-03-07 20:04:43 +09:00
Felipe Lessa
51c08ed0e8 Add deleteCount and updateCount (fixes #10). 2013-02-12 13:09:30 -02:00
Felipe Lessa
aa2c207dd1 Add valkey helper (fixes #9). 2012-12-14 16:45:59 -02:00
Felipe Lessa
9db4408d7c Use persistent 1.1. 2012-12-14 12:12:05 -02:00
Felipe Lessa
5514f68994 Support for IN and NOT IN. 2012-11-28 18:23:52 -02:00
Felipe Lessa
4769d30b18 Add support for EXISTS and NOT EXISTS. 2012-11-28 18:23:07 -02:00
Danny B
3c932f5a79 Add support for GROUP BY. 2012-09-23 06:07:01 +11:00
Felipe Lessa
94b19267ee New functions limit and offset. 2012-09-09 14:28:28 -03:00
Felipe Lessa
5a0974f4c0 New text-related functions like, (%), concat_ and (++.). 2012-09-09 12:20:15 -03:00
Felipe Lessa
c8a96db9da Clarify that writing portable SQL is not one of our goals. 2012-09-09 10:22:32 -03:00
Felipe Lessa
0aa3c23a75 New SqlEntity constraint synonym. 2012-09-09 09:47:38 -03:00
Felipe Lessa
e2d73b49d9 Typo.
As always, found just after a Hackage release.
2012-09-06 10:54:33 -03:00
Felipe Lessa
326b2d45bf Silly typo. 2012-09-06 10:43:34 -03:00
Felipe Lessa
271b5410da Typo. 2012-09-06 01:49:09 -03:00
Felipe Lessa
f718be86da Instead of using rawSql's Single, use a new data type Value.
First of all, Value is a nicer name than Single.

However the main reason is to avoid error calls and to get better
feedback about the code from GHC.  Because of the GHC bug #6124,
we had many calls to 'error' just to avoid spurious warnings.  By
using data (instead of newtype) for Value we're able to avoid
them.  This commit removes *19* error calls from Sql.hs that GHC
is now able to prove that are unreachable.
2012-09-06 01:40:52 -03:00
Felipe Lessa
bc21bac9ca A lot more docs. 2012-09-06 01:06:37 -03:00
Felipe Lessa
df63cd864b COUNT(*). 2012-09-05 23:18:56 -03:00
Felipe Lessa
0f677e9246 Add UPDATE support. 2012-09-05 23:09:02 -03:00
Felipe Lessa
a29183028b New DELETE support. 2012-09-05 20:34:24 -03:00
Felipe Lessa
9a24c7774c Allow SELECT DISTINCT queries as well. 2012-09-05 19:14:03 -03:00
Felipe Lessa
1e19d8625b Implement JOIN and ON clauses. Also add (?.). 2012-09-05 15:38:14 -03:00
Felipe Lessa
80d60bb9b6 Avoid using capitalized "Esqueleto" when referring to the library. 2012-09-04 18:37:02 -03:00
Felipe Lessa
31b4b0669f orderBy, asc, desc. 2012-09-04 18:12:40 -03:00
Felipe Lessa
c601613162 isNothing, just, nothing. 2012-09-04 18:12:25 -03:00