summaryrefslogtreecommitdiff
path: root/test/sql/test_defaults.py
Commit message (Collapse)AuthorAgeFilesLines
* Add SQL Server CI coverageMike Bayer2017-08-311-0/+3
| | | | Change-Id: Ida0d01ae9bcc0573b86e24fddea620a38c962822
* Add support for CACHE and ORDER to sequencesDavid Moore2017-07-051-0/+12
| | | | | | | | | | | Added new keywords :paramref:`.Sequence.cache` and :paramref:`.Sequence.order` to :class:`.Sequence`, to allow rendering of the CACHE parameter understood by Oracle and PostgreSQL, and the ORDER parameter understood by Oracle. Pull request courtesy David Moore. Change-Id: I082c3f8ef56ef89dbaad5da9d5695be5313b0614 Pull-request: https://bitbucket.org/zzzeek/sqlalchemy/pull-requests/96
* Apply type processing to untyped preexec default clauseMike Bayer2017-03-301-8/+27
| | | | | | | | | | | | | | | | Fixed bug where a SQL-oriented Python-side column default could fail to be executed properly upon INSERT in the "pre-execute" codepath, if the SQL itself were an untyped expression, such as plain text. The "pre- execute" codepath is fairly uncommon however can apply to non-integer primary key columns with SQL defaults when RETURNING is not used. Tests exist here to ensure typing is applied to a typed expression for default, but in the case of an untyped SQL value, we know the type from the column, so apply this. Change-Id: I5d8b391611c137b9f700115a50a2bf5b30abfe94 Fixes: #3923
* Make all tests to be PEP8 compliantKhairi Hafsham2017-02-071-19/+19
| | | | | | | | tested using pycodestyle version 2.2.0 Fixes: #3885 Change-Id: I5df43adc3aefe318f9eeab72a078247a548ec566 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/343
* Change autoincrement compileerror to a warningMike Bayer2016-10-071-7/+7
| | | | | | | | Users are complaining that IntegrityError is no longer raised. Change-Id: I0855d5b7a98d4338f0910501b6e6d404ba33634d Fixes: #3216
* Escape literal string values passed to server_defaultMike Bayer2016-09-301-0/+28
| | | | | | | | | | | A string sent as a column default via the :paramref:`.Column.server_default` parameter is now escaped for quotes. This change is backwards compatible with code that may have been working around this previously. Change-Id: I341298a76cc67bc0a53df4ab51ab9379f2294cdd Fixes: #3809
* Work w/ prefetch even for selects, if presentMike Bayer2016-07-121-0/+87
| | | | | | | | | | | | | | | | | | | 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
* Deprecate FromClause.count()Mike Bayer2016-06-141-1/+2
| | | | | | | | | | | 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
* Merge branch 'pr204'Mike Bayer2015-10-291-0/+1
|\
| * - convert wrap_callable() to a general purpose update_wrapper-likeMike Bayer2015-10-291-60/+0
| | | | | | | | | | | | function; the caller still passes in the "wrapper" - move tests for wrap_callable() to be generic util tests - changelog for pullreq github:204
| * - wrap ColumnDefault empty arg callables like functools.wraps, setting ↵pr/204Martin J. Hsu2015-10-151-0/+61
| | | | | | | | __name__, __doc__, and __module__
* | - this was supposed to be client-side SQL default not server sideMike Bayer2015-10-091-1/+1
| |
* | - open up autoincrement for columns that have a default; autoinc is usuallyMike Bayer2015-10-081-0/+17
| | | | | | | | "auto" now so True can indicate the dialect would support this
* | - The system by which a :class:`.Column` considers itself to be anMike Bayer2015-10-071-3/+3
|/ | | | | | | | | | | | | | | | | "auto increment" column has been changed, such that autoincrement is no longer implicitly enabled for a :class:`.Table` that has a composite primary key. In order to accommodate being able to enable autoincrement for a composite PK member column while at the same time maintaining SQLAlchemy's long standing behavior of enabling implicit autoincrement for a single integer primary key, a third state has been added to the :paramref:`.Column.autoincrement` parameter ``"auto"``, which is now the default. fixes #3216 - The MySQL dialect no longer generates an extra "KEY" directive when generating CREATE TABLE DDL for a table using InnoDB with a composite primary key with AUTO_INCREMENT on a column that isn't the first column; to overcome InnoDB's limitation here, the PRIMARY KEY constraint is now generated with the AUTO_INCREMENT column placed first in the list of columns.
* - Fixed regression in 1.0-released default-processor for multi-VALUESMike Bayer2015-08-311-13/+24
| | | | | | | | insert statement, :ticket:`3288`, where the column type for the default-holding column would not be propagated to the compiled statement in the case where the default was being used, leading to bind-level type handlers not being invoked. fixes #3520
* - fix these two testsMike Bayer2015-07-171-2/+2
|
* add CYCLE support to Sequence() and docstrings for NO MINVALUE and NO MAXVALUEpr/186jakeogh2015-06-271-0/+6
|
* add NO MINVALUE and NO MAXVALUE support to Sequence()jakeogh2015-06-271-0/+12
|
* add MAXVALUE support to Sequence()jakeogh2015-06-271-1/+8
|
* add MINVALUE support to Sequence()jakeogh2015-06-271-0/+5
|
* - The SQL compiler now generates the mapping of expected columnspositional_targetingMike Bayer2015-03-071-1/+1
| | | | | | | | | | | | | | | | | such that they are matched to the received result set positionally, rather than by name. Originally, this was seen as a way to handle cases where we had columns returned with difficult-to-predict names, though in modern use that issue has been overcome by anonymous labeling. In this version, the approach basically reduces function call count per-result by a few dozen calls, or more for larger sets of result columns. The approach still degrades into a modern version of the old approach if textual elements modify the result map, or if any discrepancy in size exists between the compiled set of columns versus what was received, so there's no issue for partially or fully textual compilation scenarios where these lists might not line up. fixes #918 - callcounts still need to be adjusted down for this so zoomark tests won't pass at the moment
* - Literal values within a :class:`.DefaultClause`, which is invokedMike Bayer2015-02-091-3/+70
| | | | | | | when using the :paramref:`.Column.server_default` parameter, will now be rendered using the "inline" compiler, so that they are rendered as-is, rather than as bound parameters. fixes #3087
* - fix this test for py3kMike Bayer2015-01-261-1/+1
|
* Merge remote-tracking branch 'origin/pr/150'Mike Bayer2015-01-261-1/+2
|\
| * Report the type of unexpected expression objectspr/150Ryan P. Kelly2014-11-201-1/+2
| |
* | - The multi-values version of :meth:`.Insert.values` has beenMike Bayer2015-01-131-6/+16
|/ | | | | | | | | | | | repaired to work more usefully with tables that have Python- side default values and/or functions, as well as server-side defaults. The feature will now work with a dialect that uses "positional" parameters; a Python callable will also be invoked individually for each row just as is the case with an "executemany" style invocation; a server- side default column will no longer implicitly receive the value explicitly specified for the first row, instead refusing to invoke without an explicit value. fixes #3288
* - :meth:`.Insert.from_select` now includes Python and SQL-expressionMike Bayer2014-10-101-0/+65
| | | | | | | defaults if otherwise unspecified; the limitation where non- server column defaults aren't included in an INSERT FROM SELECT is now lifted and these expressions are rendered as constants into the SELECT statement.
* - optional 'b' here for py3kMike Bayer2014-08-311-1/+1
|
* - A new style of warning can be emitted which will "filter" up toMike Bayer2014-08-311-2/+3
| | | | | | | | | N occurrences of a parameterized string. This allows parameterized warnings that can refer to their arguments to be delivered a fixed number of times until allowing Python warning filters to squelch them, and prevents memory from growing unbounded within Python's warning registries. fixes #3178
* - update the flake8 rules againMike Bayer2014-07-181-0/+8
| | | | - apply autopep8 + manual fixes to most of test/sql/
* PEP8 tidy of subset of test/sql/*.pypr/103Tony Locke2014-07-071-122/+166
|
* pg8000 passing test/sqlTony Locke2014-07-061-2/+2
|
* - rename __multiple__ to __backend__, and apply __backend__ to a large ↵Mike Bayer2014-03-241-0/+15
| | | | | | number of tests. - move out logging tests from test_execute to test_logging
* - Fixed issue where a primary key column that has a Sequence on it,Mike Bayer2013-12-201-0/+28
| | | | | | | | | yet the column is not the "auto increment" column, either because it has a foreign key constraint or ``autoincrement=False`` set, would attempt to fire the Sequence on INSERT for backends that don't support sequences, when presented with an INSERT missing the primary key value. This would take place on non-sequence backends like SQLite, MySQL. [ticket:2896]
* - remove informix dialect, moved out to ↵Mike Bayer2013-11-171-4/+2
| | | | | | https://bitbucket.org/zzzeek/sqlalchemy_informixdb - remove informix, maxdb, access symbols from tests etc.
* The ``default`` argument of :class:`.Column` now accepts a classMike Bayer2013-10-111-10/+20
| | | | | or object method as an argument, in addition to a standalone function; will properly detect if the "context" argument is accepted or not.
* merge defaultMike Bayer2013-05-051-0/+2
|\
| * cleanupMike Bayer2013-05-041-67/+68
| |
* | and int types here...Mike Bayer2013-05-041-1/+2
| |
* | update testMike Bayer2013-05-041-12/+3
| |
* | cleanup and formattingMike Bayer2013-05-041-67/+68
| |
* | - the raw 2to3 runMike Bayer2013-04-271-13/+15
|/ | | | - went through examples/ and cleaned out excess list() calls
* trying different approaches to test layout. in this one, the testing modulesMike Bayer2012-09-271-5/+6
| | | | | | | become an externally usable package but still remains within the main sqlalchemy parent package. in this system, we use kind of an ugly hack to get the noseplugin imported outside of the "sqlalchemy" package, while still making it available within sqlalchemy for usage by third party libraries.
* - further reorganization of test suite:Mike Bayer2012-09-261-3/+0
| | | | | | | | | | | - bootstrap and lib move to all absolute imports - testing.py is no longer internally referenced. - requirements move to be a pluggable class which can be overridden. - cleanup in the interests of third party testing, test/lib and test/bootstrap may move to be an independent package.
* - fixes for mxODBC, some pyodbcMike Bayer2012-09-021-0/+3
| | | | | | - enhancements to test suite including ability to set up a testing engine for a whole test class, fixes to how noseplugin sets up/tears down per-class context
* - [bug] Fixes to the interpretation of theMike Bayer2012-08-201-11/+19
| | | | | | Column "default" parameter as a callable to not pass ExecutionContext into a keyword argument parameter. [ticket:2520]
* -whitespace bonanza, contdMike Bayer2012-07-281-26/+26
|
* add a checkfirst here as s3 seems to be stuck on the jenkins dbMike Bayer2012-03-141-1/+1
|
* tests for FK/autoincrement selectionMike Bayer2011-12-061-0/+24
|
* - Fixed bug where "autoincrement" detection onMike Bayer2011-06-301-1/+11
| | | | | | | Table would fail if the type had no "affinity" value, in particular this would occur when using the UUID example on the site that uses TypeEngine as the "impl".