[Dbix-class] How can I make a custom INSERT or UPDATE from Catalyst?

Chisel chisel at chizography.net
Sun Feb 12 03:33:09 GMT 2012


On Sat, Feb 11, 2012 at 3:19 PM, Miguel Barco <miguelelelele at yahoo.es> wrote:
>
> Hi, I previously asked how to use ON DUPLICATE KEY UPDATE in dbix, but I got no answers and I can't find nothing about it in the docs.


I know very little about this (non-standard?) MySQL syntax, but a
quick Google leads me to believe that you could just use
update_or_create():

http://desert-island.me.uk/perldoc/dbix-class-branch/lib/DBIx/Class/Manual/SQLHackers/UPDATE.pod

| DBIx::Class does not produce the non-standard MySQL "ON DUPLICATE KEY UPDATE",
| instead it has a shortcut for combining *find* and *update*.

Maybe this is worth investigating,

Chisel

--
Chisel
e: chisel at chizography.net
w: http://chizography.net



More information about the DBIx-Class mailing list