Skip to content

add generic nextval construct #2085

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sqlalchemy-bot opened this issue Mar 2, 2011 · 3 comments
Closed

add generic nextval construct #2085

sqlalchemy-bot opened this issue Mar 2, 2011 · 3 comments
Milestone

Comments

@sqlalchemy-bot
Copy link
Collaborator

Migrated issue, originally created by Michael Bayer (@zzzeek)

i.e. next_value(some_seq), more usefully apply it to Sequence, some_seq.next_value()

this is somewhat major since we'd be using this construct internally as well for consistency.


Attachments: ticket_2084_2085.patch

@sqlalchemy-bot
Copy link
Collaborator Author

Michael Bayer (@zzzeek) wrote:

patch attached includes #2084 and #2085 .

Tests needed:

  • Postgresql executes a Sequence, returns nextval, whether or not "optional" is set
  • Postgresql renders the "nextval" construct, whether or not "optional" is set
  • func.next_value().execute()/.scalar() works
  • Using a DefaultGenerator in the columns, where clause of a select, or in the values clause of insert, update, raises the informative error
  • Same for Sequence, test the additional string
  • can use next_value() in:
  • select column expr
  • whereclause
  • values of insert/update
  • return of next_value is an int, check oracle
  • insert statement:
  • inserted_primary_key contains the result when pk_col=next_value(), when implicit returning is used, when not used, it should be none. probably want to put this in test_returning
  • next_value() used on non-sequence platform either raises NotImplemented, or perhaps we determine some other kind of placeholder

@sqlalchemy-bot
Copy link
Collaborator Author

Michael Bayer (@zzzeek) wrote:

90335a8

@sqlalchemy-bot
Copy link
Collaborator Author

Changes by Michael Bayer (@zzzeek):

  • changed status to closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant