[Haskell-cafe] ORM for haskell?
Mads Lindstrøm
mads_lindstroem at yahoo.dk
Tue Jun 30 17:49:40 EDT 2009
Hi Marc Weber
> Another example: Updating the age of a pupil:
>
> row = SELECT * FROM pupils where age = 13;
> UPDATE pupils SET age = 14 WHERE id = <the id you got above>
>
> p = session.query(Pupil).filter(Pupil.age==13).one().age=14
> session.commit()
>
> difference?
> You don't have to care about ids. you just assign a new value and
> tell
> the engine that it should commit.
> So again less chances to get something wrong.
>
Could you not do in SQL:
UPDATE pupils SET age = 14 WHERE age = 13
That is, without using ids.
Greetings,
Mads Lindstrøm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20090630/d5de857d/attachment.bin
More information about the Haskell-Cafe
mailing list