[Twisted-Python] serial datatype in t.e.row

Sean Riley sean at twistedmatrix.com
Sun Sep 15 11:43:23 MDT 2002


how about:

reflector.insertRow(row, reload=0)

where the reload arg specifies if the key value should be "reloaded" from
the database. this would be specified by the user if they are going to
perform more operations on the row object that was just inserted.



-----Original Message-----
From: twisted-python-admin at twistedmatrix.com
[mailto:twisted-python-admin at twistedmatrix.com]On Behalf Of Benjamin
Bruheim
Sent: Friday, September 13, 2002 5:09 AM
To: twisted-python at twistedmatrix.com
Subject: Re: [Twisted-Python] serial datatype in t.e.row


> One solution may be to manually run a
>
> 	SELECT nextval('sequencename')
>
> to get the next value and use that for the insert, but this requires an
> extra step for each insert, and requires that the we know which tables
have
> serial columns (suprisingly hard to figure out..) and makes the behavior
for
> tables with serial columns and no serial columns very different.

Wouldn't it be sufficient to add a "reload hint", or something? its only
INSERT that will be affected. A reloadoninsert-hint would be
database-implementationindependent as well. The difference between
getting the whole table or just the ID is neglible in most cases; or
maybe even a question on wheter serials on anything but the dbKeyColumns
should be allowed to contain serials.
At least on postgresql there can be stuff happening on the server that
client would never be able to know about. Letting it reload could also
be passed as an option to every databaseinteractionmethod.
The reloading itself could be done through the deferred, just as glyph
mentioned.

2cents.

\\ benjamin


_______________________________________________
Twisted-Python mailing list
Twisted-Python at twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python





More information about the Twisted-Python mailing list