[storm] primary key autofilling
Drew Smathers
drew.smathers at gmail.com
Thu Aug 9 01:07:57 BST 2007
Hi Gustavo,
> That's an interesting problem, which probably have a solution, but will
> need some thinking. Let me describe what's our requirements on the ORM
> side, and then if you provide your requirements, we can sort out a
> solution.
Actually, I'm wrong. The schema does indeed have triggers for some
fields, but uid defaults to nextval on a sequence. The problem is
that the sequence isn't called "<mytable>_uid_seq". So problem
solved. I renamed the sequence.
> Storm offers a few different ways to do that to the backends, but somehow
> it has to become aware of the primary key used. In Postgres 8.2, it's
> possible to do a INSERT ... RETURNING, which is an excellent to implement
> that, and one that we'll probably use in the near future.
Yes, that seems like a nice way of resolving id if not set explicitly
before inserting. Depending on the impl of RETURNING, I guess that
might mean one less query as well.
> Does this make sense?
Yes it does. Thanks again for your help.
--
\\\\\/\"/\\\\\\\\\\\
\\\\/ // //\/\\\\\\\
\\\/ \\// /\ \/\\\\
\\/ /\/ / /\/ /\ \\\
\/ / /\/ /\ /\\\ \\
/ /\\\ /\\\ \\\\\/\
\/\\\\\/\\\\\/\\\\\\
d.p.s
More information about the storm
mailing list