summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/ddl.py
Commit message (Collapse)AuthorAgeFilesLines
* Implement comments for tables, columnsFrazer McLean2017-03-171-0/+32
| | | | | | | | | | | | | | Added support for SQL comments on :class:`.Table` and :class:`.Column` objects, via the new :paramref:`.Table.comment` and :paramref:`.Column.comment` arguments. The comments are included as part of DDL on table creation, either inline or via an appropriate ALTER statement, and are also reflected back within table reflection, as well as via the :class:`.Inspector`. Supported backends currently include MySQL, Postgresql, and Oracle. Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com> Fixes: #1546 Change-Id: Ib90683850805a2b4ee198e420dc294f32f15d35d
* Support python3.6Mike Bayer2017-01-131-1/+1
| | | | | | | | | | | Corrects some warnings and adds tox config. Adds DeprecationWarning to the error category. Large sweep for string literals w/ backslashes as this is common in docstrings Co-authored-by: Andrii Soldatenko Fixes: #3886 Change-Id: Ia7c838dfbbe70b262622ed0803d581edc736e085 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/337
* update for 2017 copyrightMike Bayer2017-01-041-1/+1
| | | | Change-Id: I4e8c2aa8fe817bb2af8707410fa0201f938781de
* spelling: Postgresql -> PostgreSQLVille Skyttä2016-10-081-3/+3
|
* Spelling fixesVille Skyttä2016-10-081-1/+1
|
* - happy new yearMike Bayer2016-01-291-1/+1
|
* - reorganize schema_translate_map to be succinct and gain the performanceMike Bayer2016-01-111-4/+4
| | | | back by using an attrgetter for the default case
* - Multi-tenancy schema translation for :class:`.Table` objects is added.Mike Bayer2016-01-081-8/+13
| | | | | | | | | This supports the use case of an application that uses the same set of :class:`.Table` objects in many schemas, such as schema-per-user. A new execution option :paramref:`.Connection.execution_options.schema_translate_map` is added. fixes #2685 - latest tox doesn't like the {posargs} in the profile rerunner
* - Fixed regression due to :ticket:`3282` where the ``tables`` collectionMike Bayer2015-04-271-6/+13
| | | | | | | | | | | | | | | | passed as a keyword argument to the :meth:`.DDLEvents.before_create`, :meth:`.DDLEvents.after_create`, :meth:`.DDLEvents.before_drop`, and :meth:`.DDLEvents.after_drop` events would no longer be a list of tables, but instead a list of tuples which contained a second entry with foreign keys to be added or dropped. As the ``tables`` collection, while documented as not necessarily stable, has come to be relied upon, this change is considered a regression. Additionally, in some cases for "drop", this collection would be an iterator that would cause the operation to fail if prematurely iterated. The collection is now a list of table objects in all cases and test coverage for the format of this collection is now added. fixes #3391
* - repair a regression caused by #3282, where we no longer wereMike Bayer2015-04-221-14/+32
| | | | | | | | | | applying any topological sort to tables on SQLite. See the changelog for details, but we now continue to sort tables for SQLite on DROP, prohibit the sort from considering alter, and only warn if we encounter an unresolvable cycle, in which case, then we forego the ordering. use_alter as always is used to break such a cycle. fixes #3378
* Merge branch 'bb_issue_3084' of https://bitbucket.org/xflr6/sqlalchemy into pr47Mike Bayer2015-04-031-2/+4
|\
| * make sort_tables order deterministicSebastian Bank2015-03-071-2/+4
| |
* | - The Postgresql :class:`.postgresql.ENUM` type will emit aMike Bayer2015-03-111-16/+26
| | | | | | | | | | | | | | | | | | | | | | | | DROP TYPE instruction when a plain ``table.drop()`` is called, assuming the object is not associated directly with a :class:`.MetaData` object. In order to accomodate the use case of an enumerated type shared between multiple tables, the type should be associated directly with the :class:`.MetaData` object; in this case the type will only be created at the metadata level, or if created directly. The rules for create/drop of Postgresql enumerated types have been highly reworked in general. fixes #3319
* | - copyright 2015Mike Bayer2015-03-101-1/+1
|/
* - test failures:Mike Bayer2015-01-021-1/+1
| | | | | - test_schema_2 is only on PG and doesn't need a drop all, omit this for now - py3k has exception.args[0], not message
* - restate sort_tables in terms of a more fine grainedMike Bayer2015-01-011-37/+227
| | | | | | | | | | | | | sort_tables_and_constraints function. - The DDL generation system of :meth:`.MetaData.create_all` and :meth:`.Metadata.drop_all` has been enhanced to in most cases automatically handle the case of mutually dependent foreign key constraints; the need for the :paramref:`.ForeignKeyConstraint.use_alter` flag is greatly reduced. The system also works for constraints which aren't given a name up front; only in the case of DROP is a name required for at least one of the constraints involved in the cycle. fixes #3282
* correctionsMike Bayer2014-12-271-1/+1
|
* - apply pep8 formatting to sqlalchemy/sql, sqlalchemy/util, sqlalchemy/dialects,Brian Jarrett2014-07-201-53/+56
| | | | sqlalchemy/orm, sqlalchemy/event, sqlalchemy/testing
* - break up the <authors> copyright comment as part of a passMike Bayer2014-07-091-1/+2
| | | | to get all flake8 passing
* Fix many typos throughout the codebasepr/85Alex Gaynor2014-04-261-2/+2
| | | | Found using: https://github.com/intgr/topy
* - happy new yearMike Bayer2014-01-051-1/+1
|
* Fix indentation issues in docstringspr/43Vraj Mohan2013-11-121-1/+1
|
* Replace a big loop + dict lookup in Connection.execute() with a simple visitorpr/30Alex Gaynor2013-09-251-0/+3
| | | | pattern
* more seealsos...Mike Bayer2013-08-271-3/+4
|
* added "system=True" to Column, so that we generally don't have to botherMike Bayer2013-08-251-5/+10
| | | | with CreateColumn rules
* - The :class:`.CreateColumn` construct can be appled to a customMike Bayer2013-08-241-0/+29
| | | | | compilation rule which allows skipping of columns, by producing a rule that returns ``None``. Also in 0.8.3.
* - header commentsMike Bayer2013-08-121-1/+1
|
* - A large refactoring of the ``sqlalchemy.sql`` package has reorganizedMike Bayer2013-08-121-0/+826
the import structure of many core modules. ``sqlalchemy.schema`` and ``sqlalchemy.types`` remain in the top-level package, but are now just lists of names that pull from within ``sqlalchemy.sql``. Their implementations are now broken out among ``sqlalchemy.sql.type_api``, ``sqlalchemy.sql.sqltypes``, ``sqlalchemy.sql.schema`` and ``sqlalchemy.sql.ddl``, the last of which was moved from ``sqlalchemy.engine``. ``sqlalchemy.sql.expression`` is also a namespace now which pulls implementations mostly from ``sqlalchemy.sql.elements``, ``sqlalchemy.sql.selectable``, and ``sqlalchemy.sql.dml``. Most of the "factory" functions used to create SQL expression objects have been moved to classmethods or constructors, which are exposed in ``sqlalchemy.sql.expression`` using a programmatic system. Care has been taken such that all the original import namespaces remain intact and there should be no impact on any existing applications. The rationale here was to break out these very large modules into smaller ones, provide more manageable lists of function names, to greatly reduce "import cycles" and clarify the up-front importing of names, and to remove the need for redundant functions and documentation throughout the expression package.