Commit Graph

421 Commits

Author SHA1 Message Date
Philip Jenvey a53d4e2ab4 o oracle+zxjdbc type handling additions
o avoid returning tests on oracle+zxjdbc for now
2009-08-09 00:56:52 +00:00
Mike Bayer a7499ddfc0 fix up oracle tests, returning is on by default 2009-08-08 16:49:28 +00:00
Philip Jenvey b365cc8396 ensure order of larger comparisons 2009-08-08 02:01:46 +00:00
Mike Bayer 8fc5005dfe merge 0.6 series to trunk. 2009-08-06 21:11:27 +00:00
Mike Bayer b303eb9342 merged [ticket:1486] fix from 0.6 2009-07-28 17:47:54 +00:00
Mike Bayer 4d036d6dd4 - Unary expressions such as DISTINCT propagate their
type handling to result sets, allowing conversions like
unicode and such to take place.  [ticket:1420]
2009-07-25 19:34:02 +00:00
Mike Bayer 8804e1963f - Fixed a bug in extract() introduced in 0.5.4 whereby
the string "field" argument was getting treated as a
ClauseElement, causing various errors within more
complex SQL transformations.
2009-07-17 15:10:54 +00:00
Mike Bayer 5503028d8c changed reference to PostgreSQL in docs. 2009-07-13 02:04:54 +00:00
Mike Bayer 45cec095b4 - unit tests have been migrated from unittest to nose.
See README.unittests for information on how to run
the tests.  [ticket:970]
2009-06-10 21:18:24 +00:00
Mike Bayer 5ea1d67315 - sql
- Removed an obscure feature of execute() (including connection,
      engine, Session) whereby a bindparam() construct can be sent as
      a key to the params dictionary.  This usage is undocumented
      and is at the core of an issue whereby the bindparam() object
      created implicitly by a text() construct may have the same
      hash value as a string placed in the params dictionary and
      may result in an inappropriate match when computing the final
      bind parameters.   Internal checks for this condition would
      add significant latency to the critical task of parameter
      rendering, so the behavior is removed.  This is a backwards
      incompatible change for any application that may have been
      using this feature, however the feature has never been
      documented.
2009-05-29 18:56:50 +00:00
Jason Kirtland aca84bebb0 extract() is now dialect-sensitive and supports SQLite and others. 2009-03-30 20:41:48 +00:00
Mike Bayer 1ad157a0a1 remove needless print stuff 2009-03-30 15:38:00 +00:00
Mike Bayer d0f67e2c4d - Lazy loader will not use get() if the "lazy load"
SQL clause matches the clause used by get(), but
contains some parameters hardcoded.  Previously
the lazy strategy would fail with the get().  Ideally
get() would be used with the hardcoded parameters
but this would require further development.
[ticket:1357]
2009-03-29 21:21:10 +00:00
Mike Bayer 0983b610b4 - An alias() of a select() will convert to a "scalar subquery"
when used in an unambiguously scalar context, i.e. it's used
in a comparison operation.  This applies to
the ORM when using query.subquery() as well.
2009-03-21 16:12:37 +00:00
Mike Bayer 03b5b34114 - anonymous alias names now truncate down to the max length
allowed by the dialect.  More significant on DBs like
Oracle with very small character limits. [ticket:1309]
2009-02-10 01:20:45 +00:00
Mike Bayer e39b98ca7b - Fixed missing _label attribute on Function object, others
when used in a select() with use_labels (such as when used
in an ORM column_property()).  [ticket:1302]
2009-02-01 18:20:20 +00:00
Mike Bayer 397ba5d73d - _CalculatedClause is gone
- Function rolls the various standalone execution functionality of CC into itself,
accesses its internal state more directly
- collate just uses _BinaryExpression, don't know why it didn't do this already
- added new _Case construct, compiles directly
- the world is a happier place
2009-01-28 01:28:20 +00:00
Mike Bayer 072039945b - Further fixes to the "percent signs and spaces in column/table
names" functionality. [ticket:1284]
- Still doesn't work for PG/MySQL, which unfortunately would require
post_process_text() calls all over the place.  Perhaps % escaping
can be assembled into IdentifierPreparer.quote() since that's where
identifier names are received.
2009-01-18 17:08:28 +00:00
Mike Bayer 454f1d7f58 - Query.from_self() as well as query.subquery() both disable
the rendering of eager joins inside the subquery produced.
The "disable all eager joins" feature is available publically
via a new query.enable_eagerloads() generative. [ticket:1276]
- Added a rudimental series of set operations to Query that
receive Query objects as arguments, including union(),
union_all(), intersect(), except_(), insertsect_all(),
except_all().  See the API documentation for
Query.union() for examples.
- Fixed bug that prevented Query.join() and eagerloads from
attaching to a query that selected from a union or aliased union.
2009-01-15 17:08:56 +00:00
Mike Bayer 76a7818013 - Improved the methodology to handling percent signs in column
names from [ticket:1256].  Added more tests.  MySQL and
Postgres dialects still do not issue correct CREATE TABLE
statements for identifiers with percent signs in them.
2009-01-14 19:55:20 +00:00
Mike Bayer 9fe69cb503 - Fixed some deep "column correspondence" issues which could
impact a Query made against a selectable containing
multiple versions of the same table, as well as
unions and similar which contained the same table columns
in different column positions at different levels.
[ticket:1268]
2009-01-03 02:42:34 +00:00
Mike Bayer 5bc1f17cb5 - mysql, postgres: "%" signs in text() constructs are automatically escaped to "%%".
Because of the backwards incompatible nature of this change,
a warning is emitted if '%%' is detected in the string.  [ticket:1267]
2009-01-02 21:24:17 +00:00
Michael Trier f62a78242d Modifications to the mssql dialect in order to to pass through unicode in the pyodbc dialect. 2008-12-30 06:39:37 +00:00
Michael Trier 8669eda82d Added in a new MSGenericBinary type.
This maps to the Binary type so it can implement the specialized behavior of
treating length specified types as fixed-width Binary types and non-length
types as an unbound variable length Binary type.
2008-12-28 21:07:57 +00:00
Mike Bayer 7009653aa1 - RowProxy objects can be used in place of dictionary arguments
sent to connection.execute() and friends.  [ticket:935]
2008-12-28 20:58:38 +00:00
Michael Trier cae83f6d4f On MSSQL if a field is part of the primary_key then it should not allow NULLS. 2008-12-28 07:40:56 +00:00
Mike Bayer 6cf4db7df3 - Columns can again contain percent signs within their
names. [ticket:1256]
2008-12-23 01:22:54 +00:00
Michael Trier 886ddcd12d Major refactoring of the MSSQL dialect. Thanks zzzeek.
Includes simplifying the IDENTITY handling and the exception handling. Also
includes a cleanup of the connection string handling for pyodbc to favor
the DSN syntax.
2008-12-22 20:20:55 +00:00
Michael Trier 0dc8bce4fe Corrected ColumnsTest for mssql's new explicit nullability behavior. 2008-12-20 22:35:06 +00:00
Mike Bayer d76dc73f33 merge the test/ directory from -r5438:5439 of py3k_warnings branch. this gives
us a 2.5-frozen copy of unittest so we're insulated from unittest changes.
2008-12-18 18:11:12 +00:00
Mike Bayer be5d326343 merged -r5299:5438 of py3k warnings branch. this fixes some sqlite py2.6 testing issues,
and also addresses a significant chunk of py3k deprecations.  It's mainly
expicit __hash__ methods.  Additionally, most usage of sets/dicts to store columns uses
util-based placeholder names.
2008-12-18 17:57:15 +00:00
Mike Bayer b333789336 - Query() can be passed a "composite" attribute
as a column expression and it will be expanded.
Somewhat related to [ticket:1253].
- Query() is a little more robust when passed
various column expressions such as strings,
clauselists, text() constructs (which may mean
it just raises an error more nicely).
- select() can accept a ClauseList as a column
in the same way as a Table or other selectable
and the interior expressions will be used as
column elements. [ticket:1253]
- removed erroneous FooTest from test/orm/query

-This line, and those below, will be ignored--

M    test/orm/query.py
M    test/orm/mapper.py
M    test/sql/select.py
M    lib/sqlalchemy/orm/query.py
M    lib/sqlalchemy/sql/expression.py
M    CHANGES
2008-12-18 16:50:49 +00:00
Mike Bayer 6a99f29313 - _execute_clauseelement() goes back to being
a private method.  Subclassing Connection
is not needed now that ConnectionProxy
is available.
- tightened the interface for the various _execute_XXX()
methods to reduce ambiguity
- __distill_params() no longer creates artificial [{}] entry,
blank dict is no longer passed through to do_execute()
in any case unless explicitly sent from the outside
as in connection.execute("somestring"), {})
- fixed a few old sql.query tests which were doing that
- removed needless do_execute() from mysql dialect
- fixed charset param not properly being sent to
_compat_fetchone() in mysql
2008-12-17 23:09:51 +00:00
Michael Trier 1d90146210 Modified fails_on testing decorator to take a reason for the failure.
This should assist with helping to document the reasons for testing failures.
Currently unspecified failures are defaulted to 'FIXME: unknown'.
2008-12-12 03:41:05 +00:00
Mike Bayer b22edf1d8a - turn __visit_name__ into an explicit member.
[ticket:1244]
2008-12-11 23:28:01 +00:00
Mike Bayer f527d3b9af - PickleType now favors == comparison by default,
if the incoming object (such as a dict) implements
__eq__().  If the object does not implement
__eq__() and mutable=True, a deprecation warning
is raised.
2008-12-11 17:27:33 +00:00
Mike Bayer 6eca02a31f - union() and union_all() will not whack
any order_by() that has been applied to the
select()s inside.  If you union() a
select() with order_by() (presumably to support
LIMIT/OFFSET), you should also call self_group()
on it to apply parenthesis.
2008-12-06 00:14:50 +00:00
Mike Bayer 0410eae36b - Two fixes to help prevent out-of-band columns from
being rendered in polymorphic_union inheritance
scenarios (which then causes extra tables to be
rendered in the FROM clause causing cartesian
products):
- improvements to "column adaption" for
  a->b->c inheritance situations to better
  locate columns that are related to one
  another via multiple levels of indirection,
  rather than rendering the non-adapted
  column.
- the "polymorphic discriminator" column is
  only rendered for the actual mapper being
  queried against. The column won't be
  "pulled in" from a subclass or superclass
  mapper since it's not needed.
2008-12-03 17:28:36 +00:00
Mike Bayer 851a14aa1a - Using the same ForeignKey object repeatedly
raises an error instead of silently failing
later. [ticket:1238]
2008-12-03 14:09:34 +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
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 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 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
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 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
Mike Bayer 3bbf8037f8 - fixed some oracle unit tests in test/sql/
- wrote a docstring for oracle dialect, needs formatting perhaps
- made FIRST_ROWS optimization optional based on optimize_limits=True, [ticket:536]
2008-10-24 15:58:17 +00:00