Commit Graph

9415 Commits

Author SHA1 Message Date
Mike Bayer 7dfd46ec44 - cyclomatic complexity: instrument_class goes from E to an A 2014-09-27 18:15:21 -04:00
Mike Bayer b275ac099f - cyclomatic complexity; break up reflecttable(), goes from E to B 2014-09-27 18:14:59 -04:00
Mike Bayer 573877b4bc - repair autorollback for branches 2014-09-26 21:41:15 -04:00
Mike Bayer b89523f0b7 - Fixed bug where a "branched" connection, that is the kind you get
when you call :meth:`.Connection.connect`, would not share transaction
status with the parent.  The architecture of branching has been tweaked
a bit so that the branched connection defers to the parent for
all transactional status and operations.
fixes #3190
2014-09-26 16:25:26 -04:00
Mike Bayer fbddf193a6 - Fixed bug where a "branched" connection, that is the kind you get
when you call :meth:`.Connection.connect`, would not share invalidation
status with the parent.  The architecture of branching has been tweaked
a bit so that the branched connection defers to the parent for
all invalidation status and operations.
fixes #3215
2014-09-26 14:55:36 -04:00
Mike Bayer b1a956d421 - add explicit warning re: polymorphic_on, cascading is not supported
at this time.  ref #3214
2014-09-26 12:50:18 -04:00
Mike Bayer cb0c1eda24 comments 2014-09-26 10:59:39 -04:00
Mike Bayer 19ec6c3368 - "column already assigned" message has been updated in 7f82c55f 2014-09-25 21:16:13 -04:00
Mike Bayer 7f82c55fa7 - refactor of declarative, break up into indiviudal methods
that are now affixed to _MapperConfig
- declarative now creates column copies ahead of time
so that they are ready to go for a declared_attr
- overhaul of declared_attr; memoization, cascading modifier
- A relationship set up with :class:`.declared_attr` on
a :class:`.AbstractConcreteBase` base class will now be configured
on the abstract base mapping automatically, in addition to being
set up on descendant concrete classes as usual.
fixes #2670
- The :class:`.declared_attr` construct has newly improved
behaviors and features in conjunction with declarative.  The
decorated function will now have access to the final column
copies present on the local mixin when invoked, and will also
be invoked exactly once for each mapped class, the returned result
being memoized.   A new modifier :attr:`.declared_attr.cascading`
is added as well. fixes #3150
- the original plan for #3150 has been scaled back; by copying
mixin columns up front and memoizing, we don't actually need
the "map properties later" thing.
- full docs + migration notes
2014-09-25 21:08:17 -04:00
Mike Bayer 5e7cb037e8 - convert to spaces 2014-09-25 21:07:15 -04:00
Mike Bayer 42837f4bca - clarify documentation on exists() that it is preferred to be in the
WHERE clause.  fixes #3212
2014-09-24 14:49:30 -04:00
Mike Bayer 360477cc3a - flake8 all of test/ext/declarative 2014-09-23 13:25:22 -04:00
Mike Bayer 5508388f03 - The :mod:sqlalchemy.ext.automap extension will now set
``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
2014-09-22 23:00:45 -04:00
Mike Bayer 1dacbb25f8 pep8/flake8 2014-09-22 22:22:09 -04:00
Mike Bayer f458ef8456 - these tests don't test anything in SQLAlchemy - from our perpsective,
we need to be in transactions (tested elsewhere) and we need to
emit the correct FOR UPDATE strings (tested elsewhere).  There's nothing
in SQLA to be tested as far as validating that for update causes exceptions
or not, and these tests frequently fail as they are timing sensitive.
2014-09-19 12:41:07 -04:00
Mike Bayer b36cdefba2 - Fixed bug that affected generally the same classes of event
as that of 🎫`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
2014-09-18 17:49:07 -04:00
Mike Bayer fe5af837dc fix test 2014-09-18 16:28:54 -04:00
Mike Bayer c7ec21b29e - Fixed an unlikely race condition observed in some exotic end-user
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
2014-09-18 15:42:27 -04:00
Mike Bayer 9ae4db27b9 - Fixed bug that affected many classes of event, particularly
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
2014-09-18 15:24:40 -04:00
Mike Bayer f82f6d55dc - Added new method :meth:.Select.with_statement_hint and ORM
method :meth:`.Query.with_statement_hint` to support statement-level
hints that are not specific to a table.
fixes #3206
2014-09-18 11:44:48 -04:00
Mike Bayer e3f07f7206 - Added support for the Oracle table option ON COMMIT. This is being
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.
2014-09-17 19:43:45 -04:00
Mike Bayer 1f2f88d8ff - not sure what this is testing but remove the self.l that might
be contributing to pypy not cleaning up on this one
2014-09-17 15:40:09 -04:00
Mike Bayer 354e118f4b - we can start checking these flake rules 2014-09-17 15:39:47 -04:00
Mike Bayer c926df3617 - changelog for #3203; fixes #3203 2014-09-17 15:19:19 -04:00
Mike Bayer 7864f80a62 Merge branch 'sqlite-temp-table-reflection' of https://bitbucket.org/jerdfelt/sqlalchemy/branch/sqlite-temp-table-reflection into pr31 2014-09-17 15:16:33 -04:00
Mike Bayer cb23fa243f - Added :meth:.Inspector.get_temp_table_names and
: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
2014-09-17 15:15:21 -04:00
Mike Bayer 1217d6ce97 - move this to the correct location 2014-09-17 14:02:34 -04:00
Mike Bayer 4a4cbe5ff2 - comment this out (again) 2014-09-17 13:12:41 -04:00
Mike Bayer 3a6cd72bea Merge branch 'pr128' 2014-09-17 13:11:49 -04:00
Mike Bayer be57def4b9 - repair get_foreign_table_names() for PGInsp/dialect level
- repair get_view_names()
- changelog + migration note
2014-09-17 13:11:22 -04:00
Mike Bayer 27617986bb keep this off for the moment as jenkins isn't set up for this yet 2014-09-17 12:41:55 -04:00
Mike Bayer 414bc1c64d - the actual round trip requires password authent set up for the user;
we don't actually need a round trip test here as we're only testing reflection.
2014-09-17 12:41:08 -04:00
Johannes Erdfelt 9d402e204d Handle sqlite get_unique_constraints() call for temporary tables
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.
2014-09-17 08:01:01 -07:00
Mike Bayer a985f84ed6 - Fixed the version string detection in the pymssql dialect to
work with Microsoft SQL Azure, which changes the word "SQL Server"
to "SQL Azure".
fixes #3151
2014-09-16 17:40:06 -04:00
Mike Bayer 8546153d5d - break out and fix tests for materialized view and foreign tables. foreign tables not working 2014-09-16 17:24:34 -04:00
Mike Bayer ecda5429af Merge remote-tracking branch 'origin/pr/128' into pr128 2014-09-16 16:55:05 -04:00
Mike Bayer cc3dba01db - raise from cause here to preserve stack trace 2014-09-16 16:20:22 -04:00
mike bayer 7094193c61 Merge pull request #138 from BY-jk/master
Added EXASolution dialect to documentation
2014-09-16 15:10:36 -04:00
Jan 4f39e3839f Added EXASolution dialect to documentation 2014-09-16 20:54:27 +02:00
Mike Bayer 47a6ffe090 - cant do xargs in tox.ini as it doesnt run outside of postgresql/mysql 2014-09-15 15:29:54 -04:00
Mike Bayer 2c46128a2f - use compat.u for python3.2, fixes #3198 2014-09-15 14:57:41 -04:00
Mike Bayer 8b7f57d258 - fix issue where nose Failure object comes into play here 2014-09-15 14:53:20 -04:00
Mike Bayer d7498cf4ad - remove some crufty old testing options
- 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
2014-09-14 21:41:13 -04:00
Jim Hokanson 7fd3f05805 Updated documenation for engines.rst
Clarified connecting to absolute path for sqlite using Windows.
2014-09-14 00:25:41 -04:00
Mike Bayer f98c89d2be - Fixed warning that would emit when a complex self-referential
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
2014-09-11 11:51:44 -04:00
Mike Bayer 14d2bb074c - Fixed bug in ordering list where the order of items would be
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
2014-09-10 14:14:50 -04:00
Mike Bayer 706d4fcc4f - for whatever reason, Insert.values() with multi values wasn't
in the 0.8 migration, so let's just add that
2014-09-09 18:59:59 -04:00
Mike Bayer 48080d88be - add in all the method-chained methods to the parameter descriptions
on select().  improve some descriptions and add more info for limit()/
offset(), including new 1.0 functionality.
2014-09-09 17:29:37 -04:00
Mike Bayer 7904ebc62e - rework the previous "order by" system in terms of the new one,
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
2014-09-08 16:31:11 -04:00
Mike Bayer e4996d4f54 - check for None linker... 2014-09-08 13:01:43 -04:00