Commit Graph

10240 Commits

Author SHA1 Message Date
Mike Bayer 84cca0e286 dev 2014-08-18 18:30:14 -04:00
Mike Bayer c65ed17bc1 Merge branch 'master' into ticket_3100
Conflicts:
	lib/sqlalchemy/orm/mapper.py
	lib/sqlalchemy/orm/persistence.py
2014-08-18 17:44:35 -04:00
Mike Bayer 399c039397 - optimize collection of cols we insert as none 2014-08-18 17:15:04 -04:00
Mike Bayer 4ed640ba90 - move out checks for table in mapper._pks_by_table 2014-08-18 17:02:52 -04:00
Mike Bayer 4ade138769 - further reorganize collect_insert_commands to distinguish between
setting up given values vs. defaults.  again trying to shoot for
making this of more general use
2014-08-18 16:44:07 -04:00
Mike Bayer 06dec268e5 - organize persistence methods in terms of generators,
narrow down argument lists and generator items for each function
down to just what each function needs.   This will help for them
to be of more multipurpose use for bulk operations
2014-08-18 16:32:59 -04:00
Mike Bayer d39927ec20 - major simplification of _collect_update_commands. in particular,
we only call upon the history API fully for primary key columns.
We also now skip the whole step of looking at PK columns and using
any history at all if no net changes are detected on the object.
2014-08-18 13:18:46 -04:00
Mike Bayer 530d3f07e0 - Fixed bug where attribute "set" events or columns with
``@validates`` would have events triggered within the flush process,
when those columns were the targets of a "fetch and populate"
operation, such as an autoincremented primary key, a Python side
default, or a server-side default "eagerly" fetched via RETURNING.
fixes #3167
2014-08-17 20:06:16 -04:00
Malik Diarra faa5a90676 Adding postgres create table options documentation 2014-08-17 16:56:53 +02:00
Malik Diarra 9eacc8d42a Correcting options name from withoids to with_oids 2014-08-17 02:48:21 +02:00
Mike Bayer 2de7f94739 - oldest screwup in the book, forgot the file 2014-08-16 20:17:08 -04:00
Malik Diarra 8e03430acd quoting tablespace name in create table command in postgresql dialect 2014-08-17 01:56:02 +02:00
Malik Diarra d6873904c4 Adding oids and on_commit table options 2014-08-17 01:56:02 +02:00
Malik Diarra ef6042ff46 Adding a tablespace options for postgresql create table 2014-08-17 01:56:02 +02:00
Mike Bayer b577afcb2b - rework profiling, zoomark tests into single tests so that
they can be used under xdist
2014-08-16 19:49:07 -04:00
Mike Bayer 589f205d53 - changelog for pullreq github:125
- add pg8000 version detection for the "sane multi rowcount" feature
2014-08-16 13:57:46 -04:00
Mike Bayer 948986ad59 Merge remote-tracking branch 'origin/pr/125' into pr125 2014-08-16 13:48:57 -04:00
Mike Bayer 4b288a9553 - support dialects w/o sane multi row count again 2014-08-16 13:46:15 -04:00
Mike Bayer e220ea11de - need list() here for py3k 2014-08-16 13:37:49 -04:00
Mike Bayer 7fa5952214 - max failures 25
- guard against some potential pytest snarkiness
2014-08-16 13:33:02 -04:00
Mike Bayer ca69e45603 - mutablemapping adds compiler overhead, so screw it 2014-08-15 18:39:26 -04:00
Mike Bayer 239464a98a - port the _collect_insert_commands optimizations from ticket_3100 2014-08-15 18:33:42 -04:00
Mike Bayer 8773307257 - refine this enough so that _collect_insert_commands() seems
to be more than twice as fast now (.039 vs. .091); bulk_insert()
and bulk_update() do their own collection but now both call into
_emit_insert_statements() / _emit_update_statements(); the approach
seems to have no impact on insert speed, still .85 for the
insert test
2014-08-15 18:22:08 -04:00
Mike Bayer 591f2e4ed2 - change to be represented as two very fast bulk_insert() and bulk_update() methods 2014-08-15 15:53:38 -04:00
Mike Bayer 6bc676f56d dev 2014-08-15 15:53:12 -04:00
Mike Bayer 191fd3e27e - proof of concept 2014-08-15 15:52:35 -04:00
Mike Bayer 652a24f030 - The :class:.IdentityMap exposed from :class:.Session.identity
now returns lists for ``items()`` and ``values()`` in Py3K.
Early porting to Py3K here had these returning iterators, when
they technically should be "iterable views"..for now, lists are OK.
2014-08-15 15:13:13 -04:00
Mike Bayer 5a68f856da - TIL that dict.keys() in py3K is not an iterator, it is an iterable
view.  So copy collections.OrderedDict and use MutableMapping to set up
keys, items, values on our own OrderedDict.

Conflicts:
	lib/sqlalchemy/engine/base.py
2014-08-15 14:59:12 -04:00
Mike Bayer 961217aa92 - clean up provision and keep sqlite on memory DBs if thats what we start with 2014-08-15 14:38:33 -04:00
Mike Bayer d768ec2c26 - don't add the parent attach event within _on_table_attach
if we already have a table; this prevents reentrant calls and
we aren't supporting columns/etc being moved around between different parents
2014-08-15 14:27:12 -04:00
Mike Bayer b0411e80df - other test fixes 2014-08-15 00:19:57 -04:00
Mike Bayer b952d892d6 - modify how class state is tracked here as it seems like things
are a little more crazy under xdist mode
2014-08-15 00:19:32 -04:00
Mike Bayer bc509dd50d - UPDATE statements can now be batched within an ORM flush
into more performant executemany() call, similarly to how INSERT
statements can be batched; this will be invoked within flush
to the degree that subsequent UPDATE statements for the
same mapping and table involve the identical columns within the
VALUES clause, as well as that no VALUES-level SQL expressions
are embedded.
- some other inlinings within persistence.py
2014-08-14 20:47:49 -04:00
Mike Bayer f0a56bc5aa pep8 2014-08-14 20:37:28 -04:00
Mike Bayer 253523c57f pep8 2014-08-14 20:01:59 -04:00
Mike Bayer 6a21f9e328 - The string keys that are used to determine the columns impacted
for an INSERT or UPDATE are now sorted when they contribute towards
the "compiled cache" cache key.   These keys were previously not
deterministically ordered, meaning the same statement could be
cached multiple times on equivalent keys, costing both in terms of
memory as well as performance.
fixes #3165
2014-08-14 20:00:35 -04:00
Rodrigo Menezes 4b26bf2e6f Add a view synonym too for consistency. 2014-08-14 17:19:10 -04:00
Rodrigo Menezes 8af9c7670e Merge branch 'master' of https://github.com/rclmenezes/sqlalchemy 2014-08-14 17:08:55 -04:00
Rodrigo Menezes 649f06759d Added support for postgres_relkind. 2014-08-14 14:47:23 -04:00
Mike Bayer 4a4cccfee5 - Removing (or adding) an event listener at the same time that the event
is being run itself, either from inside the listener or from a
concurrent thread, now raises a RuntimeError, as the collection used is
now an instance of ``colletions.deque()`` and does not support changes
while being iterated.  Previously, a plain Python list was used where
removal from inside the event itself would produce silent failures.
fixes #3163
2014-08-14 14:40:28 -04:00
Mike Bayer c0c6aaa58a pep8 2014-08-14 14:21:03 -04:00
Mike Bayer fe1a09029b on second thought we need to prioritize what really needs to be
here and what's just in changelog
2014-08-14 14:15:46 -04:00
Mike Bayer 6ca694610b - updates 2014-08-14 13:25:09 -04:00
Mike Bayer e2d05259ca - repair against use here 2014-08-14 00:03:03 -04:00
Mike Bayer 7fc08fe89a - The `info` parameter has been added to the constructor for
:class:`.SynonymProperty` and :class:`.ComparableProperty`.
- The ``info`` parameter has been added as a constructor argument
to all schema constructs including :class:`.MetaData`,
:class:`.Index`, :class:`.ForeignKey`, :class:`.ForeignKeyConstraint`,
:class:`.UniqueConstraint`, :class:`.PrimaryKeyConstraint`,
:class:`.CheckConstraint`.

fixes #2963
2014-08-13 19:45:34 -04:00
Mike Bayer ea85c7053d - The :meth:.InspectionAttr.info collection is now moved down to
:class:`.InspectionAttr`, where in addition to being available
on all :class:`.MapperProperty` objects, it is also now available
on hybrid properties, association proxies, when accessed via
:attr:`.Mapper.all_orm_descriptors`.
fixes #2971
2014-08-13 19:20:44 -04:00
Mike Bayer 44d21de457 - rename _InspectionAttr to InspectionAttr 2014-08-13 18:47:52 -04:00
Mike Bayer 38cb9bf784 flake8 cleanup 2014-08-13 18:46:44 -04:00
Mike Bayer 190961157d Merge branch 'pr126'
Conflicts:
	doc/build/changelog/changelog_10.rst
2014-08-13 17:50:50 -04:00
Mike Bayer f39767ad72 - public method name is get_enums()
- return a list of dicts like other methods do
- don't combine 'schema' with 'name', leave them separate
- support '*' argument so that we can retrieve cross-schema
if needed
- remove "conn" argument
- use bound parameters for 'schema' in SQL
- order by schema, name, label
- adapt _load_enums changes to column reflection
- changelog
- module docs for get_enums()
- add drop of enums to --dropfirst
2014-08-13 17:42:33 -04:00