Commit Graph

1921 Commits

Author SHA1 Message Date
Mike Bayer c08192ae5b - Comparison of many-to-one relation to NULL is
properly converted to IS NOT NULL based on not_().
2008-11-21 03:49:36 +00:00
Mike Bayer c2cbdb2ce0 r5281 knocked down callcounts in 2.5.. 2008-11-17 02:02:42 +00:00
Mike Bayer e1268d4f57 - Query.select_from(), from_statement() ensure
that the given argument is a FromClause,
or Text/Select/Union, respectively.

- Query.add_column() can accept FromClause objects
in the same manner as session.query() can.
2008-11-16 19:33:26 +00:00
Mike Bayer 3e486caaab - switched session.save() to session.add() throughout declarative test
- Fixed PendingDeprecationWarning involving order_by
parameter on relation(). [ticket:1226]
- Unit tests still filter pending deprecation warnings but have a commented-out
line to temporarily disable this behavior.  Tests need to be fully converted
before we can turn this on.
2008-11-14 18:57:24 +00:00
Michael Trier b2a7892b10 Pulled out values test that uses boolean evaluation in the SELECT in order to appropriately flag it as not supported on mssql. I sure hope I didn't jack things up for other dialects. Cleaned up a comment and removed some commented pdb statements. 2008-11-14 03:57:07 +00:00
Michael Trier 1227a7674f Fixed up a lot of missing order_by statements in the tests when using offset. A lot of dialects don't really require order_by although you'll get unpredictable results. mssql does require order_by with an offset, so this fixes problems with that dialect. 2008-11-14 03:57:00 +00:00
Michael Trier 43ecc7a581 The str(query) output is also correct on the mssql dialect. 2008-11-14 03:56:55 +00:00
Mike Bayer 0148adec30 - Can now use a custom "inherit_condition" in
__mapper_args__ when using declarative.
2008-11-12 15:43:17 +00:00
Michael Trier 260c201f65 Corrected mssql schema named subqueries from not properly aliasing the columns. Fixes #973. 2008-11-12 05:36:45 +00:00
Mike Bayer 61db44d958 remove errant pdb.set_trace() 2008-11-11 02:04:56 +00:00
Mike Bayer da0a8b913b - Adjustments to the enhanced garbage collection on
InstanceState to better guard against errors due
to lost state.
2008-11-11 01:52:42 +00:00
Jason Kirtland d403d8b865 Quashed import sets deprecation warning on 2.6.. not wild about this but it seems like it will be ok. [ticket:1209] 2008-11-10 22:56:22 +00:00
Mike Bayer eaa359f177 - Restored "active rowcount" fetch before ResultProxy
autocloses the cursor.  This was removed in 0.5rc3.
2008-11-10 16:42:35 +00:00
Mike Bayer 2c5f3e8397 - Restored NotImplementedError on Cls.relation.in_()
[ticket:1140] [ticket:1221]
2008-11-10 16:18:57 +00:00
Michael Trier 6a9b2cb683 Flagged another transaction test as causing mssql to hang. Need to look into these. 2008-11-10 01:11:46 +00:00
Michael Trier d360fd7fe3 Corrected issue with decimal e notation that broke regular decimal tests for mssql. 2008-11-10 01:11:43 +00:00
Mike Bayer 0cff22720b - Removed the 'properties' attribute of the
Connection object, Connection.info should be used.
- Method consoliation in Connection, ExecutionContext
2008-11-09 19:32:25 +00:00
Mike Bayer 043379efa5 - Query.count() has been enhanced to do the "right
thing" in a wider variety of cases. It can now
count multiple-entity queries, as well as
column-based queries. Note that this means if you
say query(A, B).count() without any joining
criterion, it's going to count the cartesian
product of A*B. Any query which is against
column-based entities will automatically issue
"SELECT count(1) FROM (SELECT...)" so that the
real rowcount is returned, meaning a query such as
query(func.count(A.name)).count() will return a value of
one, since that query would return one row.
2008-11-09 16:06:05 +00:00
Michael Trier 4cd99f5536 Global propigate -> propagate change to correct spelling. Additionally found a couple of insures that should be ensure. 2008-11-09 01:53:08 +00:00
Michael Trier a8c308f349 Corrected problems with reflection on mssql when dealing with schemas. Fixes #1217. 2008-11-09 01:27:25 +00:00
Mike Bayer e91bc867f5 - Query.count() and Query.get() return a more informative
error message when executed against multiple entities.
[ticket:1220]
2008-11-08 21:18:11 +00:00
Mike Bayer 1901519fa7 removed setup_instance() from the public API
of ClassManager, and made it a private method on
_ClassInstrumentationAdapter.  ClassManager's approach
handles the default task with fewer function calls which chops off
a few hundred calls from the pertinent profile tests.
2008-11-08 21:00:15 +00:00
Michael Trier 17980ba83c Fixed E notation problem in mssql. Closes #1216. 2008-11-08 06:37:45 +00:00
Michael Trier 8924a0e4fe Corrected a lot of mssql limit / offset issues. Also ensured that mssql uses the IN / NOT IN syntax when using a binary expression with a subquery. 2008-11-08 04:43:35 +00:00
Mike Bayer cfca625e94 docstring updates 2008-11-07 22:36:21 +00:00
Mike Bayer 9b360dda29 - Fixed bug preventing declarative-bound "column" objects
from being used in column_mapped_collection().  [ticket:1174]
2008-11-07 18:20:53 +00:00
Mike Bayer da59591a9c - zoomark adjustments
- changelog has separate category for 'features'
2008-11-07 17:45:19 +00:00
Mike Bayer 17b758faed avoid some often unnecessary method calls. i think we might have squeezed all we're going to squeeze out of compiler at this point. 2008-11-07 17:08:23 +00:00
Mike Bayer 8a04f99784 - Repaired the table.tometadata() method so that a passed-in
schema argument is propigated to ForeignKey constructs.
2008-11-07 16:19:24 +00:00
Mike Bayer c3352e5542 - Fixed bug in Query involving order_by() in conjunction with
multiple aliases of the same class (will add tests in
[ticket:1218])
- Added a new extension sqlalchemy.ext.serializer.  Provides
Serializer/Deserializer "classes" which mirror Pickle/Unpickle,
as well as dumps() and loads().  This serializer implements
an "external object" pickler which keeps key context-sensitive
objects, including engines, sessions, metadata, Tables/Columns,
and mappers, outside of the pickle stream, and can later
restore the pickle using any engine/metadata/session provider.
This is used not for pickling regular object instances, which are
pickleable without any special logic, but for pickling expression
objects and full Query objects, such that all mapper/engine/session
dependencies can be restored at unpickle time.
2008-11-06 23:07:47 +00:00
Martijn Faassen 84003a8d40 add two new hooks for bulk operations to SessionExtension:
* after_bulk_delete

* after_bulk_update
2008-11-06 06:12:11 +00:00
Mike Bayer 7576315169 - Fixed bug in composite types which prevented a primary-key
composite type from being mutated [ticket:1213].
2008-11-05 21:15:19 +00:00
Mike Bayer 9f894d2f26 - Dialects can now generate label names of adjustable length.
Pass in the argument "label_length=<value>" to create_engine()
to adjust how many characters max will be present in dynamically
generated column labels, i.e. "somecolumn AS somelabel".  Any
value less than 6 will result in a label of minimal size,
consiting of an underscore and a numeric counter.
The compiler uses the value of dialect.max_identifier_length
as a default. [ticket:1211]
- removed ANON_NAME regular expression, using string patterns now
- _generated_label() unicode subclass is used to indicate generated names
which are subject to truncation
2008-11-05 20:50:48 +00:00
Jason Kirtland 89b86f41bb Tiny fix to test setup logic. 2008-11-04 18:29:33 +00:00
Mike Bayer c38e5d043f - Simplified the check for ResultProxy "autoclose without results"
to be based solely on presence of cursor.description.
All the regexp-based guessing about statements returning rows
has been removed [ticket:1212].
2008-11-04 17:28:26 +00:00
Jason Kirtland 89a28cffa9 Added a label for pg. 2008-11-03 04:41:06 +00:00
Mike Bayer 47d2576365 - Fixed bug when using multiple query.join() with an aliased-bound
descriptor which would lose the left alias.
2008-11-03 03:37:44 +00:00
Mike Bayer a5dfbeedb9 - Improved the behavior of aliased() objects such that they more
accurately adapt the expressions generated, which helps
particularly with self-referential comparisons. [ticket:1171]

- Fixed bug involving primaryjoin/secondaryjoin conditions
constructed from class-bound attributes (as often occurs
when using declarative), which later would be inappropriately
aliased by Query, particularly with the various EXISTS
based comparators.
2008-11-03 02:52:30 +00:00
Mike Bayer 334d5118bb update call count 2008-11-03 01:47:30 +00:00
Jason Kirtland 27b48aa7e6 Added tests for Query.scalar(), .value() [ticket:1163] 2008-11-03 00:09:33 +00:00
Mike Bayer 50719c0bb0 revert r5220 inadvertently committed to trunk 2008-11-02 22:11:40 +00:00
Mike Bayer ff2f799ba3 progress so far 2008-11-02 22:08:24 +00:00
Michael Trier ea2e7fd365 Corrected some ordering issues with tests. 2008-11-02 17:42:53 +00:00
Mike Bayer ed3e3f2571 - util.flatten_iterator() func doesn't interpret strings with
__iter__() methods as iterators, such as in pypy [ticket:1077].
2008-10-31 21:44:34 +00:00
Mike Bayer bba54e320d the recent change to garbage collection of InstanceState meant that
the deferred lambda: created by lazy_clause would get a state with
no dict.  creates strong reference to the object now.
2008-10-30 14:40:10 +00:00
Jason Kirtland 554f223f6b Accept USING as a prefix or postfix modifer when reflecting keys. [ticket:1117] 2008-10-28 21:32:24 +00:00
Mike Bayer 0719e6f648 - added some abstraction to the attributes.History object
- Repaired support for "passive-deletes" on a many-to-one
relation() with "delete" cascade. [ticket:1183]
2008-10-28 20:15:26 +00:00
Michael Trier d4dcb2e217 Mysql no longer expects include_columns to be specified in lowercase. Fixes #1206. 2008-10-28 16:48:13 +00:00
Jason Kirtland c9591657dd Fixed mysql FK reflection for the edge case where a Table has expicitly provided a schema= that matches the connection's default schema. 2008-10-27 22:56:53 +00:00
Mike Bayer 76e8175971 - moved _FigureVisitName into visitiors.VisitorType, added Visitor base class to reduce dependencies
- implemented _generative decorator for select/update/insert/delete constructs
- other minutiae
2008-10-25 19:44:21 +00:00