Commit Graph

10834 Commits

Author SHA1 Message Date
Mike Bayer 4e54f9fc07 - pull autocommit suite into the mysql suite as well
Change-Id: If1106f7f125739e69ad2482f65b8f37672a76c9e
2017-02-13 14:33:21 -05:00
Mike Bayer 02ae6ab3fd - add a test suite that ensures textual autocommit works
for correct expressions

Change-Id: I17d35169be914924828487abba05658dff380f2a
2017-02-13 14:17:11 -05:00
Grzegorz Makarewicz aa3b59af54 pytds based connector for MS-SQL 2017-02-12 20:10:43 +01:00
Mike Bayer 540bcff90d Check for columns not part of mapping, correct mapping for eager_defaults
Fixed two closely related bugs involving the mapper eager_defaults
flag in conjunction with single-table inheritance; one where the
eager defaults logic would inadvertently try to access a column
that's part of the mapper's "exclude_properties" list (used by
Declarative with single table inheritance) during the eager defaults
fetch, and the other where the full load of the row in order to
fetch the defaults would fail to use the correct inheriting mapper.

Fixes: #3908
Change-Id: Ie745174c917d512e2c46d9e3cc14512cde53cc9a
2017-02-09 10:49:13 -05:00
Mike Bayer 000e960306 Don't post-SELECT columns w/o a server default/onupdate for eager_defaults
Fixed a major inefficiency in the "eager_defaults" feature whereby
an unnecessary SELECT would be emitted for column values where the
ORM had explicitly inserted NULL, corresponding to attributes that
were unset on the object but did not have any server default
specified, as well as expired attributes on update that nevertheless
had no server onupdate set up.   As these columns are not part of the
RETURNING that eager_defaults tries to use, they should not be
post-SELECTed either.

Change-Id: I0d4f1e9d3d9717d68dcc0592f69456a1f1c36df8
Fixes: #3909
2017-02-08 22:00:28 -05:00
Mike Bayer 7db699163b - document Query.with_session(), direct constructor usage
Change-Id: I47499d040623202dd9b3be0ea65f2d9ad03c11a4
2017-02-08 17:47:29 -05:00
Khairi Hafsham 772374735d Make all tests to be PEP8 compliant
tested using pycodestyle version 2.2.0

Fixes: #3885
Change-Id: I5df43adc3aefe318f9eeab72a078247a548ec566
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/343
2017-02-07 11:21:56 -05:00
mike bayer d71f4b4718 Merge "Accept FetchedValue, text() for column "default" value" 2017-02-01 18:13:06 -05:00
Mike Bayer 8342ca6c69 - add a note referring to the enum value as not currently persisted,
reference #3906

Change-Id: I2274c356cc88cd011c5a34a69e75a2548a93e87a
2017-02-01 18:09:45 -05:00
Mike Bayer 388d8db68d Accept FetchedValue, text() for column "default" value
Fixed bug whereby the :meth:`.DDLEvents.column_reflect` event would not
allow a non-textual expression to be passed as the value of the
"default" for the new column, such as a :class:`.FetchedValue`
object to indicate a generic triggered default or a
:func:`.sql.expression.text` construct.  Clarified the documentation
in this regard as well.

Fixes: #3905

Change-Id: I829796c3e9f87f375149bebee7eef133a6876d4d
2017-02-01 17:00:42 -05:00
Mike Bayer 6b27d78030 - clarify Enum validation rules, fixes #3904
Change-Id: I221f161ae77ee1b9487329330bc520ab65e97611
2017-02-01 16:39:48 -05:00
Mike Bayer 9a5943bf76 Union the exclude_properties of the inheriting mapper in declarative
Fixed bug where the "automatic exclude" feature of declarative that
ensures a column local to a single table inheritance subclass does
not appear as an attribute on other derivations of the base would
not take effect for multiple levels of subclassing from the base.

Change-Id: Ibf67b631b4870dd1bd159f7d6085549d299fffe0
Fixes: #3895
2017-01-30 17:28:22 -05:00
mike bayer 5ef2fde8fb Merge "Add count(), scalar() to baked query" 2017-01-30 17:27:21 -05:00
Mike Bayer ecfda6512c Add count(), scalar() to baked query
Change-Id: I8af0d7b41ae2df384ce5d0ef274732352d81f376
Fixes: #3897
2017-01-30 13:02:29 -05:00
Jeong YunWon f411cac350 Fix nested index_property setter when there is no container value
Fixed bug in new :mod:`sqlalchemy.ext.indexable` extension
where setting of a property that itself refers to another property
would fail.

Fixes: #3901
Change-Id: I203a66117e2399afee11a34f43f0e93adfc6d571
2017-01-30 12:59:54 -05:00
Mike Bayer 1c578a710f Copy whereclause / using in ExcludeConstraint
Fixed bug in Postgresql :class:`.ExcludeConstraint` where the
"whereclause" and "using" parameters would not be copied during an
operation like :meth:`.Table.tometadata`.

Change-Id: I2f704981d4d4862f9c82a50272006fab8becebb6
Fixes: #3900
2017-01-30 12:10:16 -05:00
Mike Bayer f55d466cad - add missing param tag
Change-Id: Ic2cc0bdafbf3f1bc2993a9ad3475530eed91d0f1
2017-01-28 09:53:10 -05:00
Mike Bayer 5c26cfcb47 - cte() has moved to HasCTE(), since SelectBase is referred to
a lot just add inherited members so links to things like SelectBase.cte
continue to function

Change-Id: Ib57948d576d2063e10b0f528a5deaf07ea262322
2017-01-28 09:43:40 -05:00
Mike Bayer 3bd845f3ff - remove misleading comment, ref #3902
Change-Id: I481628146ff31bc9ea2f8a3687f375832b17e501
2017-01-27 12:08:57 -05:00
Mike Bayer 3757c0cdfb Don't check isolation level prior to SQL Server 2005
Added a version check to the "get_isolation_level" feature, which is
invoked upon first connect, so that it skips for SQL Server version
2000, as the necessary system view is not available prior to SQL Server
2005.

Change-Id: If4f860513f0aae6625803f449714aedfc5075f57
Fixes: #3898
2017-01-26 16:54:02 -05:00
Mike Bayer a24801ae8d - document that "column" and "where" are arbitrary SQL expressions
for ExcludeConstraint, if string is used then quoting must
be applied manually.  fixes #3899

Change-Id: I5885c90179e4056b84fc4776464bba7c8c70a80a
2017-01-26 16:01:20 -05:00
Mike Bayer 0d91796bb3 Merge branch 'doc_typo' of https://bitbucket.org/fredj/sqlalchemy 2017-01-24 17:36:49 -05:00
Mike Bayer 6e83259e7f Merge branch 'patch-1' of https://github.com/jeffwidman/sqlalchemy 2017-01-24 17:35:16 -05:00
Mike Bayer 0cc5561c93 Merge branch 'fix-example-re' of https://github.com/demoray/sqlalchemy 2017-01-24 17:33:01 -05:00
Frederic Junod 8795472c87 Fix typo in documentation 2017-01-20 09:52:15 +01:00
mike bayer 81518ae2e2 Merge "Dont set _set_select_from() for alias object" 2017-01-19 16:28:58 -05:00
Mike Bayer 42027de3fc Improve server-side Sequence documentation
Include the metadata argument for the Sequence
and explain the rationale.  Correct inconsistencies
between Core / ORM examples and update language
regarding client side vs. server side Sequence
directive.

Co-authored-by: Stéphane Raimbault <stephane.raimbault@gmail.com>
Change-Id: I65c522acf9bdf25041a5baf2e10be41f0927999a
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/341
2017-01-19 14:43:13 -05:00
Mike Bayer 4ae02f46e9 Dont set _set_select_from() for alias object
Fixed bug first introduced in 0.9.7 as a result of 🎫`3106`
which would cause an incorrect query in some forms of multi-level
subqueryload against aliased entities, with an unnecessary extra
FROM entity in the innermost subquery.

Fixes: #3893

Change-Id: Ic4003c2c1c0206bd22a098fd497a7375c2758305
2017-01-19 13:49:08 -05:00
Mike Bayer 17b85b3445 - 1.1.6 prep
Change-Id: I95b9af4987ad26653a36bccfc88828ff22ce896b
2017-01-19 11:49:13 -05:00
Mike Bayer 6078165993 - 1.1.5 rel_1_1_5 2017-01-17 16:23:00 -05:00
Mike Bayer 18d0509c75 - 1.0.17 release date 2017-01-17 16:22:28 -05:00
Mike Bayer 92385b6e1c Merge branch 'master' into rel_1_1 2017-01-17 16:19:54 -05:00
Mike Bayer 2f86267f07 - this test is too brittle under load, not worth it, remove it
Change-Id: I3f294b4d153979c308532360d03ab7be3c5d994a
2017-01-17 16:19:43 -05:00
Mike Bayer a75524561c Merge branch 'master' into rel_1_1 2017-01-17 15:51:18 -05:00
Mike Bayer f2028dc5af - further changes to avoid pytest warnings
Change-Id: Ia83a996ff97a6ba54a0666a32241e570f3852ab4
2017-01-17 15:51:02 -05:00
Mike Bayer 984235a12d Merge branch 'master' into rel_1_1 2017-01-17 14:42:35 -05:00
Gábor Lipták f624a3ae8b Correct pytest deprecation warning
WC1 None [pytest] section in setup.cfg files is deprecated, use [tool:pytest] instead.

Change-Id: I099c8207730ae1226f7357ff8be0d8ab149878ed
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/334
2017-01-17 12:13:34 -05:00
Mike Bayer dc66790e84 Merge branch 'master' into rel_1_1 2017-01-17 12:08:49 -05:00
Mike Bayer 3a6c55fb51 - repair an errant docstring w/o r
Change-Id: I2e9c8dbc79c00b54520748d1d7cae5230a612c96
2017-01-17 12:08:38 -05:00
Mike Bayer f7c8b08bd2 Merge branch 'master' into rel_1_1 2017-01-17 11:45:26 -05:00
Mike Bayer 5c2ef5b542 - update copyright in .c files
Change-Id: If905d1bc026b688ec7203674ff14c72bc4906abf
2017-01-17 11:45:18 -05:00
Mike Bayer a0de2bfa10 Merge branch 'master' into rel_1_1 2017-01-17 10:48:39 -05:00
mike bayer 99d65925e6 Merge "Parse (but don't record) COMMENT portion of MySQL table key" 2017-01-17 10:47:33 -05:00
Lele Long bd6ba3ac82 Parse (but don't record) COMMENT portion of MySQL table key
The MySQL dialect now will not warn when a reflected column has a
"COMMENT" keyword on it, but note however the comment is not yet
reflected; this is on the roadmap for a future release.  Pull request
courtesy Lele Long.

Fixes: #3867
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/324
Change-Id: I869e29aba6766d0eda1e59af09a3e8e3748a3942
2017-01-17 10:23:07 -05:00
Joseph Schorr 1f407c2a47 Add support for prefixes on CREATE INDEX statements in MySQL
Added a new parameter ``mysql_prefix`` supported by the :class:`.Index`
construct, allows specification of MySQL-specific prefixes such as
"FULLTEXT". Pull request courtesy Joseph Schorr.

Change-Id: I5a21fa466fdfd4d9e39e1fb4ecec1eab93b92c36
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/339
2017-01-17 10:21:47 -05:00
Mike Bayer 00b24eb0f4 Merge branch 'master' into rel_1_1 2017-01-16 16:28:01 -05:00
Mike Bayer 46828cc157 - correctly document LIKE / ILIKE, fixes #3890
Change-Id: Ie59e61f53d7c59a4777ab9e6e75a43c71d67523b
2017-01-16 16:27:48 -05:00
Mike Bayer 751887ad6e Merge branch 'master' into rel_1_1 2017-01-16 15:57:25 -05:00
mike bayer d8198c2d87 Merge "Better hide engine password" 2017-01-16 15:56:02 -05:00
Valery Yundin bccc1419a6 Better hide engine password
Avoid putting engine password in the exception message in
`MetaData.reflect` (since exception messages often appear in logs).
Use the same redacted `__repr__` implementation in
`TLEngine` as in its base class `Engine`

Change-Id: Ic0a7baea917a9c8d87dffdd82ef566673ab08e02
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/327
2017-01-16 14:02:26 -05:00