summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
Commit message (Collapse)AuthorAgeFilesLines
* Raise error on empty in_pr/283erebus12016-06-051-0/+1
| | | | | | | | | I think it would be good idea to add error on empy in_ usage in version 1.1.* Because current implementation is not fully correct: Firstly, it's not optimised, because of sequential scan Secondly, in current implementation null in () will return null, when in sql it should return False, try this: select null in (select 1 from some_table where false); -> false but not null I understant that this can break some legacy code, but current implementation is obscure and quite expensive
* - further adjustment to accomodate for the "ON" in "NO ACTION"Mike Bayer2016-06-031-1/+2
| | | | Change-Id: I734e4aec3701d7cf17813b561a1418cfeff1d473
* - missing test_needs_fk for this test, fixes mysql failureMike Bayer2016-06-031-0/+1
| | | | Change-Id: I2dc6961f9b692a8bb6bfb2296d159df145dec679
* Ensure "options" present for unnamed / unlocatable FKMike Bayer2016-06-031-2/+2
| | | | | | | Also ensure the regular expression and subsequent matching is case insensitive, add more tests Change-Id: Ie4aa971dcbffca94e78965e22982478eccbf8597
* Ensure 'options' is always present in foreign key infoMike Bayer2016-06-033-2/+56
| | | | | | | | | 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
* Merge "Add SKIP LOCKED support for Postgresql, Oracle"mike bayer2016-06-034-5/+22
|\
| * Add SKIP LOCKED support for Postgresql, OracleJack Zhou2016-06-024-5/+22
| | | | | | | | | | | | | | | | 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
* | Reflect ON DELETE and ON UPDATE for SQLite foreign keysMichal Petrucha2016-06-021-4/+15
| | | | | | | | | | | | Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com> Change-Id: Icd77ddbf851b1950f767022d67c8142b1b3c50f3 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/244
* | Merge "Add schema argument to AutomapBase.prepare()"mike bayer2016-06-021-0/+10
|\ \
| * | Add schema argument to AutomapBase.prepare()Josh Marlow2016-06-021-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge "Add an init_scalar event for attributes"mike bayer2016-06-022-5/+114
|\ \ \ | |_|/ |/| |
| * | Add an init_scalar event for attributesMike Bayer2016-06-022-5/+114
| |/ | | | | | | | | | | | | | | | | 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
* | - limit oracle DB reaps to identifiers generated from thisMike Bayer2016-06-023-4/+20
| | | | | | | | | | | | run to prevent race conditions against concurrent runs Change-Id: I065d1cec346ea7af03792c3cc2f30766f73c2bd3
* | Merge "Skip UniqueConstraint marked by unique=True in tometadata"mike bayer2016-06-021-1/+7
|\ \ | |/ |/|
| * Skip UniqueConstraint marked by unique=True in tometadataMike Bayer2016-06-021-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge "Add postgresql_tablespace option on Index"mike bayer2016-06-021-1/+19
|\ \ | |/ |/|
| * Add postgresql_tablespace option on Indexbeenje2016-06-011-1/+19
| | | | | | | | | | | | | | | | | | This complements the same-named parameter available on Table. Fixes: #3720 Change-Id: I56e081e2a551f37c3f392ca4b301c9ef82b94e59 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/233
* | - don't raise for stray gc connection. this just happensMike Bayer2016-06-021-2/+3
|/ | | | | | | sometimes and it really breaks the build once this error occurs. Change-Id: I577c78d623b22a6429f8b083fe08821bc467eb7a
* Implemented CHECK constraint reflection for SQLite and PostgreSQLAlex Grönholm2016-06-014-0/+117
| | | | | | Co-Authored-By: Mike Bayer <mike_mp@zzzcomputing.com> Change-Id: Ie6cf2d2958d1c567324db9e08fef2d3186e97350 Pull-request: https://bitbucket.org/zzzeek/sqlalchemy/pull-requests/80
* Use new mxODBC 3.3.4 varbinary null symbolSheila Allen2016-05-311-0/+27
| | | | | | | | | 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
* Convert readthedocs link for their .org -> .io migration for hosted projectspr/278Adam Chainz2016-05-291-1/+1
| | | | | | | | As per their email ‘Changes to project subdomains’: > Starting today, Read the Docs will start hosting projects from subdomains on the domain readthedocs.io, instead of on readthedocs.org. This change addresses some security concerns around site cookies while hosting user generated data on the same domain as our dashboard. Test Plan: Manually visited all the links I’ve modified.
* Merge remote-tracking branch 'origin/pr/270'Mike Bayer2016-05-245-5/+5
|\
| * Spelling fixes: "an SQL" -> "a SQL", see #266pr/270Ville Skyttä2016-05-052-2/+2
| |
| * Spelling fixes: "the a"Ville Skyttä2016-05-053-3/+3
| |
* | Merge remote-tracking branch 'origin/pr/274'Mike Bayer2016-05-241-1/+1
|\ \
| * | Fix typo in config result.py docspr/274vytotas2016-05-161-1/+1
| | |
* | | Support "blank" schema when MetaData.schema is setMike Bayer2016-05-184-4/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, it was impossible to have a Table that has None for a schema name when the "schema" parameter on MetaData was set. A new symbol sqlalchemy.schema.BLANK_SCHEMA is added which indicates that the schema name should unconditionally be set to None. In particular, this value must be passed within cross-schema foreign key reflection, so that a Table which is in the "default" schema can be represented properly. Fixes: #3716 Change-Id: I3d24f99c22cded206c5379fd32a225e74edb7a8e
* | | Merge "Accommodate "callable" bound param in evaluator"mike bayer2016-05-161-1/+4
|\ \ \
| * | | Accommodate "callable" bound param in evaluatorMike Bayer2016-05-161-1/+4
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed bug in "evaluate" strategy of :meth:`.Query.update` and :meth:`.Query.delete` which would fail to accommodate a bound parameter with a "callable" value, as which occurs when filtering by a many-to-one equality expression along a relationship. Change-Id: I47758d3f5d8b9ea1a07e23166780d5f3c32b17f1 Fixes: #3700
* | | Fix TypeError during cx_Oracle connectionJohn Vandenberg2016-05-161-3/+7
|/ / | | | | | | | | | | | | | | | | | | | | cx_Oracle connection parameters user, password and dsn must be either a string or NULL. When they are passed a Python None object, "TypeError: expecting string, unicode or buffer object" is raised. Fixes: #3705 Change-Id: I8da5d8a227ca12c9bf17a6127460e413841951fb Pull-request: https://github.com/zzzeek/sqlalchemy/pull/271
* | Handle `SSL error: decryption failed or bad record mac`Iuri de Silvio2016-05-131-0/+1
| | | | | | | | | | | | | | | | | | This is another psycopg2 error message representing an unusable connection. Fixes #3715 Change-Id: Ida6e212963e9c7336bf2944e7ef928619ac3a0e7 Pull-request: https://bitbucket.org/zzzeek/sqlalchemy/pull-requests/85
* | Fix label referencing in SQL Server OFFSET logicMike Bayer2016-05-102-1/+15
| | | | | | | | | | | | | | | | | | | | Fixed bug where by ROW_NUMBER OVER clause applied for OFFSET selects in SQL Server would inappropriately substitute a plain column from the local statement that overlaps with a label name used by the ORDER BY criteria of the statement. Change-Id: Ic2500c886cbfc83a1ad5a2681783f008b9f23838 Fixes: #3711
* | Check for duplicate calls to register_attribute_implMike Bayer2016-05-101-3/+15
| | | | | | | | | | | | | | | | | | | | Fixed bug whereby the event listeners used for backrefs could be inadvertently applied multiple times, when using a deep class inheritance hierarchy in conjunction with mutiple mapper configuration steps. Change-Id: I712beaf4674e2323bf5b282922658020a6d00b53 Fixes: #3710
* | Repair _orm_columns() to accommodate text()Mike Bayer2016-05-052-1/+3
|/ | | | | | | | | Fixed bug whereby passing a :func:`.text` construct to the :meth:`.Query.group_by` method would raise an error, instead of intepreting the object as a SQL fragment. Change-Id: I5fc2f590b76508d52e23b5fa9cf037ddea8080c3 fixes: #3706
* Merge remote-tracking branch 'origin/pr/267'Mike Bayer2016-05-041-8/+10
|\
| * Corrects some references in ORM documentation.pr/267Jeffrey Finkelstein2016-05-031-8/+10
| |
* | Merge remote-tracking branch 'origin/pr/265'Mike Bayer2016-05-042-4/+4
|\ \ | |/ |/|
| * Let logging format messages on demand, use warning instead of deprecated warnpr/265Ville Skyttä2016-05-032-4/+4
| |
* | Fix pymssql sample URLMike Bayer2016-04-271-1/+1
| | | | | | | | | | | | | | | | A slash is required before building out the query string portion. Change-Id: Ie97fd3d07047d78e17cbaffed4ff54960a2b956e Fixes: #3696 (cherry picked from commit 83a9e6e1fac276090e60136aa4e9234ae23bc25a)
* | Merge remote-tracking branch 'origin/pr/263'Mike Bayer2016-04-271-7/+7
|\ \
| * | Adds parentheses around prints in documentationpr/263jfinkels2016-04-271-7/+7
| | | | | | | | | This makes the docstring example code compatible with both Python 2 and Python 3.
* | | Don't double-process ResultMetaData for BufferedColumnResultProxyMike Bayer2016-04-271-9/+15
|/ / | | | | | | | | | | | | | | | | | | | | | | Fixed a bug in the result proxy used mainly by Oracle when binary and other LOB types are in play, such that when query / statement caching were used, the type-level result processors, notably that required by the binary type itself but also any other processor, would become lost after the first run of the statement due to it being removed from the cached result metadata. Change-Id: I751940866cffb4f48de46edc8137482eab59790c Fixes: #3699
* | Fix result set handling for case insensitive dupe colsMike Bayer2016-04-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | Fixed bug where when using ``case_sensitive=False`` with an :class:`.Engine`, the result set would fail to correctly accomodate for duplicate column names in the result set, causing an error when the statement is executed in 1.0, and preventing the "ambiguous column" exception from functioning in 1.1. Change-Id: If582bb9fdd057e4da3ae42f7180b17d1a1a2d98e Fixes: #3690
* | Merge "Deprecate Mapper.order_by"mike bayer2016-04-191-0/+9
|\ \
| * | Deprecate Mapper.order_byMike Bayer2016-04-191-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an old parameter no longer relevant to how SQLAlchemy works, once the Query object was introduced. By deprecating it we establish that we aren't supporting non-working use cases and that we encourage applications to move off of the use of this parameter. Fixes: #3394 Change-Id: I25b9a38142a1537bbcb27d3e8b66a8b265140072
* | | Rename Query._mapper_zero() to Query._entity_zero()Mike Bayer2016-04-191-17/+15
|/ / | | | | | | | | | | | | | | | | | | | | | | To be more descriptive of the use of _mapper_zero(), rename it to _entity_zero(), but also supply a new _mapper_zero() function that more strictly returns a mapper. The existing _entity_zero() function is renamed to _query_entity_zero. _only_mapper_zero() is removed as it isn't used. Divide up the existing calling functions to refer to the appropriate new method. Change-Id: I8780c3235e87b4936c6daf64d9d299b22b6e1260 Fixes: #3608
* | Merge "Add raise/raiseload relationship loading strategy"mike bayer2016-04-194-0/+65
|\ \
| * | Add raise/raiseload relationship loading strategyAdrian Moennich2016-04-194-0/+65
| |/ | | | | | | | | | | | | Fixes: #3512 Co-Authored-By: Mike Bayer <mike_mp@zzzcomputing.com> Change-Id: Ibd126c50eda621e2f4120ee378f7313af2d7ec3c Pull-request: https://github.com/zzzeek/sqlalchemy/pull/193
* | Propagate hybrid properties / infoMike Bayer2016-04-181-1/+12
| | | | | | | | | | | | | | | | | | | | | | Keystone and others depend on the .property attribute being "mirrored" when a @hybrid_property is linked directly to a mapped attribute. Restore this linkage and also create a defined behavior for the .info dictionary; it is that of the hybrid itself. Add this behavioral change to the migration notes. Change-Id: I8ac34ef52039387230c648866c5ca15d381f7fee References: #3653
* | Honor hybrid property / method docstringsMike Bayer2016-04-181-5/+25
| | | | | | | | | | | | | | | | | | | | | | | | The docstring specified on a hybrid property or method is now honored at the class level, allowing it to work with tools like Sphinx autodoc. The mechanics here necessarily involve some wrapping of expressions to occur for hybrid properties, which may cause them to appear differently using introspection. Fixes: #3653 Change-Id: I02549977fe8b2a051802eed7b00cc532fbc214e3 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/239