summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/schema.py
Commit message (Collapse)AuthorAgeFilesLines
...
* - more 78 charsMike Bayer2010-07-101-174/+223
| | | | | - BIGINT doc - clean up docs in schema.py
* - Column.copy() takes along the "unique" attributeMike Bayer2010-06-151-0/+1
| | | | | among others, fixes [ticket:1829] regarding declarative mixins
* disclaimer for the "type=None" semi-featureMike Bayer2010-05-151-3/+5
|
* - Added table.add_is_dependent_on(othertable), allows manualMike Bayer2010-05-131-0/+15
| | | | | | placement of dependency rules between two Table objects for use within create_all(), drop_all(), sorted_tables. [ticket:1801]
* - the _make_proxy() method of ColumnClause and Column now useMike Bayer2010-05-101-1/+1
| | | | | | | self.__class__ to determine the class of object to be returned instead of hardcoding to ColumnClause/Column, making it slightly easier to produce specific subclasses of these which work in alias/subquery situations.
* - Fixed "table" argument on constructor of ForeginKeyConstraintMike Bayer2010-04-261-1/+1
| | | | [ticket:1571]
* - Table.create() and Table.drop() no longer apply metadata-Mike Bayer2010-04-161-2/+10
| | | | level create/drop events. [ticket:1771]
* - The ORM will set the docstring of all generated descriptorsMike Bayer2010-04-021-0/+5
| | | | | | | | | to None by default. This can be overridden using 'doc' (or if using Sphinx, attribute docstrings work too). - Added kw argument 'doc' to all mapper property callables as well as Column(). Will assemble the string 'doc' as the '__doc__' attribute on the descriptor.
* - the copy() method of Column now copies over uninitializedMike Bayer2010-03-111-2/+5
| | | | | "on table attach" events. Helps with the new declarative "mixin" capability.
* -remove proof of concept "cascade constraints"Mike Bayer2010-02-281-4/+0
|
* Added the ability to strip the schema when using tometadata by passing ↵Michael Trier2010-02-251-2/+4
| | | | schema=None as an argument. Fixes #1673.
* - "out" parameters require a type that is supported byMike Bayer2010-02-231-1/+6
| | | | | | | | cx_oracle. An error will be raised if no cx_oracle type can be found. - Column() requires a type if it has no foreign keys (this is not new). An error is now raised if a Column() has no type and no foreign keys. [ticket:1705]
* - added util.portable_instancemethod to provide a quick way to make an ↵Mike Bayer2010-02-221-3/+14
| | | | | | | | | | instancemethod "serializable" - SchemaType and subclasses Boolean, Enum are now serializable, including their ddl listener and other event callables. [ticket:1694] [ticket:1698] - AddConstraint/DropConstraint use the wrapper for _create_rule - added test coverage for AddConstraint override of _create_rule
* - Made sqlalchemy.sql.expressions.Executable part of publicMike Bayer2010-02-121-2/+2
| | | | | | | | | | | API, used for any expression construct that can be sent to execute(). FunctionElement now inherits Executable so that it gains execution_options(), which are also propagated to the select() that's generated within execute(). Executable in turn subclasses _Generative which marks any ClauseElement that supports the @_generative decorator - these may also become "public" for the benefit of the compiler extension at some point.
* - the "connection" argument from engine.transaction() andMike Bayer2010-01-291-3/+1
| | | | | | | engine.run_callable() is removed - Connection itself now has those methods. All four methods accept *args and **kwargs which are passed to the given callable, as well as the operating connection.
* - the "autocommit" flag on select() and text() as wellMike Bayer2010-01-281-1/+2
| | | | | | as select().autocommit() are deprecated - now call .execution_options(autocommit=True) on either of those constructs, also available directly on Connection and orm.Query.
* - reorganized and re-documented Oracle schema tests to assumeMike Bayer2010-01-171-7/+13
| | | | | | | | | test user has DBA privs, and all objects can be created /dropped. - added ORDER BY to oracle column listing - Oracle all_tables always limits to current user if schema not given. - views reflect - added documentation + a unit test for this. - Table(autoload) with no bind produces an error message specific to the fact that autoload_with should be the first option to try.
* - added "statement_options()" to Query, to so options can beMike Bayer2010-01-161-2/+1
| | | | | | | | | | | | | | | | | | | | | passed to the resulting statement. Currently only Select-statements have these options, and the only option used is "stream_results", and the only dialect which knows "stream_results" is psycopg2. - Query.yield_per() will set the "stream_results" statement option automatically. - Added "statement_options()" to Selects, which set statement specific options. These enable e.g. dialect specific options such as whether to enable using server side cursors, etc. - The psycopg2 now respects the statement option "stream_results". This option overrides the connection setting "server_side_cursors". If true, server side cursors will be used for the statement. If false, they will not be used, even if "server_side_cursors" is true on the connection. [ticket:1619] - added a "frozendict" from http://code.activestate.com/recipes/414283/, adding more default collections as immutable class vars on Query, Insert, Select
* happy new yearMike Bayer2010-01-071-1/+1
|
* merge r6616 of 0.5 branch, allow DefaultGenerators as "default" and "onupdate"Mike Bayer2010-01-071-1/+4
|
* - clarify ForeignKey docs, copy operationMike Bayer2010-01-021-8/+46
| | | | - link all classes/functions in expressions
* - The copy() method on Column now supports uninitialized,Mike Bayer2010-01-021-7/+9
| | | | | | unnamed Column objects. This allows easy creation of declarative helpers which place common columns on multiple subclasses (merged from 0.5 with changes).
* - Column() supports a keyword argument "sqlite_autoincrement", whichMike Bayer2009-12-181-1/+2
| | | | | | | | applies the SQLite keyword "AUTOINCREMENT" to columns within DDL - will prevent generation of a separate PRIMARY KEY constraint. [ticket:1016] - added docs - fixed underlines in mysql.rst
* - The Boolean type, when used on a backend that doesn'tMike Bayer2009-12-061-72/+84
| | | | | | | | | | have native boolean support, will generate a CHECK constraint "col IN (0, 1)" along with the int/smallint- based column type. This can be switched off if desired with create_constraint=False. Note that MySQL has no native boolean *or* CHECK constraint support so this feature isn't available on that platform. [ticket:1589]
* - reworked the DDL generation of ENUM and similar to be more platform agnostic.Mike Bayer2009-12-061-20/+31
| | | | | | | Uses a straight CheckConstraint with a generic expression. Preparing for boolean constraint in [ticket:1589] - CheckConstraint now accepts SQL expressions, though support for quoting of values will be very limited. we don't want to get into formatting dates and such.
* - subclassed Function off of new FunctionElement generic baseMike Bayer2009-11-101-38/+39
| | | | | | - removed "key" accessor of Function, Grouping - this doesn't seem to be used for anything - various formatting - documented the four "Element" classes in the compiler extension as per [ticket:1590]
* - ForeignKey(constraint=some_parent) is now private _constraintMike Bayer2009-11-091-71/+90
| | | | | - ForeignKey and ForeignKeyConstraint objects now correctly copy() all their public keyword arguments. [ticket:1605]
* - the `__contains__()` method of `MetaData` now acceptsMike Bayer2009-11-011-2/+4
| | | | | | strings or `Table` objects as arguments. If given a `Table`, the argument is converted to `table.key` first, i.e. "[schemaname.]<tablename>" [ticket:1541]
* - generalized Enum to issue a CHECK constraint + VARCHAR on default platformMike Bayer2009-10-251-8/+6
| | | | - added native_enum=False flag to do the same on MySQL, PG, if desired
* - Added new ENUM type to the Postgresql dialect, which exists as a schema-levelMike Bayer2009-10-251-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | construct and extends the generic Enum type. Automatically associates itself with tables and their parent metadata to issue the appropriate CREATE TYPE/DROP TYPE commands as needed, supports unicode labels, supports reflection. [ticket:1511] - MySQL ENUM now subclasses the new generic Enum type, and also handles unicode values implicitly, if the given labelnames are unicode objects. - Added a new Enum generic type, currently supported on Postgresql and MySQL. Enum is a schema-aware object to support databases which require specific DDL in order to use enum or equivalent; in the case of PG it handles the details of `CREATE TYPE`, and on other databases without native enum support can support generation of CHECK constraints. [ticket:1109] [ticket:1511] - types documentation updates - some cleanup on schema/expression docs
* deprecations per [ticket:1498]:Mike Bayer2009-10-151-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - deprecated PassiveDefault - use DefaultClause. - the BINARY and MSBinary types now generate "BINARY" in all cases. Omitting the "length" parameter will generate "BINARY" with no length. Use BLOB to generate an unlengthed binary column. - the "quoting='quoted'" argument to MSEnum/ENUM is deprecated. It's best to rely upon the automatic quoting. - "shortname" attribute on bindparam() is removed. - fold_equivalents flag on join is deprecated (will remain until [ticket:1131] is implemented) - "scalar" flag on select() is removed, use select.as_scalar(). - 'transactional' flag on sessionmaker() and others is removed. Use 'autocommit=True' to indicate 'transactional=False'. - 'polymorphic_fetch' argument on mapper() is removed. Loading can be controlled using the 'with_polymorphic' option. - 'select_table' argument on mapper() is removed. Use 'with_polymorphic=("*", <some selectable>)' for this functionality. - 'proxy' argument on synonym() is removed. This flag did nothing throughout 0.5, as the "proxy generation" behavior is now automatic. - Passing a single list of elements to eagerload(), eagerload_all(), contains_eager(), lazyload(), defer(), and undefer() instead of multiple positional -args is deprecated. - Passing a single list of elements to query.order_by(), query.group_by(), query.join(), or query.outerjoin() instead of multiple positional *args is deprecated. - query.iterate_instances() is removed. Use query.instances(). - Query.query_from_parent() is removed. Use the sqlalchemy.orm.with_parent() function to produce a "parent" clause, or alternatively query.with_parent(). - query._from_self() is removed, use query.from_self() instead. - the "comparator" argument to composite() is removed. Use "comparator_factory". - RelationProperty._get_join() is removed. - the 'echo_uow' flag on Session is removed. Use logging on the "sqlalchemy.orm.unitofwork" name. - session.clear() is removed. use session.expunge_all(). - session.save(), session.update(), session.save_or_update() are removed. Use session.add() and session.add_all(). - the "objects" flag on session.flush() remains deprecated. - the "dont_load=True" flag on session.merge() is deprecated in favor of "load=False". - passing an InstanceState (internal SQLAlchemy state object) to attributes.init_collection() or attributes.get_history() is deprecated. These functions are public API and normally expect a regular mapped object instance. - the 'engine' parameter to declarative_base() is removed. Use the 'bind' keyword argument.
* - an executemany() now requires that all bound parameterMike Bayer2009-10-151-0/+4
| | | | | | | | | | | | sets require that all keys are present which are present in the first bound parameter set. The structure and behavior of an insert/update statement is very much determined by the first parameter set, including which defaults are going to fire off, and a minimum of guesswork is performed with all the rest so that performance is not impacted. For this reason defaults would otherwise silently "fail" for missing parameters, so this is now guarded against. [ticket:1566]
* remove instanceof() in favor of memoized flags, part of [ticket:1566]Mike Bayer2009-10-141-1/+21
|
* - added "ddl" argument to the "on" callable of DDLElement [ticket:1538]Mike Bayer2009-10-121-50/+55
| | | | | | - fixed the imports in the "postgres" cleanup dialect - renamed "schema_item" attribute/argument of DDLElement to "target".
* - unit test fixesMike Bayer2009-10-101-2/+2
| | | | | - py3k readme - removed column.sequence accessor
* merge from branches/clauseelement-nonzeroPhilip Jenvey2009-09-241-5/+5
| | | | | | adds a __nonzero__ to _BinaryExpression to avoid faulty comparisons during hash collisions (which only occur on Jython) fixes #1547
* all about DDL eventsMike Bayer2009-09-111-1/+4
|
* docsMike Bayer2009-09-101-5/+6
|
* - Fixed column.copy() to copy defaults and onupdates.Mike Bayer2009-08-281-0/+4
| | | | [ticket:1373]
* python3k fixesMike Bayer2009-08-091-1/+10
|
* documentation updatesMike Bayer2009-08-071-14/+40
|
* merge 0.6 series to trunk.Mike Bayer2009-08-061-588/+622
|
* - Fixed bug in Table and Column whereby passing emptyMike Bayer2009-07-251-12/+8
| | | | | dict for "info" argument would raise an exception. [ticket:1482]
* changed reference to PostgreSQL in docs.rel_0_5_5Mike Bayer2009-07-131-1/+1
|
* removed needless "thread" imports from utilMike Bayer2009-05-301-1/+1
|
* Added multi part schema name support. Closes #594 and #1341.Michael Trier2009-04-111-6/+22
|
* - Fixed __repr__() and other _get_colspec() methods onMike Bayer2009-03-271-1/+6
| | | | | ForeignKey constructed from __clause_element__() style construct (i.e. declarative columns). [ticket:1353]
* - use ForeignKey.column as _colspec source in Column._make_proxy(), ↵Mike Bayer2009-01-141-6/+14
| | | | | | | | | | | | | preventing needless redundant string arithmetic in memoized ForeignKey.column method - _pre_existing_column attribute becomes optional, only needed for original Table-bound column, not proxies - compare two ForeignKeys based on target_fullname, don't assume self._colspec is a string - Fixed bug when overriding a Column with a ForeignKey on a reflected table, where derived columns (i.e. the "virtual" columns of a select, etc.) would inadvertently call upon schema-level cleanup logic intended only for the original column. [ticket:1278]
* prefer this methodsMike Bayer2009-01-131-8/+3
|
* - Column with no name (as in declarative) won't raise aMike Bayer2009-01-131-1/+8
| | | | | NoneType error when it's string output is requsted (such as in a stack trace).