|
From: R. E. B. <re...@cs...> - 2009-11-14 21:35:25
|
Justin Bailey der ki:
> On Sat, Nov 14, 2009 at 11:55 AM, R. Emre Başar <re...@cs...> wrote:
> > Or, to take an alternative approach, is it possible to define that type
> > of query as a HaskellDB table?
> >
>
> Probably that is your best approach. It will be tricky. The
> haskelldb-th project might help - it has some utilities for defining
> tables, etc.
>
Thanks. I managed to get it to some level. I defined a table like:
$(mkDBDirectTableWithName "LastInsertId" "Server" [("LAST_INSERT_ID()", [t|Int|])])
This gives me the last insert id for a table, but the problem is it
generates an SQL like: SELECT LAST_INSERT_ID() FROM Server as T1; which
is table specific.
Is it possible to remove the FROM clause, so that it can work on any
insert? As far as I dived into the source of HaskellDB I got the
impression that it is not possible to build queries without a FROM
component. Is that correct?
--
R. Emre Başar
İstanbul Bilgi University
Department of Computer Science
|