summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | - The :mod:`sqlalchemy.ext.automap` extension will now setMike Bayer2014-09-221-6/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ``cascade="all, delete-orphan"`` automatically on a one-to-many relationship/backref where the foreign key is detected as containing one or more non-nullable columns. This argument is present in the keywords passed to :func:`.automap.generate_relationship` in this case and can still be overridden. Additionally, if the :class:`.ForeignKeyConstraint` specifies ``ondelete="CASCADE"`` for a non-nullable or ``ondelete="SET NULL"`` for a nullable set of columns, the argument ``passive_deletes=True`` is also added to the relationship. Note that not all backends support reflection of ondelete, but backends that do include Postgresql and MySQL. fixes #3210
| * | | | | - Fixed bug that affected generally the same classes of eventMike Bayer2014-09-183-8/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | as that of :ticket:`3199`, when the ``named=True`` parameter would be used. Some events would fail to register, and others would not invoke the event arguments correctly, generally in the case of when an event was "wrapped" for adaption in some other way. The "named" mechanics have been rearranged to not interfere with the argument signature expected by internal wrapper functions. fixes #3197
| * | | | | - Fixed an unlikely race condition observed in some exotic end-userMike Bayer2014-09-181-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | setups, where the attempt to check for "duplicate class name" in declarative would hit upon a not-totally-cleaned-up weak reference related to some other class being removed; the check here now ensures the weakref still references an object before calling upon it further. fixes #3208
| * | | | | - Fixed bug that affected many classes of event, particularlyMike Bayer2014-09-182-15/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ORM events but also engine events, where the usual logic of "de duplicating" a redundant call to :func:`.event.listen` with the same arguments would fail, for those events where the listener function is wrapped. An assertion would be hit within registry.py. This assertion has now been integrated into the deduplication check, with the added bonus of a simpler means of checking deduplication across the board. fixes #3199
| * | | | | - Added new method :meth:`.Select.with_statement_hint` and ORMMike Bayer2014-09-183-6/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | method :meth:`.Query.with_statement_hint` to support statement-level hints that are not specific to a table. fixes #3206
| * | | | | - Added support for the Oracle table option ON COMMIT. This is beingMike Bayer2014-09-172-7/+61
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | kept separate from Postgresql's ON COMMIT for now even though ON COMMIT is in the SQL standard; the option is still very specific to temp tables and we eventually would provide a more first class temporary table feature. - oracle can apparently do get_temp_table_names() too, so implement that, fix its get_table_names(), and add it to #3204. fixes #3204 again.
| * | | | Merge branch 'sqlite-temp-table-reflection' of ↵Mike Bayer2014-09-171-10/+18
| |\ \ \ \ | | | | | | | | | | | | | | | | | | https://bitbucket.org/jerdfelt/sqlalchemy/branch/sqlite-temp-table-reflection into pr31
| | * | | | Handle sqlite get_unique_constraints() call for temporary tablesJohannes Erdfelt2014-09-171-10/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The sqlite get_unique_constraints() implementation did not do a union against the sqlite_temp_master table like other code does. This could result in an exception being raised if get_unique_constraints() was called against a temporary table.
| * | | | | - Added :meth:`.Inspector.get_temp_table_names` andMike Bayer2014-09-175-27/+156
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | :meth:`.Inspector.get_temp_view_names`; currently, only the SQLite dialect supports these methods. The return of temporary table and view names has been **removed** from SQLite's version of :meth:`.Inspector.get_table_names` and :meth:`.Inspector.get_view_names`; other database backends cannot support this information (such as MySQL), and the scope of operation is different in that the tables can be local to a session and typically aren't supported in remote schemas. fixes #3204
| * | | | | Merge branch 'pr128'Mike Bayer2014-09-171-3/+35
| |\ \ \ \ \ | | |/ / / / | |/| | | |
| | * | | | - repair get_foreign_table_names() for PGInsp/dialect levelpr128Mike Bayer2014-09-172-19/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - repair get_view_names() - changelog + migration note
| | * | | | Merge remote-tracking branch 'origin/pr/128' into pr128Mike Bayer2014-09-162-3/+23
| | |\ \ \ \
| | | * | | | Added documentation. Changed my mind - added get_foreign_table_names() only ↵pr/128Rodrigo Menezes2014-09-055-41/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | to PGInspect and not in the Dialect. Added tests for PGInspect and removed a bunch of the old test scaffolding.
| | | * | | | Added get_foreign_table_names to interface and put it in the test requirements.Rodrigo Menezes2014-09-054-2/+19
| | | | | | |
| | | * | | | Fixing some pep8s and adding get_foreign_tables.Rodrigo Menezes2014-09-032-2/+26
| | | | | | |
| | | * | | | Removed changes that are no longer necessary for postgresql_relkind. Also, ↵Rodrigo Menezes2014-08-262-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | removed newline changes.
| | | * | | | Merge branch 'master' of https://github.com/zzzeek/sqlalchemy into ↵Rodrigo Menezes2014-08-2622-679/+828
| | | |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | feature/postgres-relkind
| | | * | | | | Remove relkind from construct arguments.Rodrigo Menezes2014-08-261-2/+1
| | | | | | | |
| | | * | | | | Removed all mentions to postgresql_relkindRodrigo Menezes2014-08-261-29/+9
| | | | | | | |
| | | * | | | | Add a view synonym too for consistency.Rodrigo Menezes2014-08-141-1/+2
| | | | | | | |
| | | * | | | | Merge branch 'master' of https://github.com/rclmenezes/sqlalchemyRodrigo Menezes2014-08-1415-103/+227
| | | |\ \ \ \ \
| | | * | | | | | Added support for postgres_relkind.Rodrigo Menezes2014-08-142-15/+33
| | | | | | | | |
| * | | | | | | | - Fixed the version string detection in the pymssql dialect toMike Bayer2014-09-161-1/+1
| |/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | work with Microsoft SQL Azure, which changes the word "SQL Server" to "SQL Azure". fixes #3151
| * | | | | | | - raise from cause here to preserve stack traceMike Bayer2014-09-161-1/+1
| | | | | | | |
* | | | | | | | Merge branch 'master' into ticket_3100Mike Bayer2014-09-1521-381/+711
|\ \ \ \ \ \ \ \ | |/ / / / / / /
| * | | | | | | - fix issue where nose Failure object comes into play hereMike Bayer2014-09-151-0/+2
| | | | | | | |
| * | | | | | | - remove some crufty old testing optionsMike Bayer2014-09-146-68/+86
| | |_|_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - reestablish the "bootstrap" system of loading the test runners in testing/plugin; using the updated approach we just came up with for alembic. Coverage should be fixed now when running either py.test or nose. fixes #3196 - upgrade tox.ini and start using a .coveragerc file
| * | | | | | - Fixed warning that would emit when a complex self-referentialMike Bayer2014-09-111-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | primaryjoin contained functions, while at the same time remote_side was specified; the warning would suggest setting "remote side". It now only emits if remote_side isn't present. fixes #3194
| * | | | | | - Fixed bug in ordering list where the order of items would beMike Bayer2014-09-102-2/+15
| | |_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | thrown off during a collection replace event, if the reorder_on_append flag were set to True. The fix ensures that the ordering list only impacts the list that is explicitly associated with the object. fixes #3191
| * | | | | - add in all the method-chained methods to the parameter descriptionsMike Bayer2014-09-091-43/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | on select(). improve some descriptions and add more info for limit()/ offset(), including new 1.0 functionality.
| * | | | | - rework the previous "order by" system in terms of the new one,Mike Bayer2014-09-084-44/+84
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | unify everything. - create a new layer of separation between the "from order bys" and "column order bys", so that an OVER doesn't ORDER BY a label in the same columns clause - identify another issue with polymorphic for ref #3148, match on label keys rather than the objects
| * | | | - check for None linker...Mike Bayer2014-09-081-1/+1
| | | | |
| * | | | - Added new event handlers :meth:`.AttributeEvents.init_collection`Mike Bayer2014-09-073-20/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and :meth:`.AttributeEvents.dispose_collection`, which track when a collection is first associated with an instance and when it is replaced. These handlers supersede the :meth:`.collection.linker` annotation. The old hook remains supported through an event adapter.
| * | | | - remove some old cruftMike Bayer2014-09-074-78/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - prop.compare() isn't needed; replace with prop._with_parent() for relationships - update docs in orm/interfaces
| * | | | - rework ColumnAdapter and ORMAdapter to only provide the featuresticket_3148Mike Bayer2014-09-073-88/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | we're now using; rework them fully so that their behavioral contract is consistent regarding adapter.traverse() vs. adapter.columns[], add a full suite of tests including advanced wrapping scenarios previously only covered by test/orm/test_froms.py and test/orm/inheritance/test_relationships.py - identify several cases where label._order_by_label_clause would be corrupted, e.g. due to adaption or annotation separately - add full tests for #3148
| * | | | - enhance ClauseAdapter / ColumnAdapter to have new behaviors with labels.Mike Bayer2014-09-076-30/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "anonymize label" logic is now generalized to ClauseAdapter, and takes place when the anonymize_labels flag is sent, taking effect for all .columns lookups as well as within traverse() calls against the label directly. - traverse() will also memoize what it gets in columns, so that calling upon traverse() / .columns against the same Label will produce the same anonymized label. This is so that AliasedClass produces the same anonymized label when it is accessed per-column (e.g. SomeAlias.some_column) as well as when it is applied to a Query, and within column loader strategies (e.g. query(SomeAlias)); the former uses traverse() while the latter uses .columns - AliasedClass now calls onto ColumnAdapter - Query also makes sure to use that same ColumnAdapter from the AliasedClass in all cases - update the logic from 0.9 in #1068 to make use of the same _label_resolve_dict we use for #2992, simplifying how that works and adding support for new scenarios that were pretty broken (see #3148, #3188)
| * | | | wip for #3148Mike Bayer2014-09-066-14/+50
| | | | |
| * | | | - document all the varities of _label on the base ColumnElementMike Bayer2014-09-062-12/+56
| | | | | | | | | | | | | | | | | | | | | | | | | - replace out _columns_clause_label with a straight boolean flag to reduce the proliferation of labels
| * | | | - omit MySQL index flavor if its NoneMike Bayer2014-09-051-1/+2
| | | | |
| * | | | - MySQL boolean symbols "true", "false" work again. 0.9's changeMike Bayer2014-09-051-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in :ticket:`2682` disallowed the MySQL dialect from making use of the "true" and "false" symbols in the context of "IS" / "IS NOT", but MySQL supports this syntax even though it has no boolean type. MySQL remains "non native boolean", but the :func:`.true` and :func:`.false` symbols again produce the keywords "true" and "false", so that an expression like ``column.is_(true())`` again works on MySQL. fixes #3186
* | | | | Merge branch 'master' into ticket_3100Mike Bayer2014-09-053-102/+130
|\ \ \ \ \ | |/ / / /
| * | | | - tiny refactors #1-#5Mike Bayer2014-09-053-102/+130
| | | | |
* | | | | Merge branch 'master' into ticket_3100Mike Bayer2014-09-0310-85/+92
|\ \ \ \ \ | |/ / / /
| * | | | - ensure literal_binds works with LIMIT clause, FOR UPDATEMike Bayer2014-09-038-27/+42
| | | | |
| * | | | - The hostname-based connection format for SQL Server when usingMike Bayer2014-09-032-58/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pyodbc will no longer specify a default "driver name", and a warning is emitted if this is missing. The optimal driver name for SQL Server changes frequently and is per-platform, so hostname based connections need to specify this. DSN-based connections are preferred. fixes #3182
* | | | | - add options to get back pk defaults for inserts.Mike Bayer2014-09-022-18/+35
| | | | | | | | | | | | | | | | | | | | times spent start getting barely different...
* | | | | Merge branch 'master' into ticket_3100Mike Bayer2014-09-0240-958/+1087
|\ \ \ \ \ | |/ / / /
| * | | | - An adjustment to table/index reflection such that if an indexMike Bayer2014-09-021-8/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | reports a column that isn't found to be present in the table, a warning is emitted and the column is skipped. This can occur for some special system column situations as has been observed with Oracle. fixes #3180
| * | | | - add logic to compiler such that if stack is empty, we justMike Bayer2014-09-023-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | stringify a _label_reference() as is. - add .key to _label_reference(), so that when _make_proxy() is called, we don't call str() on it anyway. - add a test to exercise Query's behavior of adding all the order_by expressions to the columns list of the select, assert that things work out when we have a _label_reference there, that it gets sucked into the columns list and spit out on the other side, it's referred to appropriately, etc. _label_reference() could theoretically be resolved at the point we iterate _raw_columns() but it's better to just let things work as they already do (except nicer, since we get "tablename.colname" instead of just "somename" in the columns list) so that we aren't adding a ton of overhead to _columns_plus_names in the common case.
| * | | | - The :func:`~.expression.column` and :func:`~.expression.table`Mike Bayer2014-09-0111-55/+180
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | constructs are now importable from the "from sqlalchemy" namespace, just like every other Core construct. - The implicit conversion of strings to :func:`.text` constructs when passed to most builder methods of :func:`.select` as well as :class:`.Query` now emits a warning with just the plain string sent. The textual conversion still proceeds normally, however. The only method that accepts a string without a warning are the "label reference" methods like order_by(), group_by(); these functions will now at compile time attempt to resolve a single string argument to a column or label expression present in the selectable; if none is located, the expression still renders, but you get the warning again. The rationale here is that the implicit conversion from string to text is more unexpected than not these days, and it is better that the user send more direction to the Core / ORM when passing a raw string as to what direction should be taken. Core/ORM tutorials have been updated to go more in depth as to how text is handled. fixes #2992