What is a generative method?
python, sqlalchemy
Solution
It doesn't appear to be a common database concept, but SQLAlchemy uses the term generative in the sense "generated by your program iteratively at runtime". (So, no connection to python generators). An example from the tutorial:
The `Query` object is fully generative, meaning that most method calls return a new `Query` object upon which further criteria may be added. For example, to query for users named “ed” with a full name of “Ed Jones”, you can call `filter()` twice, which joins criteria using AND:
>>> for user in session.query(User).\
... filter(User.name=='ed').\
... filter(User.fullname=='Ed Jones'):
... print user
This call syntax is more commonly known as "method chaining", and the design that allows it as a "fluent interface".
So, in the case of `Connection.execution_options()`, "generative" means that it returns the modified connection object, so that you can chain the calls as above.
Problem
I'm familiar with Python generators, however I've just come across the term "generative method" which I am not familiar with and cannot find a satisfactory definition. To put it in context, I found the term in SQLAlchemy's narrative documentation: Full control of the “autocommit” behavior is available using the generative Connection.execution_options() method provided on Connection, Engine, Executable, using the “autocommit” flag which will turn on or off the autocommit for the selected scope. What is a generative method? Trying to iterate the object returned by `Connection.execution_options()` doesn't work so I'm figuring it's something other than a standard generator.