« Return to Thread: ORM for haskell?

Re: ORM for haskell?

by Mads Lindstrøm :: Rate this Message:

Reply to Author | View in Thread

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



_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@...
http://www.haskell.org/mailman/listinfo/haskell-cafe

signature.asc (204 bytes) Download Attachment

 « Return to Thread: ORM for haskell?