]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/log
thirdparty/sqlalchemy/sqlalchemy.git
8 years agoMerge "Enable JSON testing for pymysql"
mike bayer [Fri, 29 Jul 2016 22:22:49 +0000 (18:22 -0400)] 
Merge "Enable JSON testing for pymysql"

8 years ago- next release is 1.1.0
Mike Bayer [Fri, 29 Jul 2016 22:18:10 +0000 (18:18 -0400)] 
- next release is 1.1.0

Change-Id: I1d8ac48e6457e80e93b925152f434c13139b3d94

9 years agoEnable JSON testing for pymysql
Mike Bayer [Fri, 29 Jul 2016 15:05:28 +0000 (11:05 -0400)] 
Enable JSON testing for pymysql

PyMySQL upstream has released 0.7.6 which should resolve
JSON encoding issues.

Change-Id: Icf543d48dace1419a0aac78bdb15ec666f0edafe
Fixes: #3754
9 years ago- Document how SQL Server does MAX with VARCHAR, NVARCHAR
Mike Bayer [Wed, 27 Jul 2016 14:04:52 +0000 (10:04 -0400)] 
- Document how SQL Server does MAX with VARCHAR, NVARCHAR
Fixes #3760

Change-Id: I0613eb66bfdc9d7118688c74e29c8da322c3b4db

9 years ago- 1.1.0b3 rel_1_1_0b3
Mike Bayer [Tue, 26 Jul 2016 15:25:52 +0000 (11:25 -0400)] 
- 1.1.0b3

9 years agoAllow Table._reset_exported to silently pass
Mike Bayer [Sun, 24 Jul 2016 21:37:25 +0000 (17:37 -0400)] 
Allow Table._reset_exported to silently pass

Fixed bug in :class:`.Table` where the internal method
``_reset_exported()`` would corrupt the state of the object.  This
method is intended for selectable objects and is called by the ORM
in some cases; an erroneous mapper configuration would could lead the
ORM to call this on on a :class:`.Table` object.

Change-Id: I63fa34ee0cdf16358bb125c556390df79758bcbc
Fixes: #3755
9 years ago- MySQL's JSON shared implementation completely w/ sqltypes.JSON;
Mike Bayer [Mon, 25 Jul 2016 03:14:47 +0000 (23:14 -0400)] 
- MySQL's JSON shared implementation completely w/ sqltypes.JSON;
this must have been an oversight.   Leave mysql.JSON in place still
as we might need to add things to it.
- CAST(json, String) still confusing MySQL drivers even mysqlclient.
Since here we're checking for the raw form of the JSON and not a typical
round trip, add a force for unicode

Change-Id: I727f4526a01a0875037cf0dede45cd074da5205a

9 years ago- don't use pymysql at all for JSON, there's Py2K failures also
Mike Bayer [Sun, 24 Jul 2016 22:29:25 +0000 (18:29 -0400)] 
- don't use pymysql at all for JSON, there's Py2K failures also

Change-Id: I39a574ea72f5c7af0084dee3169679c5f534cb8b

9 years ago- Workaround in tests for https://github.com/PyMySQL/PyMySQL/issues/488
Mike Bayer [Sun, 24 Jul 2016 21:48:33 +0000 (17:48 -0400)] 
- Workaround in tests for https://github.com/PyMySQL/PyMySQL/issues/488

Change-Id: I4f935cce878eb1678b432f4cb4ba6ee122f8e9d4

9 years ago- a variety of test adjustments to accomodate for MySQL 5.7
Mike Bayer [Sun, 24 Jul 2016 20:36:27 +0000 (16:36 -0400)] 
- a variety of test adjustments to accomodate for MySQL 5.7

Change-Id: Ied4245433d0d7b469dae6e7394c4931d8405f387

9 years agoRemove same-named relationship warning
Mike Bayer [Tue, 19 Jul 2016 16:36:21 +0000 (12:36 -0400)] 
Remove same-named relationship warning

Removed a warning that dates back to 0.4 which emits when a same-named
relationship is placed on two mappers that inherits via joined or
single table inheritance.   The warning does not apply to the
current unit of work implementation.

Change-Id: If528ec3a2f4dc60712d9044fd1ec6c4dfbf0eadb
Fixes: #3749
9 years ago- fix formatting
Mike Bayer [Mon, 18 Jul 2016 20:43:42 +0000 (16:43 -0400)] 
- fix formatting

Change-Id: Ieba940a998a6aa287864e9748c2995ee4ae5bf54

9 years agoMerge "Add `default` parameter for `index_property`"
mike bayer [Wed, 13 Jul 2016 18:10:00 +0000 (14:10 -0400)] 
Merge "Add `default` parameter for `index_property`"

9 years agoEnsure DML provides named_with_column for CTE(Alias)
Mike Bayer [Tue, 12 Jul 2016 20:53:37 +0000 (16:53 -0400)] 
Ensure DML provides named_with_column for CTE(Alias)

Fixed bug in new CTE feature for update/insert/delete whereby
an anoymous (e.g. no name passed) :class:`.CTE` construct around
the statement would fail.  The Alias base class of CTE checks
for the "named_with_column" attribute in order to detect if
the underlying selectable has a name; UpdateBase now provides
this as False.

Change-Id: I4b0309db21379a4c0cb93085298c86da3cf840e4
Fixes: #3744
9 years agoMerge "Work w/ prefetch even for selects, if present"
mike bayer [Wed, 13 Jul 2016 15:48:41 +0000 (11:48 -0400)] 
Merge "Work w/ prefetch even for selects, if present"

9 years agoWork w/ prefetch even for selects, if present
Mike Bayer [Tue, 12 Jul 2016 20:38:22 +0000 (16:38 -0400)] 
Work w/ prefetch even for selects, if present

Fixed bug in new CTE feature for update/insert/delete stated
as a CTE inside of an enclosing statement (typically SELECT) whereby
oninsert and onupdate values weren't called upon for the embedded
statement.

This is accomplished by consulting prefetch
for all statements.  The collection is also broken into
separate insert/update collections so that we don't need to
consult toplevel self.isinsert to determine if the prefetch
is for an insert or an update.  What we don't yet test for
are CTE combinations that have both insert/update in one
statement, though these should now work in theory provided
the underlying database supports such a statement.

Change-Id: I3b6a860e22c86743c91c56a7ec751ff706f66f64
Fixes: #3745
9 years agoFix issue with unbaking subqueries
Mark Hahnenberg [Tue, 12 Jul 2016 18:07:52 +0000 (14:07 -0400)] 
Fix issue with unbaking subqueries

Fix improper capture of a loop variable inside a lambda during unbaking
of subquery eager loaders, which would cause the incorrect query
to be invoked.

Fixes: #3743
Change-Id: I995110deb8ee2dae8540486729e1ae64578d28fc
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/290

9 years ago- 1.0.15 for dev
Mike Bayer [Tue, 12 Jul 2016 18:04:40 +0000 (14:04 -0400)] 
- 1.0.15 for dev

Change-Id: I2d75b6d9ca533e662bc8160cf5fc52355e5e549e

9 years agoUpdate index.rst
Shige Takeda [Mon, 11 Jul 2016 22:58:43 +0000 (15:58 -0700)] 
Update index.rst

9 years agoUpdate index.rst
Shige Takeda [Mon, 11 Jul 2016 22:56:12 +0000 (15:56 -0700)] 
Update index.rst

9 years agoAdd `default` parameter for `index_property`
Jeong YunWon [Sun, 3 Jul 2016 13:23:45 +0000 (22:23 +0900)] 
Add `default` parameter for `index_property`

And force to use keyword arguments for trivial parameters in index_property

Change-Id: I12a178128182f77a2d06b52d7e36f59a36b45a33

9 years ago- fix typo
Mike Bayer [Thu, 7 Jul 2016 20:07:08 +0000 (16:07 -0400)] 
- fix typo

Change-Id: Ie66d419a5188529a64fcb2e2463c15c26863889f

9 years agoAdd additional documentation re: JSONEncodedDict
Mike Bayer [Thu, 7 Jul 2016 20:00:18 +0000 (16:00 -0400)] 
Add additional documentation re: JSONEncodedDict

Add an example of how to use coerce_compared_value()
specific to JSONEncodedDict, as this example class
is frequently dropped into applications.

Change-Id: I61639ac03dc5a37673ee8201b99a3c36ab944f00
Fixes: #3742
9 years ago- 1.0.14 changelog update
Mike Bayer [Wed, 6 Jul 2016 21:10:19 +0000 (17:10 -0400)] 
- 1.0.14 changelog update

(cherry picked from commit e9a1d7bc6a0ae4ec09b6431d23d201654013c6a7)

Change-Id: I5bab3fd6f2ec4986fd6b1049844f3851958d0c66

9 years agoMerge "Adapt "FOR UPDATE OF" with Oracle limit/offset"
mike bayer [Wed, 6 Jul 2016 14:13:56 +0000 (10:13 -0400)] 
Merge "Adapt "FOR UPDATE OF" with Oracle limit/offset"

9 years agoAdapt "FOR UPDATE OF" with Oracle limit/offset
Mike Bayer [Tue, 5 Jul 2016 16:48:41 +0000 (12:48 -0400)] 
Adapt "FOR UPDATE OF" with Oracle limit/offset

This modifies the Oracle ROWNUM limit/offset approach
to accommodate for the "OF" clause in a "FOR UPDATE"
phrase.  The column expressions must be added to the selected
subquery if necessary and adapted on the outside.

Change-Id: Ia71b5fc4df6d326e73863f8ae9f96e8f1a5acfc1
Fixes: #3741
9 years ago`index_property` catches IndexError as well as KeyError
Jeong YunWon [Sun, 3 Jul 2016 12:45:15 +0000 (21:45 +0900)] 
`index_property` catches IndexError as well as KeyError

It was raising AttributeError for key accessing in dict,
but raising IndexError for index accessing in array.

Change-Id: I58a2252a9e8d7f78cabcefcbe7223a4f3a729115

9 years ago- version bump
Mike Bayer [Tue, 5 Jul 2016 17:05:07 +0000 (13:05 -0400)] 
- version bump

Change-Id: I5ace1a90f36678c006d704b452fbbe8a3eb1cd0a

9 years agoRepair PG BIGSERIAL w/ TypeDecorator, Variant
Mike Bayer [Mon, 4 Jul 2016 20:37:26 +0000 (16:37 -0400)] 
Repair PG BIGSERIAL w/ TypeDecorator, Variant

Some of the dialect impl memoization for TypeDecorator
necessarily keeps the top-level TypeDecorator type
around, since a user-defined type will have bind and result
set processing behavior.  For both TypeDecorator and Variant,
PG dialect needs to ensure it's looking at the SQLAlchemy
type to check for SmallInteger / BigInteger.

Fixes: 3739
Change-Id: I2d45fb997f17c6272d6bb826a77d2dba665adae7
(cherry picked from commit 421fa6b8bf9f0c3c5041579c89ec405ce0f5e0b0)

9 years agoMerge remote-tracking branch 'origin/pr/288'
Mike Bayer [Mon, 4 Jul 2016 19:37:58 +0000 (15:37 -0400)] 
Merge remote-tracking branch 'origin/pr/288'

9 years agofixed typo
Kristian Perkins [Sun, 3 Jul 2016 03:59:47 +0000 (13:59 +1000)] 
fixed typo

9 years agoFix some typos in 1.1's changelog and migration sections
Lele Gaifax [Sat, 2 Jul 2016 11:07:48 +0000 (13:07 +0200)] 
Fix some typos in 1.1's changelog and migration sections

9 years agoConsistently use the official PostgreSQL casing
Lele Gaifax [Sat, 2 Jul 2016 11:05:27 +0000 (13:05 +0200)] 
Consistently use the official PostgreSQL casing

9 years ago- add backports
Mike Bayer [Fri, 1 Jul 2016 18:57:49 +0000 (14:57 -0400)] 
- add backports

Change-Id: Iee0bf9e60a5991bedbe29b305803b4c79ac5c511
(cherry picked from commit 849df799ec4107d0992c8eb0e015b74916aee266)

9 years agoPreserve type for math negation
Mike Bayer [Fri, 1 Jul 2016 16:44:47 +0000 (12:44 -0400)] 
Preserve type for math negation

Fixed issue in SQL math negation operator where the type of the
expression would no longer be the numeric type of the original.
This would cause issues where the type determined result set
behaviors.

Change-Id: If0e339614a3686e251235fc94b6f59310c4630a5
Fixes: #3735
9 years ago- 1.1.0b2 rel_1_1_0b2
Mike Bayer [Fri, 1 Jul 2016 14:47:20 +0000 (10:47 -0400)] 
- 1.1.0b2

9 years ago- revert the RTD reqs workaround, we are self-hosting now
Mike Bayer [Fri, 1 Jul 2016 14:39:05 +0000 (10:39 -0400)] 
- revert the RTD reqs workaround, we are self-hosting now

Change-Id: Ie11361147d497c6eb6418cdc850ed277dfbd1de4

9 years agoMerge "Repair pickling for Properties object"
mike bayer [Wed, 29 Jun 2016 21:41:03 +0000 (17:41 -0400)] 
Merge "Repair pickling for Properties object"

9 years agoRepair pickling for Properties object
Pieter Mulder [Wed, 29 Jun 2016 15:15:44 +0000 (11:15 -0400)] 
Repair pickling for Properties object

Fixed bug whereby the ``__getstate__`` / ``__setstate__``
methods for sqlalchemy.util.Properties were
non-working due to the transition in the 1.0 series to ``__slots__``.
The issue potentially impacted some third-party applications.
Pull request courtesy Pieter Mulder.

Fixes: #3728
Change-Id: I01ebd425bbfe145747fea2edd0d2d412c74fd84d
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/286
(cherry picked from commit cab57e9bab04fbdea44690c08dff379a29eaab32)

9 years agoEnsure @compiles calls down to the original compilation scheme
Mike Bayer [Wed, 29 Jun 2016 15:11:17 +0000 (11:11 -0400)] 
Ensure @compiles calls down to the original compilation scheme

Made a slight behavioral change in the ``sqlalchemy.ext.compiler``
extension, whereby the existing compilation schemes for an established
construct would be removed if that construct was itself didn't already
have its own dedicated ``__visit_name__``.  This was a
rare occurrence in 1.0, however in 1.1 :class:`.postgresql.ARRAY`
subclasses :class:`.sqltypes.ARRAY` and has this behavior.
As a result, setting up a compilation handler for another dialect
such as SQLite would render the main :class:`.postgresql.ARRAY`
object no longer compilable.

Fixes: #3732
Change-Id: If2c1ada4eeb09157885888e41f529173902f2b49

9 years agoMake boolean processors consistent between Py/C; coerce to 1/0
Mike Bayer [Thu, 23 Jun 2016 23:26:28 +0000 (19:26 -0400)] 
Make boolean processors consistent between Py/C; coerce to 1/0

The processing performed by the :class:`.Boolean` datatype for backends
that only feature integer types has been made consistent between the
pure Python and C-extension versions, in that the C-extension version
will accept any integer value from the database as a boolean, not just
zero and one; additionally, non-boolean integer values being sent to
the database are coerced to exactly zero or one, instead of being
passed as the original integer value.

Change-Id: I01e647547fd7047bd549dd70e1fa202c51e8328b
Fixes: #3730
9 years agoDon't reorder PrimaryKeyConstraint columns if explicit
Mike Bayer [Mon, 20 Jun 2016 15:39:01 +0000 (11:39 -0400)] 
Don't reorder PrimaryKeyConstraint columns if explicit

Dialed back the "order the primary key columns per auto-increment"
described in :ref:`change_mysql_3216` a bit, so that if the
:class:`.PrimaryKeyConstraint` is explicitly defined, the order
of columns is maintained exactly, allowing control of this behavior
when necessary.

Change-Id: I9e7902c57a96c15968a6abf53e319acf15680da0
Fixes: #3726
9 years agoDisable Enum string validation by default
Mike Bayer [Mon, 20 Jun 2016 14:08:36 +0000 (10:08 -0400)] 
Disable Enum string validation by default

Rolled back the validation rules a bit in :class:`.Enum` to allow
unknown string values to pass through, unless the flag
``validate_string=True`` is passed to the Enum; any other kind of object is
still of course rejected.  While the immediate use
is to allow comparisons to enums with LIKE, the fact that this
use exists indicates there may be more unknown-string-comparsion use
cases than we expected, which hints that perhaps there are some
unknown string-INSERT cases too.

Change-Id: I7d1d79b374a7d47966d410998f77cd19294ab7b0
Fixes: #3725
9 years ago- create space for 1.1.0b2
Mike Bayer [Mon, 20 Jun 2016 15:42:53 +0000 (11:42 -0400)] 
- create space for 1.1.0b2

Change-Id: I8815a68dcf6e5d27f3f82b02f939f72d9a412337

9 years ago- update alembic link
Mike Bayer [Sat, 18 Jun 2016 13:35:54 +0000 (09:35 -0400)] 
- update alembic link

Change-Id: I5ac6ba8234873fdd19bee6c1decd311a9cb4d55e

9 years ago- missing indexable.rst
Mike Bayer [Sat, 18 Jun 2016 13:31:11 +0000 (09:31 -0400)] 
- missing indexable.rst

Change-Id: Ida3ca92b496a1e3ebd761c100201d3660460c2bf

9 years ago1.1.0b1
Mike Bayer [Thu, 16 Jun 2016 19:02:10 +0000 (15:02 -0400)] 
1.1.0b1

9 years ago- dont need this
Mike Bayer [Thu, 16 Jun 2016 19:56:56 +0000 (15:56 -0400)] 
- dont need this

9 years agoMerge "Add DDLCompiler.create_table_suffix()"
mike bayer [Thu, 16 Jun 2016 19:00:49 +0000 (15:00 -0400)] 
Merge "Add DDLCompiler.create_table_suffix()"

9 years agoMerge "update pytest good practices link in PyTest class"
mike bayer [Thu, 16 Jun 2016 15:53:18 +0000 (11:53 -0400)] 
Merge "update pytest good practices link in PyTest class"

9 years agoupdate pytest good practices link in PyTest class
Mark Sandan [Fri, 22 Apr 2016 22:42:19 +0000 (18:42 -0400)] 
update pytest good practices link in PyTest class

Change-Id: Ie96edd05e962663e9ddeeda85b24858caabd3bfd
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/262

9 years agoAdd DDLCompiler.create_table_suffix()
Mark Sandan [Tue, 24 May 2016 00:08:36 +0000 (17:08 -0700)] 
Add DDLCompiler.create_table_suffix()

Allows custom dialects to add keywords after the
CREATE TABLE section.

Change-Id: I6fa66dfcf00ef95122f491a9115410df2746cf88

9 years ago- dont use id() to test identity as these can be recycled
Mike Bayer [Wed, 15 Jun 2016 22:15:46 +0000 (18:15 -0400)] 
- dont use id() to test identity as these can be recycled

Change-Id: Ie4cb4924909d55c5962f66e36cd5325e8e8f0538

9 years ago- flake8
Mike Bayer [Wed, 15 Jun 2016 22:10:46 +0000 (18:10 -0400)] 
- flake8

Change-Id: I74e369d1d71c98cb0af58dde80b7d535d17cbdf7

9 years agoMerge "Add TABLESAMPLE clause support."
mike bayer [Wed, 15 Jun 2016 19:17:10 +0000 (15:17 -0400)] 
Merge "Add TABLESAMPLE clause support."

9 years agoMerge "Interpret lateral, alias as from clauses"
mike bayer [Wed, 15 Jun 2016 19:16:57 +0000 (15:16 -0400)] 
Merge "Interpret lateral, alias as from clauses"

9 years agoAdd TABLESAMPLE clause support.
saarni [Thu, 26 May 2016 14:15:24 +0000 (10:15 -0400)] 
Add TABLESAMPLE clause support.

The TABLESAMPLE clause allows randomly selecting an approximate percentage
of rows from a table. At least DB2, Microsoft SQL Server and recent
Postgresql support this standard clause.

Fixes: #3718
Change-Id: I3fb8b9223e12a57100df30876b461884c58d72fa
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/277

9 years agoInterpret lateral, alias as from clauses
Mike Bayer [Wed, 15 Jun 2016 18:36:24 +0000 (14:36 -0400)] 
Interpret lateral, alias as from clauses

Also add doc members for Lateral.

Change-Id: Ic801c296377ce84230139c6a43ecb3e93a852832

9 years agoAdd `sqlalchemy.ext.index` for indexed attributes for ORM
Jeong YunWon [Tue, 12 Apr 2016 03:16:04 +0000 (23:16 -0400)] 
Add `sqlalchemy.ext.index` for indexed attributes for ORM

Add `sqlalchemy.ext.index.index_property`
which subscribe an index of a column with `Indexable` type.

Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com>
Change-Id: I238c23131e4fded5dc7f7a25eb02e26008099d00
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/235

9 years agoMerge "Add ON CONFLICT support for Postgresql"
mike bayer [Tue, 14 Jun 2016 19:23:17 +0000 (15:23 -0400)] 
Merge "Add ON CONFLICT support for Postgresql"

9 years agoAdd ON CONFLICT support for Postgresql
Robin Thomas [Thu, 14 Apr 2016 16:57:15 +0000 (12:57 -0400)] 
Add ON CONFLICT support for Postgresql

Fixes: #3529
Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com>
Change-Id: Ie3bf6ad70d9be9f0e44938830e922db03573991a
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/258

9 years agoDeprecate FromClause.count()
Mike Bayer [Mon, 13 Jun 2016 19:18:13 +0000 (15:18 -0400)] 
Deprecate FromClause.count()

count() here is misleading in that it not only
counts from an arbitrary column in the table, it also
does not make accommodations for DISTINCT, JOIN, etc.
as the ORM-level function does.  Core should not be
attempting to provide a function like this.

Change-Id: I9916fc51ef744389a92c54660ab08e9695b8afc2
Fixes: #3724
9 years agoEnsure CTE internals are handled during clone
Mike Bayer [Fri, 10 Jun 2016 21:24:36 +0000 (17:24 -0400)] 
Ensure CTE internals are handled during clone

The CTE construct was missing a _copy_internals() method
which would handle CTE-specific structures including _cte_alias,
_restates during a clone operation.

Change-Id: I9aeac9cd24d8f7ae6b70e52650d61f7c96cb6d7e
Fixes: #3722
9 years agoSupport `postgresql_concurrently` on index dropping.
Iuri de Silvio [Wed, 27 Apr 2016 15:27:00 +0000 (10:27 -0500)] 
Support `postgresql_concurrently` on index dropping.

Also adds version detection so that DROP INDEX CONCURRENTLY
only renders if the Postgresql version is 9.2 or higher;
for CREATE INDEX CONCURRENTLY, version detection is added
to allow the phrase to omit if the Postgresql version is
less than 8.2.

Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com>
Change-Id: I597287e0ebbbe256c957a3579b58ace6848ab4f4
Pull-request: https://bitbucket.org/zzzeek/sqlalchemy/pull-requests/84

9 years agoMerge "Support normal /materialized views in PG separately"
mike bayer [Wed, 8 Jun 2016 17:21:12 +0000 (13:21 -0400)] 
Merge "Support normal /materialized views in PG separately"

9 years agoUse the "committed" values when extracting many-to-one lazyload value
Mike Bayer [Sun, 8 May 2016 06:21:57 +0000 (02:21 -0400)] 
Use the "committed" values when extracting many-to-one lazyload value

The scalar object set() method calls upon the lazy loader
to get at the "old" value of the attriute, however doesn't
ensure that the "committed" value of the foreign key attributes
is used.  If the user has manipulated these attributes and they
themselves have pending, non committed changes, we get the
"new" value which these attributes would have set up if they
were flushed.  "old" vs "new" value is always about how the
value has changed since the load, so we always have to use the
DB-persisted values for everything when looking for "old".

Change-Id: I82bdc40ad0cf033c3a98f3361776cf3161542cd6
Fixes: #3708
9 years agoMerge "Add 'FOR NO KEY UPDATE' / 'FOR KEY SHARE' support for Postgresql"
mike bayer [Wed, 8 Jun 2016 15:52:22 +0000 (11:52 -0400)] 
Merge "Add 'FOR NO KEY UPDATE' / 'FOR KEY SHARE' support for Postgresql"

9 years agoAdd 'FOR NO KEY UPDATE' / 'FOR KEY SHARE' support for Postgresql
Sergey Skopin [Tue, 31 May 2016 14:02:08 +0000 (10:02 -0400)] 
Add 'FOR NO KEY UPDATE' / 'FOR KEY SHARE' support for Postgresql

Adds ``key_share=True`` for with_for_update().

Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com>
Change-Id: I74e0c3fcbc023e1dc98a1fa0c7db67b4c3693a31
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/279

9 years agoSupport range specification in window function
Phillip Cloud [Mon, 2 May 2016 02:26:10 +0000 (22:26 -0400)] 
Support range specification in window function

Fixes: #3049
Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com>
Change-Id: Ie572095c3e25f70a1e72e1af6858e5edd89fd25e
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/264

9 years agoSupport normal /materialized views in PG separately
Sebastian Bank [Tue, 12 Apr 2016 03:16:39 +0000 (23:16 -0400)] 
Support normal /materialized views in PG separately

Fixes: #3588
Change-Id: Ifbfcab67375f289ddb5c4522f4b803cb8b7c34de
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/250

9 years agoMerge "Add "render_nulls" flag to bulk_insert as optional performance optimization"
mike bayer [Mon, 6 Jun 2016 22:56:20 +0000 (18:56 -0400)] 
Merge "Add "render_nulls" flag to bulk_insert as optional performance optimization"

9 years agoMerge "Refine PG inspection methods"
mike bayer [Mon, 6 Jun 2016 21:29:33 +0000 (17:29 -0400)] 
Merge "Refine PG inspection methods"

9 years agoAdd "render_nulls" flag to bulk_insert as optional performance optimization
tsauerwein [Tue, 12 Apr 2016 03:16:17 +0000 (23:16 -0400)] 
Add "render_nulls" flag to bulk_insert as optional performance optimization

Currently, ``Session.bulk_insert_mappings`` omits NULL values which
causes it to break up batches of inserts based on which batches
contain NULL and which do not.

By adding this flag, the same columns are rendered in the INSERT
for all rows allowing them to be batched.  The downside is that
server-side defaults are omitted.

Doctext-author: Mike Bayer <mike_mp@zzzcomputing.com>
Change-Id: Iec5969304d4bdbf57290b200331bde02254aa3a5
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/243

9 years agoMerge "Add IS (NOT) DISTINCT FROM operators"
mike bayer [Mon, 6 Jun 2016 19:57:06 +0000 (15:57 -0400)] 
Merge "Add IS (NOT) DISTINCT FROM operators"

9 years agoMerge "Replace some uses of re.sub with str.lstrip/replace"
mike bayer [Mon, 6 Jun 2016 19:54:53 +0000 (15:54 -0400)] 
Merge "Replace some uses of re.sub with str.lstrip/replace"

9 years agoAdd IS (NOT) DISTINCT FROM operators
Sebastian Bank [Tue, 12 Apr 2016 03:16:32 +0000 (23:16 -0400)] 
Add IS (NOT) DISTINCT FROM operators

None / True / False render as literals.
For SQLite, "IS" is used as SQLite lacks
"IS DISTINCT FROM" but its "IS" operator acts
this way for NULL.

Doctext-author: Mike Bayer <mike_mp@zzzcomputing.com>
Change-Id: I9227b81f7207b42627a0349d14d40b46aa756cce
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/248

9 years agoRefine PG inspection methods
Sebastian Bank [Tue, 12 Apr 2016 03:16:39 +0000 (23:16 -0400)] 
Refine PG inspection methods

This refines get_schema_names(), get_table_names(),
get_view_defintion(), _get_foreign_table_names(),
and get_view_names() to use better queries and
remove unnecessary explicit encoding logic.

Pull-request: https://github.com/zzzeek/sqlalchemy/pull/250
Change-Id: I7e87b29c34b97b37f21bbc83392b2274af4db0ab

9 years agoAllow creating explicit non-clustered keys and indexes MS SQL.
Saulius Žemaitaitis [Tue, 12 Apr 2016 03:16:45 +0000 (23:16 -0400)] 
Allow creating explicit non-clustered keys and indexes MS SQL.

mssql_clustered=False on Index, UniqueConstraint,
PrimaryKeyConstraint now renders NONCLUSTERED.
The default of mssql_clustered is now None.

Co-Authored-By: mike bayer <mike_mp@zzzcomputing.com>
Change-Id: Id6b8d840e355be8f8fa72360cb4b6d2617ba72cf
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/252

9 years agoReplace some uses of re.sub with str.lstrip/replace
Ville Skyttä [Mon, 6 Jun 2016 16:37:31 +0000 (12:37 -0400)] 
Replace some uses of re.sub with str.lstrip/replace

Change-Id: I98cd60b6830ee94e39ba9307523a9e8fb93bf4e8
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/280

9 years ago- further adjustment to accomodate for the "ON" in "NO ACTION"
Mike Bayer [Sat, 4 Jun 2016 00:54:48 +0000 (20:54 -0400)] 
- further adjustment to accomodate for the "ON" in "NO ACTION"

Change-Id: I734e4aec3701d7cf17813b561a1418cfeff1d473

9 years ago- missing test_needs_fk for this test, fixes mysql failure
Mike Bayer [Fri, 3 Jun 2016 20:44:12 +0000 (16:44 -0400)] 
- missing test_needs_fk for this test, fixes mysql failure

Change-Id: I2dc6961f9b692a8bb6bfb2296d159df145dec679

9 years agoEnsure "options" present for unnamed / unlocatable FK
Mike Bayer [Fri, 3 Jun 2016 19:57:16 +0000 (15:57 -0400)] 
Ensure "options" present for unnamed / unlocatable FK

Also ensure the regular expression and subsequent matching
is case insensitive, add more tests

Change-Id: Ie4aa971dcbffca94e78965e22982478eccbf8597

9 years agoEnsure 'options' is always present in foreign key info
Mike Bayer [Fri, 3 Jun 2016 19:07:14 +0000 (15:07 -0400)] 
Ensure 'options' is always present in foreign key info

Regarding 0e88bcc30ed49193b91f248123f526fa30007f22, "options"
needs to be present as a key in the dictionary because Alembic
uses this as a guide to know if the backend is even capable of
reporting on foreign key options.

Change-Id: I271090f75088cfeec24315a878060f9b8a265335

9 years agoMerge "Add SKIP LOCKED support for Postgresql, Oracle"
mike bayer [Fri, 3 Jun 2016 14:56:06 +0000 (10:56 -0400)] 
Merge "Add SKIP LOCKED support for Postgresql, Oracle"

9 years agoMerge "Reflect ON DELETE and ON UPDATE for SQLite foreign keys"
mike bayer [Fri, 3 Jun 2016 14:55:54 +0000 (10:55 -0400)] 
Merge "Reflect ON DELETE and ON UPDATE for SQLite foreign keys"

9 years ago- use a mock here, do away with timing problems for good. need to do this
Mike Bayer [Thu, 2 Jun 2016 22:40:46 +0000 (18:40 -0400)] 
- use a mock here, do away with timing problems for good.  need to do this
for the rest of the timing tests

Change-Id: I06a815b1500222126a4dbc2a9a5da3ef7847e321

9 years agoReflect ON DELETE and ON UPDATE for SQLite foreign keys
Michal Petrucha [Tue, 12 Apr 2016 03:16:24 +0000 (23:16 -0400)] 
Reflect ON DELETE and ON UPDATE for SQLite foreign keys

Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com>
Change-Id: Icd77ddbf851b1950f767022d67c8142b1b3c50f3
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/244

9 years agoMerge "Add schema argument to AutomapBase.prepare()"
mike bayer [Thu, 2 Jun 2016 21:48:13 +0000 (17:48 -0400)] 
Merge "Add schema argument to AutomapBase.prepare()"

9 years agoMerge "Add an init_scalar event for attributes"
mike bayer [Thu, 2 Jun 2016 21:47:37 +0000 (17:47 -0400)] 
Merge "Add an init_scalar event for attributes"

9 years agoAdd SKIP LOCKED support for Postgresql, Oracle
Jack Zhou [Tue, 31 May 2016 14:01:46 +0000 (10:01 -0400)] 
Add SKIP LOCKED support for Postgresql, Oracle

This adds `SELECT ... FOR UPDATE SKIP LOCKED`/
`SELECT ... FOR SHARE SKIP LOCKED` rendering.

Change-Id: Id1dc4f1cafc1de23f397a6f73d54ab2c58d5910d
Pull-request: https://bitbucket.org/zzzeek/sqlalchemy/pull-requests/86

9 years ago- limit oracle DB reaps to identifiers generated from this
Mike Bayer [Thu, 2 Jun 2016 21:42:51 +0000 (17:42 -0400)] 
- limit oracle DB reaps to identifiers generated from this
run to prevent race conditions against concurrent runs

Change-Id: I065d1cec346ea7af03792c3cc2f30766f73c2bd3

9 years agoMerge "Skip UniqueConstraint marked by unique=True in tometadata"
mike bayer [Thu, 2 Jun 2016 18:42:38 +0000 (14:42 -0400)] 
Merge "Skip UniqueConstraint marked by unique=True in tometadata"

9 years agoAdd an init_scalar event for attributes
Mike Bayer [Thu, 11 Jun 2015 03:38:15 +0000 (23:38 -0400)] 
Add an init_scalar event for attributes

This allows us to build default-setting recipes such
as one that allows us to actively read column-level
defaults.  An example suite is also added.

Change-Id: I7b022d52cc89526132d5bc4201ac27fea4cf088d
Fixes: #1311
9 years agoAdd schema argument to AutomapBase.prepare()
Josh Marlow [Tue, 12 Apr 2016 03:16:12 +0000 (23:16 -0400)] 
Add schema argument to AutomapBase.prepare()

This allows automap to reflect tables from a schema other than the
default without the need to resort to calling MetaData.reflect
directly.

Change-Id: Ie73cb113bd6d115555c09c5efc33d27ad2c9c512
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/237

9 years agoMerge "Add postgresql_tablespace option on Index"
mike bayer [Thu, 2 Jun 2016 17:57:24 +0000 (13:57 -0400)] 
Merge "Add postgresql_tablespace option on Index"

9 years agoSkip UniqueConstraint marked by unique=True in tometadata
Mike Bayer [Thu, 2 Jun 2016 17:52:27 +0000 (13:52 -0400)] 
Skip UniqueConstraint marked by unique=True in tometadata

Fixes an issue where a Column would be copied with unique=True
and at the same time the UniqueConstraint would also be copied,
leading to duplicate UniqueConstraints in the target table,
when tometadata() is used.   Imitates the same logic used
by index=True/Index to avoid duplicates.  For some reason
a fix was implemented for Index long ago but never for
UniqueConstraint.

Change-Id: Ie622ee912a6fb8bf0ea900a8b09d78c7ebc79fc0
Fixes: #3721
9 years ago- don't raise for stray gc connection. this just happens
Mike Bayer [Thu, 2 Jun 2016 16:46:45 +0000 (12:46 -0400)] 
- don't raise for stray gc connection.   this just happens
sometimes and it really breaks the build once this
error occurs.

Change-Id: I577c78d623b22a6429f8b083fe08821bc467eb7a

9 years agoAdd postgresql_tablespace option on Index
beenje [Tue, 12 Apr 2016 03:15:35 +0000 (23:15 -0400)] 
Add postgresql_tablespace option on Index

This complements the same-named parameter
available on Table.

Fixes: #3720
Change-Id: I56e081e2a551f37c3f392ca4b301c9ef82b94e59
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/233

9 years agoImplemented CHECK constraint reflection for SQLite and PostgreSQL
Alex Grönholm [Mon, 11 Apr 2016 21:01:42 +0000 (17:01 -0400)] 
Implemented CHECK constraint reflection for SQLite and PostgreSQL

Co-Authored-By: Mike Bayer <mike_mp@zzzcomputing.com>
Change-Id: Ie6cf2d2958d1c567324db9e08fef2d3186e97350
Pull-request: https://bitbucket.org/zzzeek/sqlalchemy/pull-requests/80

9 years agoUse new mxODBC 3.3.4 varbinary null symbol
Sheila Allen [Mon, 11 Apr 2016 19:29:03 +0000 (15:29 -0400)] 
Use new mxODBC 3.3.4 varbinary null symbol

Use new mxODBC 3.3.4 varbinary null symbol with VARBINARY
data types when value is None(based on similar change to pyodbc).
Fix a test to pass on mxODBC starting w 3.3.3 version

Change-Id: Id703ecb51ebc5db149c81fef124f673433606c7f
Pull-request: https://bitbucket.org/zzzeek/sqlalchemy/pull-requests/58