summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
Commit message (Collapse)AuthorAgeFilesLines
* wip3296Mike Bayer2015-02-042-8/+35
|
* - Fixed bug in lazy loading SQL construction whereby a complexMike Bayer2015-02-021-14/+18
| | | | | | | | primaryjoin that referred to the same "local" column multiple times in the "column that points to itself" style of self-referential join would not be substituted in all cases. The logic to determine substitutions here has been reworked to be more open-ended. fixes #3300
* - don't overwrite an existing _strategy_keys collection;Mike Bayer2015-02-021-1/+2
| | | | this would cause LazyLoader to be initialized twice per property.
* - Repaired support for Postgresql UUID types in conjunction withMike Bayer2015-02-011-3/+35
| | | | | | | | | | the ARRAY type when using psycopg2. The psycopg2 dialect now employs use of the psycopg2.extras.register_uuid() hook so that UUID values are always passed to/from the DBAPI as UUID() objects. The :paramref:`.UUID.as_uuid` flag is still honored, except with psycopg2 we need to convert returned UUID objects back into strings when this is disabled. fixes #2940
* - Added support for the :class:`postgresql.JSONB` datatype whenMike Bayer2015-01-311-10/+16
| | | | | | | | | | | | | | | | | using psycopg2 2.5.4 or greater, which features native conversion of JSONB data so that SQLAlchemy's converters must be disabled; additionally, the newly added psycopg2 extension ``extras.register_default_jsonb`` is used to establish a JSON deserializer passed to the dialect via the ``json_deserializer`` argument. Also repaired the Postgresql integration tests which weren't actually round-tripping the JSONB type as opposed to the JSON type. Pull request courtesy Mateusz Susik. - Repaired the use of the "array_oid" flag when registering the HSTORE type with older psycopg2 versions < 2.4.3, which does not support this flag, as well as use of the native json serializer hook "register_default_json" with user-defined ``json_deserializer`` on psycopg2 versions < 2.5, which does not include native json.
* Merge remote-tracking branch 'origin/pr/145' into pr145Mike Bayer2015-01-311-2/+14
|\
| * Psycopg2 JSONB support.pr/145Mateusz Susik2014-10-241-2/+14
| |
* | - The :class:`.CheckConstraint` construct now supports namingMike Bayer2015-01-302-28/+43
| | | | | | | | | | | | | | | | | | | | conventions that include the token ``%(column_0_name)s``; the constraint expression is scanned for columns. Additionally, naming conventions for check constraints that don't include the ``%(constraint_name)s`` token will now work for :class:`.SchemaType`- generated constraints, such as those of :class:`.Boolean` and :class:`.Enum`; this stopped working in 0.9.7 due to :ticket:`3067`. fixes #3299
* | - Fixed bug in 0.9's foreign key setup system, such thatMike Bayer2015-01-281-9/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | the logic used to link a :class:`.ForeignKey` to its parent could fail when the foreign key used "link_to_name=True" in conjunction with a target :class:`.Table` that would not receive its parent column until later, such as within a reflection + "useexisting" scenario, if the target column in fact had a key value different from its name, as would occur in reflection if column reflect events were used to alter the .key of reflected :class:`.Column` objects so that the link_to_name becomes significant. Also repaired support for column type via FK transmission in a similar way when target columns had a different key and were referenced using link_to_name. fixes #3298
* | - additional test adjustments for pypy / psycopg2cffi. ThisMike Bayer2015-01-262-3/+10
| | | | | | | | | | | | | | | | | | | | consists mainly of adjusting fixtures to ensure connections are closed explicitly. psycopg2cffi also handles unicode bind parameter names differently than psycopg2, and seems to possibly have a little less control over floating point values at least in one test which is marked as a "fail", though will see if it runs differently on linux than osx.. - changelog for psycopg2cffi, fixes #3052
* | Added psycopg2cffi dialectShaun Stanworth2015-01-263-4/+61
| |
* | Merge branch 'bb_issue_3262' of https://bitbucket.org/xflr6/sqlalchemyMike Bayer2015-01-261-0/+9
|\ \
| * | warn on duplicate polymorphic_identitySebastian Bank2014-12-041-0/+9
| | |
* | | Merge remote-tracking branch 'origin/pr/150'Mike Bayer2015-01-261-1/+2
|\ \ \
| * | | Report the type of unexpected expression objectspr/150Ryan P. Kelly2014-11-201-1/+2
| | | |
* | | | - remove the clever approach w/ dialect events, and remove the needMike Bayer2015-01-251-17/+20
| | | | | | | | | | | | | | | | | | | | | | | | for a for-loop through an empty tuple. we add one more local flag to handle the logic without repetition of dialect.do_execute() calls.
* | | | - remove context-specific post-crud logic from Connection and inline post-crudMike Bayer2015-01-253-77/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | logic to some degree in DefaultExecutionContext. In particular we are removing post_insert() which doesn't appear to be used based on a survey of prominent third party dialects. Callcounts aren't added to existing execute profiling tests and inserts might be a little better. - simplify the execution_options join in DEC. Callcounts don't appear affected.
* | | | - Added new user-space accessors for viewing transaction isolationMike Bayer2015-01-206-17/+190
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | levels; :meth:`.Connection.get_isolation_level`, :attr:`.Connection.default_isolation_level`. - enhance documentation inter-linkage between new accessors, existing isolation_level parameters, as well as in the dialect-level methods which should be fully covered by Engine/Connection level APIs now.
* | | | - restore r611883ffb35ca6664649f6328ae8 with additional fixes and an ↵Mike Bayer2015-01-192-17/+38
| | | | | | | | | | | | | | | | | | | | | | | | additional test that is much more specific to #1326
* | | | - reverse the last commit temporarily as it breaks all the polymorphic casesMike Bayer2015-01-192-42/+24
| | | |
* | | | - The primary :class:`.Mapper` of a :class:`.Query` is now passed to theMike Bayer2015-01-192-24/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | :meth:`.Session.get_bind` method when calling upon :meth:`.Query.count`, :meth:`.Query.update`, :meth:`.Query.delete`, as well as queries against mapped columns, :obj:`.column_property` objects, and SQL functions and expressions derived from mapped columns. This allows sessions that rely upon either customized :meth:`.Session.get_bind` schemes or "bound" metadata to work in all relevant cases. fixes #3227 fixes #3242 fixes #1326
* | | | - further fixes and even better tests for this blockMike Bayer2015-01-191-3/+8
| | | |
* | | | - another adjustmentMike Bayer2015-01-191-2/+3
| | | |
* | | | - fix another issue from rf49c367ef, add another testMike Bayer2015-01-181-1/+1
| | | |
* | | | - rework assertsql system, fixes #3293Mike Bayer2015-01-183-294/+242
| | | |
* | | | - fix a regression from ref #3178, where dialects that don't actually supportMike Bayer2015-01-171-4/+12
| | | | | | | | | | | | | | | | | | | | sane multi rowcount (e.g. pyodbc) would fail on multirow update. add a test that mocks this breakage into plain dialects
* | | | - add an exclusion here that helps with the case of 3rd partyMike Bayer2015-01-171-1/+2
| | | | | | | | | | | | | | | | test suite redefining an existing test in test_suite
* | | | - Custom dialects that implement :class:`.GenericTypeCompiler` canMike Bayer2015-01-1611-240/+294
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | now be constructed such that the visit methods receive an indication of the owning expression object, if any. Any visit method that accepts keyword arguments (e.g. ``**kw``) will in most cases receive a keyword argument ``type_expression``, referring to the expression object that the type is contained within. For columns in DDL, the dialect's compiler class may need to alter its ``get_column_specification()`` method to support this as well. The ``UserDefinedType.get_col_spec()`` method will also receive ``type_expression`` if it provides ``**kw`` in its argument signature. fixes #3074
* | | | - Fixed bug where Postgresql dialect would fail to render anMike Bayer2015-01-161-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | expression in an :class:`.Index` that did not correspond directly to a table-bound column; typically when a :func:`.text` construct was one of the expressions within the index; or could misinterpret the list of expressions if one or more of them were such an expression. fixes #3174
* | | | - The "wildcard" loader options, in particular the one set up byMike Bayer2015-01-134-4/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the :func:`.orm.load_only` option to cover all attributes not explicitly mentioned, now takes into account the superclasses of a given entity, if that entity is mapped with inheritance mapping, so that attribute names within the superclasses are also omitted from the load. Additionally, the polymorphic discriminator column is unconditionally included in the list, just in the same way that primary key columns are, so that even with load_only() set up, polymorphic loading of subtypes continues to function correctly. fixes #3287
* | | | - refine the previous commit a bitMike Bayer2015-01-131-20/+27
| | | |
* | | | - The multi-values version of :meth:`.Insert.values` has beenMike Bayer2015-01-134-36/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | repaired to work more usefully with tables that have Python- side default values and/or functions, as well as server-side defaults. The feature will now work with a dialect that uses "positional" parameters; a Python callable will also be invoked individually for each row just as is the case with an "executemany" style invocation; a server- side default column will no longer implicitly receive the value explicitly specified for the first row, instead refusing to invoke without an explicit value. fixes #3288
* | | | Add native_enum flag to Enum's repr() resultDimitris Theodorou2015-01-121-0/+1
| | | | | | | | | | | | | | | | Needed for alembic autogenerate rendering.
* | | | - doc fixesMike Bayer2015-01-062-12/+14
| | | |
* | | | - Fixed bug where if an exception were thrown at the start of aMike Bayer2015-01-051-31/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | :class:`.Query` before it fetched results, particularly when row processors can't be formed, the cursor would stay open with results pending and not actually be closed. This is typically only an issue on an interpreter like Pypy where the cursor isn't immediately GC'ed, and can in some circumstances lead to transactions/ locks being open longer than is desirable. fixes #3285
* | | | - add MemoizedSlots, a generalized solution to using __getattr__Mike Bayer2015-01-0515-52/+175
| | | | | | | | | | | | | | | | | | | | for memoization on a class that uses slots. - apply many more __slots__. mem use for nova now at 46% savings
* | | | - more callcountsMike Bayer2015-01-051-2/+4
| | | | | | | | | | | | | | | | - add the platform key to the error output
* | | | - callcountsMike Bayer2015-01-041-2/+0
| | | | | | | | | | | | | | | | - this needs to be serializable and isn't high volume so just whack the slots
* | | | - scale back _Dispatch and _JoinedDispatcher to use a __getitem__ schemeMike Bayer2015-01-041-12/+29
| | | | | | | | | | | | | | | | | | | | | | | | to start up listener collections; this pulls the overhead off of construction and makes performance much like the descriptor version, while still allowing slots. Fix up some profiles.
* | | | - clean up default comparator which doesn't need to be a class,Mike Bayer2015-01-044-267/+272
| | | | | | | | | | | | | | | | get PG stuff working
* | | | - strategies + declarativeMike Bayer2015-01-044-0/+36
| | | |
* | | | - wip - start factoring events so that we aren't using descriptors for dispatch,Mike Bayer2015-01-047-127/+160
| | | | | | | | | | | | | | | | allowing us to move to __slots__
* | | | - start trying to move things into __slots__. This seems to reduce theslotsMike Bayer2015-01-0411-96/+132
| | | | | | | | | | | | | | | | | | | | size of the many per-column objects we're hitting, but somehow the overall memory is hardly being reduced at all in initial testing
* | | | - use a different bitwise approach here that doesn't require iteratingMike Bayer2015-01-033-6/+16
| | | | | | | | | | | | | | | | through all possible set values
* | | | - The :class:`.mysql.SET` type has been overhauled to no longerMike Bayer2015-01-032-51/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | assume that the empty string, or a set with a single empty string value, is in fact a set with a single empty string; instead, this is by default treated as the empty set. In order to handle persistence of a :class:`.mysql.SET` that actually wants to include the blank value ``''`` as a legitimate value, a new bitwise operational mode is added which is enabled by the :paramref:`.mysql.SET.retrieve_as_bitwise` flag, which will persist and retrieve values unambiguously using their bitflag positioning. Storage and retrieval of unicode values for driver configurations that aren't converting unicode natively is also repaired. fixes #3283
* | | | - tighten the inspection in _ColumnEntity to reduce unnecessaryMike Bayer2015-01-031-14/+14
| | | | | | | | | | | | | | | | isinstance() calls, express intent more clearly
* | | | - test failures:Mike Bayer2015-01-022-2/+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
* | | | - repair drop_all_tablesMike Bayer2015-01-021-1/+1
| | | |
* | | | - restate sort_tables in terms of a more fine grainedMike Bayer2015-01-0110-75/+441
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | - Added a new accessor :attr:`.Table.foreign_key_constraints`Mike Bayer2015-01-011-0/+27
| | | | | | | | | | | | | | | | | | | | to complement the :attr:`.Table.foreign_keys` collection, as well as :attr:`.ForeignKeyConstraint.referred_table`.