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
Felipe Lessa
ba577a0111
Functor Value.
2014-07-12 12:00:54 -03:00
Felipe Lessa
bfdb140e46
Bump version to 1.4.3.
2014-07-12 00:27:23 -03:00
Mitchell Rosen
22f03c2e39
change coalesceDefault argument order
2014-07-11 19:51:01 -07:00
Mitchell Rosen
e735378f90
added coalesce/coalesceDefault functions
2014-07-11 16:03:04 -07:00
Felipe Lessa
46fa0cafcf
Export an unValue function.
2014-05-08 10:55:08 -03:00
Felipe Lessa
b04be7d615
Small doc improvements.
2014-05-08 10:47:51 -03:00
Felipe Lessa
466de1f96b
Add "since" to rand's doc.
2014-04-08 19:31:51 -03:00
Erik de Castro Lopo
d37331e04d
Implement orderBy[rand] modifier.
2014-04-09 05:56:25 +10:00
João Cristóvão
753e4bccac
Added num class restriction to random, round_, floor_.
2013-09-19 09:30:16 +01:00
João Cristóvão
0033050806
Merge branch 'master' of github.com:meteficha/esqueleto
2013-09-15 21:57:04 +01:00
Felipe Lessa
c5c76959bd
Move public insertSelect API to Language module.
2013-09-15 04:03:40 -03:00
João Cristóvão
161621cbd4
sum_ result type may not be the same as the parameters type.
2013-09-11 10:48:12 +01: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
Danny B
83dc4a433c
Make max_, min_ and sum_ less general.
2013-08-07 15:27:29 +11:00
Sam Anklesaria
3641f36326
added tests for math and aggregation functions
2013-07-03 15:46:22 +09:00
Sam Anklesaria
30c321ee03
common math and aggregation sql functions
2013-07-02 19:39:17 +09:00
Felipe Lessa
d056545c3e
Bump version to 1.2.2.
2013-05-20 12:35:54 -03: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
8759774ede
Doc typo.
2012-11-29 13:54:55 -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
8a79bdaad1
Add some tuple magic to groupBy.
...
Now you can say things like:
groupBy (foo ^. FooId, foo ^. FooName, Bar ^. BarName)
instead of:
groupBy $ foo ^. Fooid
groupBy $ foo ^. FooName
groupBy $ Bar ^. BarName
2012-09-23 23:11:24 +11: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
a5b93ff329
Typo.
2012-09-06 10:58:13 -03:00
Felipe Lessa
da6a669366
Add warning about unsupported JOINs to from's docs.
2012-09-06 10:40:39 -03:00
Felipe Lessa
4822172a42
Haddock fix.
2012-09-06 10:37:20 -03:00
Felipe Lessa
25f632398d
Better top-level docs for internal modules.
2012-09-06 10:35:55 -03:00
Felipe Lessa
17a2cb65a9
Haddock fixes.
2012-09-06 09:49:14 -03:00
Felipe Lessa
1cb5c19288
Better 'from' documentation.
2012-09-06 09:46:08 -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
cc72ee9811
Misleading fixity declaration.
2012-09-06 01:28:06 -03:00
Felipe Lessa
077458ad56
Typos.
2012-09-06 01:27:34 -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
f5c046775a
Generalize types of numerical operations.
...
Persistent doesn't ask for Num and everything has
worked very well so far. Not having a Num constraint
also allows those operations to work on Maybes.
2012-09-05 22:57:16 -03:00
Felipe Lessa
3f2f1fdea7
Avoid a lot of redundant parenthesis.
...
Although this commit should not change the behaviour of any code,
it does make the resulting SQL a lot more pleasant to the eye.
2012-09-05 20:45:35 -03:00
Felipe Lessa
dad271a75a
Prettify LANGUAGE pragmas.
2012-09-05 19:16:28 -03:00
Felipe Lessa
9a24c7774c
Allow SELECT DISTINCT queries as well.
2012-09-05 19:14:03 -03:00
Felipe Lessa
7bb68cc233
Allow any parenthesization of JOINs.
2012-09-05 15:55:59 -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
Felipe Lessa
670eebbc96
fromSingle is internal.
2012-09-03 23:13:19 -03:00
Felipe Lessa
2986d0996e
Nicer 'from' interface.
...
Instead of
select $ do
(x,y,z) <- from
where_ (z^.f ==. y^.f)
return (x, y^.f, z)
now you may write
select $
from $ \(x,y,z) -> do
where_ (z^.f ==. y^.f)
return (x, y^.f, z)
Now the only difference in reading order wrt. SQL is the return
on the bottom of the expression. =)
Note that this does not change at all the expressivity of the
language since
oldFrom = from return
2012-09-03 17:03:07 -03:00
Felipe Lessa
33d04d5f27
Implement sub.
2012-09-03 15:57:20 -03:00
Felipe Lessa
aba36832f6
Second prototype, now using finally tagless style.
2012-09-03 15:42:28 -03:00
Felipe Lessa
acc119e61f
Initial skeleton.
2012-09-03 11:38:22 -03:00