Commit Graph

10240 Commits

Author SHA1 Message Date
Mike Bayer 31063d16f2 - tests for the alias() API
- docs docs docs
2013-06-08 18:41:59 -04:00
Mike Bayer c6615b41a6 formatting 2013-06-08 16:14:09 -04:00
Mike Bayer 044582109c changelog 2013-06-08 15:13:39 -04:00
mike bayer 659baac85e Merge pull request #3 from bslatkin/master
Makes gaerdbms for App Engine use local MySQL server when running in dev_appserver2
2013-06-08 12:11:25 -07:00
Mike Bayer 5d4bb7c213 most of these dialect=mysql.dialect() calls are redundant 2013-06-08 14:49:56 -04:00
Mike Bayer a80bb53934 - changelog for [ticket:2704]
- use an isinstance() check, concerned a TypeError might be indiscriminate
2013-06-08 14:47:04 -04:00
Mike Bayer 8bf1d3fd4e Merged in malor/sqlalchemy (pull request #1)
Fix using of 'mysql_length' for composite indexes
2013-06-08 14:39:17 -04:00
Roman Podolyaka 4cc9d482ae Fix using of 'mysql_length' for composite indexes
Currently, one can specify the prefix length for an index
column using 'mysql_length' keyword argument when creating
an Index instance. But in case of composite indexes the
prefix length value is applied only to the last column.

Extend the existing API in way so that 'mysql_length' argument
value can be either:
    - an integer specifying the same prefix length value
      for each column of an index
    - a (column_name --> integer value) mapping specifying
      the prefix length value for each column of an index
      separately

Fixes issue #2704.
2013-06-08 20:56:28 +03:00
Mike Bayer a341e1ccc9 also clarified the changelog regarding Cls.scalar != 'value' 2013-06-08 13:39:20 -04:00
Mike Bayer 20d1e9c3fa Added additional criterion to the ==, != comparators, used with
scalar values, for comparisons to None to also take into account
the association record itself being non-present, in addition to the
existing test for the scalar endpoint on the association record
being NULL.  Previously, comparing ``Cls.scalar == None`` would return
records for which ``Cls.associated`` were present and
``Cls.associated.scalar`` is None, but not rows for which
``Cls.associated`` is non-present.  More significantly, the
inverse operation ``Cls.scalar != None`` *would* return ``Cls``
rows for which ``Cls.associated`` was non-present.

Additionally, added a special use case where you
can call ``Cls.scalar.has()`` with no arguments,
when ``Cls.scalar`` is a column-based value - this returns whether or
not ``Cls.associated`` has any rows present, regardless of whether
or not ``Cls.associated.scalar`` is NULL or not.
[ticket:2751]
2013-06-08 13:23:15 -04:00
Brett Slatkin c8f9831a66 Fixing the error regex to match numbers with the long suffix, like 1146L 2013-06-08 02:04:27 -07:00
Brett Slatkin 3472083ba9 PEP8 2013-06-08 00:15:37 -07:00
Brett Slatkin 2dee20448c Makes gaerdbms for App Engine use local MySQL server when running under dev_appserver2. 2013-06-08 00:10:26 -07:00
Mike Bayer d5363fca54 - Fixed an obscure bug where the wrong results would be
fetched when joining/joinedloading across a many-to-many
relationship to a single-table-inheriting
subclass with a specific discriminator value, due to "secondary"
rows that would come back.  The "secondary" and right-side
tables are now inner joined inside of parenthesis for all
ORM joins on many-to-many relationships so that the left->right
join can accurately filtered.
[ticket:2369]
2013-06-07 23:04:33 -04:00
Mike Bayer 0d9ec9fe84 remove all remaining start/end py2k/py3k blocks 2013-06-07 17:51:12 -04:00
Mike Bayer 1188edccf6 fix test 2013-06-06 18:53:44 -04:00
Mike Bayer 862913567a Merge branch 'ticket_2587' 2013-06-06 18:07:05 -04:00
Mike Bayer 28c3325c4e dial back the default "flatness" a bit, it will be there for joinedload and query.join(), but if
you're dealing with aliased() or with_polymorphic() you need to say "flat=True".  Just the one
flag though, "flat" implies "aliased".
2013-06-06 18:06:02 -04:00
Mike Bayer 555f30d64c When querying the information schema on SQL Server 2000, removed
a CAST call that was added in 0.8.1 to help with driver issues,
which apparently is not compatible on 2000.
The CAST remains in place for SQL Server 2005 and greater.
[ticket:2747]
2013-06-06 12:52:18 -04:00
Mike Bayer 768108186a shrugs 2013-06-05 18:27:36 -04:00
Mike Bayer 80a9c53069 a test for what's breaking, plus a non-working fix for it... 2013-06-05 18:06:59 -04:00
Mike Bayer 9a736a4c6e genericize tests here 2013-06-04 23:20:02 -04:00
Mike Bayer 26ec0507be Merge branch 'ticket_2587'
Conflicts:
	test/profiles.txt
	test/sql/test_selectable.py
2013-06-04 21:38:56 -04:00
Mike Bayer 69e9574fef - add coverage for result map rewriting
- fix the result map rewriter for col mismatches, since the rewritten
select at the moment typically has more columns than the original
2013-06-04 21:36:34 -04:00
Mike Bayer ae2561a7d1 callcounts 2013-06-04 20:53:38 -04:00
Mike Bayer 92e599f42f - if the select() does not have use_labels on, then we just render
the joins as is, regardless of the dialect not supporting it.  use_labels=True
indicates a higher level of automation and also can maintain the labels
between rewritten and not.  use_labels=False indicates a manual use case.
2013-06-04 19:52:53 -04:00
Mike Bayer d8a3883948 - support for a__b_dc, i.e. two levels of nesting 2013-06-04 19:44:57 -04:00
Mike Bayer 66b8ed40c3 repair these tests now that we allow join from selectable to fromgrouping 2013-06-04 18:58:24 -04:00
Mike Bayer ff2266bfac clean up the dialect selection thing here 2013-06-04 18:49:24 -04:00
Mike Bayer c7b52003fb - add a flag to DefaultDialect for this so that people will have some
workaround
2013-06-04 18:43:59 -04:00
Mike Bayer 11578ba709 - improve overlapping selectables, apply to both query and relationship
- clean up inspect() calls within query._join()
- make sure join.alias(flat) propagates
- fix almost all assertion tests
2013-06-04 18:23:06 -04:00
Mike Bayer 58e917fe2d - eager loads
- two suite of SQL assertions converted
2013-06-04 16:48:14 -04:00
Mike Bayer 51e1019f61 here's the flat join thing. it just works. Changing the existing compiled SQL assertions
might even be most of the tests we need (though dedicated sql tests would be needed anyway)
2013-06-04 16:21:25 -04:00
Mike Bayer fa3d18a47c and this comment 2013-06-04 14:31:56 -04:00
Mike Bayer 9998e9e013 rewriting scheme now works. 2013-06-04 14:30:29 -04:00
Mike Bayer 822786dfae capture the really hard one in a test (hooray) 2013-06-04 13:11:03 -04:00
Mike Bayer 55fa83fd39 OK this is the broken version, need to think a lot more about this 2013-06-03 21:28:53 -04:00
Mike Bayer 87909841c5 - pulling out more aliases, sort of 2013-06-03 21:01:20 -04:00
Mike Bayer ada1927529 The `deferrable keyword argument on :class:.ForeignKey` and
:class:`.ForeignKeyConstraint` will not render the ``DEFERRABLE`` keyword
on the MySQL dialect.  For a long time we left this in place because
a non-deferrable foreign key would act very differently than a deferrable
one, but some environments just disable FKs on MySQL, so we'll be less
opinionated here. [ticket:2721]
2013-06-03 18:33:20 -04:00
Mike Bayer 3a13047fb0 Fixed bug where :class:.MutableDict didn't report a change event
when ``clear()`` was called.
[ticket:2730]
2013-06-03 18:23:23 -04:00
Mike Bayer f1bdc3e999 - clean up some of the requires for cross-schema reflection
- add oracle profile counts
2013-06-03 18:11:32 -04:00
Mike Bayer 8a865a4d1f Fixed bug whereby joining a select() of a table "A" with multiple
foreign key paths to a table "B", to that table "B", would fail
to produce the "ambiguous join condition" error that would be
reported if you join table "A" directly to "B"; it would instead
produce a join condition with multiple criteria.
[ticket:2738]
2013-06-03 17:03:15 -04:00
Mike Bayer ec04620f1f Fixed bug whereby using :meth:.MetaData.reflect across a remote
schema as well as a local schema could produce wrong results
in the case where both schemas had a table of the same name.
[ticket:2728]
2013-06-03 16:40:59 -04:00
Mike Bayer d993bdeac8 - remove the `__iter__()` with notimplemented since it interferes
with legitimate iterable detection, [ticket:2726]
2013-06-03 16:32:12 -04:00
Mike Bayer f8325d9dbb - add changelog/migration note
- inline the label check
2013-06-03 15:38:08 -04:00
Mike Bayer 84c42d9c64 Merge branch 'master' into ticket_1068 2013-06-03 15:18:16 -04:00
Mike Bayer 82c11cc94b - fdb is now official, [ticket:2504]
- restore the rollback cleanup handler, pg8000 is mostly obsolete
as a dialect and the firebird drivers need it
2013-06-03 13:53:42 -04:00
Mike Bayer f2328d6df4 test tweak 2013-06-03 13:45:28 -04:00
Mike Bayer 74c98bf182 Merge branch 'master' into ticket_1068 2013-06-03 13:13:16 -04:00
Mike Bayer c2a158c137 - some tweaks to try to help out mssql+pyodbc support a bit, py3k is really
not happening too well (I need to stick with linux + freetds 0.91, I know)
2013-06-03 12:54:56 -04:00