summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/sybase
Commit message (Collapse)AuthorAgeFilesLines
* Remove deprecated dialects and driversFederico Caselli2021-10-315-1396/+0
| | | | | Fixes: #7258 Change-Id: I3577f665eca04f2632b69bcb090f0a4ec9271db9
* Replace all http:// links to https://Federico Caselli2021-07-045-9/+9
| | | | | | Also replace http://pypi.python.org/pypi with https://pypi.org/project Change-Id: I84b5005c39969a82140706472989f2a30b0c7685
* pass asfrom correctly in compilersMike Bayer2021-04-171-1/+2
| | | | | | | | | | | | Fixed an argument error in the default and PostgreSQL compilers that would interfere with an UPDATE..FROM or DELETE..FROM..USING statement that was then SELECTed from as a CTE. The incorrect pattern was also fixed in the mysql and sybase dialects. MySQL supports CTEs but not "returning". Fixes: #6303 Change-Id: Ic94805611a5ec443749fb6b1fd8a1326b0d83ef7
* Explicitly test for Connection in dialect.has_table()Mike Bayer2021-04-141-0/+2
| | | | | | | | | | | | | | The :meth:`_engine.Dialect.has_table` method now raises an informative exception if a non-Connection is passed to it, as this incorrect behavior seems to be common. This method is not intended for external use outside of a dialect. Please use the :meth:`.Inspector.has_table` method or for cross-compatibility with older SQLAlchemy versions, the :meth:`_engine.Engine.has_table` method. Fixes: #5780 Fixes: #6062 Fixes: #6260 Change-Id: I9b2439675167019b68d682edee3dcdcfce836987
* Default caching to opt-out for 3rd party dialectsMike Bayer2021-04-014-0/+5
| | | | | | | | | | | | | | | | | | | Added a new flag to the :class:`_engine.Dialect` class called :attr:`_engine.Dialect.supports_statement_cache`. This flag now needs to be present directly on a dialect class in order for SQLAlchemy's :ref:`query cache <sql_caching>` to take effect for that dialect. The rationale is based on discovered issues such as :ticket:`6173` revealing that dialects which hardcode literal values from the compiled statement, often the numerical parameters used for LIMIT / OFFSET, will not be compatible with caching until these dialects are revised to use the parameters present in the statement only. For third party dialects where this flag is not applied, the SQL logging will show the message "dialect does not support caching", indicating the dialect should seek to apply this flag once they have verified that no per-statement literal values are being rendered within the compilation phase. Fixes: #6184 Change-Id: I6fd5b5d94200458d4cb0e14f2f556dbc25e27e22
* happy new yearMike Bayer2021-01-045-5/+5
| | | | Change-Id: Ic5bb19ca8be3cb47c95a0d3315d84cb484bac47c
* SYBASE: Added offset supportsnowman22020-05-241-13/+8
| | | | | | | | | | | | | | | | | | | | | | Fixes: #5294 ### Description Fix for https://github.com/sqlalchemy/sqlalchemy/issues/5294#issue-610311455 I tested it against our database (Adaptive Server Enterprise/16.0 SP02) with `pyodbc+sybase` ### Checklist This pull request is: - [x] A short code fix for #5294 - [x] Added tests. Closes: #5312 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5312 Pull-request-sha: f62c14825f2941fdd54ede17fd8d4f105a052e05 Change-Id: Ic716e17a6f654deef78781cefc3f16333cd725c3
* Adjust documentation wording for firebird and sybaseGord Thompson2020-05-151-6/+9
| | | | Change-Id: Ied2cdab1c2dbdee681a5500285a5bcdd4d589afa
* Deprecate unsupported dialects and dbapiFederico Caselli2020-04-293-2/+15
| | | | | | | | | | | | | | | | | - Deprecate dialects firebird and sybase. - Deprecate DBAPI - mxODBC for mssql - oursql for mysql - pygresql and py-postgresql for postgresql - Removed adodbapi DBAPI for mssql Fixes: #5189 Change-Id: Id9025f4f4de7e97d65aacd0eb4b0c21beb9a67b5
* Deprecate plain string in execute and introduce `exec_driver_sql`Federico Caselli2020-03-211-1/+1
| | | | | | | | | | | | | | | Execution of literal sql string is deprecated in the :meth:`.Connection.execute` and a warning is raised when used stating that it will be coerced to :func:`.text` in a future release. To execute a raw sql string the new connection method :meth:`.Connection.exec_driver_sql` was added, that will retain the previous behavior, passing the string to the DBAPI driver unchanged. Usage of scalar or tuple positional parameters in :meth:`.Connection.execute` is also deprecated. Fixes: #4848 Fixes: #5178 Change-Id: I2830181054327996d594f7f0d59c157d477c3aa9
* happy new yearMike Bayer2020-01-015-5/+5
| | | | Change-Id: I08440dc25e40ea1ccea1778f6ee9e28a00808235
* Render LIMIT/OFFSET conditions after compile on select dialectsMike Bayer2019-08-301-11/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added new "post compile parameters" feature. This feature allows a :func:`.bindparam` construct to have its value rendered into the SQL string before being passed to the DBAPI driver, but after the compilation step, using the "literal render" feature of the compiler. The immediate rationale for this feature is to support LIMIT/OFFSET schemes that don't work or perform well as bound parameters handled by the database driver, while still allowing for SQLAlchemy SQL constructs to be cacheable in their compiled form. The immediate targets for the new feature are the "TOP N" clause used by SQL Server (and Sybase) which does not support a bound parameter, as well as the "ROWNUM" and optional "FIRST_ROWS()" schemes used by the Oracle dialect, the former of which has been known to perform better without bound parameters and the latter of which does not support a bound parameter. The feature builds upon the mechanisms first developed to support "expanding" parameters for IN expressions. As part of this feature, the Oracle ``use_binds_for_limits`` feature is turned on unconditionally and this flag is now deprecated. - adds limited support for "unique" bound parameters within a text() construct. - adds an additional int() check within the literal render function of the Integer datatype and tests that non-int values raise ValueError. Fixes: #4808 Change-Id: Iace97d544d1a7351ee07db970c6bc06a19c712c6
* Note DBAPIs and dialects that we don't supportMike Bayer2019-07-051-3/+3
| | | | | | | | | | | | | | Since we have strong CI for the DBAPIs and dialects that are actively supported, this indicates that those DBAPIs that aren't in CI are continuing to fall behind in support, to the point where we can not address issues that may arise. As such, the Sybase and Firebird dialects overall are moving into an explicit "not supported" zone where we would like to eventually remove them. Additionally, a pass is made through legacy MySQL and PostgreSQL DBAPI dialects as well as those which we aren't able to include in CI to note that these DBAPIs aren't actively supported by the project. Change-Id: I61f1515b97b741b7534b54e434e3e47065df7b5d
* Repair use of deprecated text() typemap, bindparams parametersMike Bayer2019-01-171-4/+1
| | | | | | | | These will emit a deprecation warning once If0ea11a1fc24f9a8029352eeadfc49a7a54c0a1b is merged, modernize these ahead of time as this should likely be backported to 1.2 as well. Change-Id: Iae4426a856d5617e8a325b14d8b6fc22333f2cda
* happy new yearMike Bayer2019-01-115-5/+5
| | | | Change-Id: I6a71f4924d046cf306961c58dffccf21e9c03911
* Post black reformattingMike Bayer2019-01-065-83/+79
| | | | | | | | | | | | | Applied on top of a pure run of black -l 79 in I7eda77fed3d8e73df84b3651fd6cfcfe858d4dc9, this set of changes resolves all remaining flake8 conditions for those codes we have enabled in setup.cfg. Included are resolutions for all remaining flake8 issues including shadowed builtins, long lines, import order, unused imports, duplicate imports, and docstring issues. Change-Id: I4f72d3ba1380dd601610ff80b8fb06a2aff8b0fe
* Run black -l 79 against all source filesMike Bayer2019-01-065-249/+551
| | | | | | | | | | | | | | This is a straight reformat run using black as is, with no edits applied at all. The black run will format code consistently, however in some cases that are prevalent in SQLAlchemy code it produces too-long lines. The too-long lines will be resolved in the following commit that will resolve all remaining flake8 issues including shadowed builtins, long lines, import order, unused imports, duplicate imports, and docstring issues. Change-Id: I7eda77fed3d8e73df84b3651fd6cfcfe858d4dc9
* Convert dialect modules to relative imports and testMike Bayer2018-02-051-6/+5
| | | | | | | | For some reason the dialects were not consistently converted to relative imports. Also added a test to ensure that __all__ is functioning within each dialect. Change-Id: I8450ed724473be7e17678e9aba7ba0f661fdf134
* happy new yearMike Bayer2018-01-125-5/+5
| | | | Change-Id: I3ef36bfd0cb0ba62b3123c8cf92370a43156cf8f
* Allow delete where clause to refer multiple tables.inytar2017-12-051-0/+18
| | | | | | | | | | | | | | | | | | | | | Implemented "DELETE..FROM" syntax for Postgresql, MySQL, MS SQL Server (as well as within the unsupported Sybase dialect) in a manner similar to how "UPDATE..FROM" works. A DELETE statement that refers to more than one table will switch into "multi-table" mode and render the appropriate "USING" or multi-table "FROM" clause as understood by the database. Pull request courtesy Pieter Mulder. For SQL syntaxes see: Postgresql: https://www.postgresql.org/docs/current/static/sql-delete.html MySQL: https://dev.mysql.com/doc/refman/5.7/en/delete.html#multiple-table_syntax MSSQL: https://docs.microsoft.com/en-us/sql/t-sql/statements/delete-transact-sql Sybase: http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc00801.1510/html/iqrefso/X315721.htm Co-authored by: Mike Bayer <mike_mp@zzzcomputing.com> Change-Id: I6dfd57b49e44a095d076dc493cd2360bb5d920d3 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/392 Fixes: #959
* update for 2017 copyrightMike Bayer2017-01-045-5/+5
| | | | Change-Id: I4e8c2aa8fe817bb2af8707410fa0201f938781de
* Replace some uses of re.sub with str.lstrip/replaceVille Skyttä2016-06-061-1/+1
| | | | | Change-Id: I98cd60b6830ee94e39ba9307523a9e8fb93bf4e8 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/280
* - happy new yearMike Bayer2016-01-295-5/+5
|
* - The unsupported Sybase dialect now raises ``NotImplementedError``Mike Bayer2016-01-201-5/+1
| | | | | when attempting to compile a query that includes "offset"; Sybase has no straightforward "offset" feature. fixes #2278
* - Fixed two issues regarding Sybase reflection, allowing tablesMike Bayer2015-08-101-6/+9
| | | | | | | | | without primary keys to be reflected as well as ensured that a SQL statement involved in foreign key detection is pre-fetched up front to avoid driver issues upon nested queries. Fixes here courtesy Eugene Zapolsky; note that we cannot currently test Sybase to locally verify these changes. fixes #3508 fixes #3509
* - Fixed a regression that was incorrectly fixed in 1.0.0b4Mike Bayer2015-04-241-1/+0
| | | | | | | | | | | | | | | | | | (hence becoming two regressions); reports that SELECT statements would GROUP BY a label name and fail was misconstrued that certain backends such as SQL Server should not be emitting ORDER BY or GROUP BY on a simple label name at all; when in fact, we had forgotten that 0.9 was already emitting ORDER BY on a simple label name for all backends, as described in :ref:`migration_1068`, as 1.0 had rewritten this logic as part of :ticket:`2992`. In 1.0.2, the bug is fixed both that SQL Server, Firebird and others will again emit ORDER BY on a simple label name when passed a :class:`.Label` construct that is expressed in the columns clause, and no backend will emit GROUP BY on a simple label name in this case, as even Postgresql can't reliably do GROUP BY on a simple name in every case. fixes #3338, fixes #3385
* - Fixed support for "literal_binds" mode when using limit/offsetMike Bayer2015-04-231-1/+1
| | | | | | with Firebird, so that the values are again rendered inline when this is selected. Related to :ticket:`3034`. fixes #3381
* - also add this to Oracle, and defensively to firebird and sybaseMike Bayer2015-03-241-0/+1
|
* - copyright 2015Mike Bayer2015-03-105-5/+5
|
* - Custom dialects that implement :class:`.GenericTypeCompiler` canMike Bayer2015-01-161-13/+14
| | | | | | | | | | | | | | now be constructed such that the visit methods receive an indication of the owning expression object, if any. Any visit method that accepts keyword arguments (e.g. ``**kw``) will in most cases receive a keyword argument ``type_expression``, referring to the expression object that the type is contained within. For columns in DDL, the dialect's compiler class may need to alter its ``get_column_specification()`` method to support this as well. The ``UserDefinedType.get_col_spec()`` method will also receive ``type_expression`` if it provides ``**kw`` in its argument signature. fixes #3074
* - ensure literal_binds works with LIMIT clause, FOR UPDATEMike Bayer2014-09-031-1/+1
|
* - apply pep8 formatting to sqlalchemy/sql, sqlalchemy/util, sqlalchemy/dialects,Brian Jarrett2014-07-204-61/+65
| | | | sqlalchemy/orm, sqlalchemy/event, sqlalchemy/testing
* - break up the <authors> copyright comment as part of a passMike Bayer2014-07-095-5/+10
| | | | to get all flake8 passing
* Extract limit/offset to variablesDobes Vandermeer2014-04-251-5/+7
|
* - implement kwarg validation and type system for dialect-specificMike Bayer2014-01-181-0/+2
| | | | | arguments; [ticket:2866] - add dialect specific kwarg functionality to ForeignKeyConstraint, ForeignKey
* - happy new yearMike Bayer2014-01-055-5/+5
|
* remove all remaining start/end py2k/py3k blocksMike Bayer2013-06-071-18/+16
|
* - the raw 2to3 runMike Bayer2013-04-272-19/+19
| | | | - went through examples/ and cleaned out excess list() calls
* - remove all compat items that are pre-2.5 (hooray)Mike Bayer2013-03-091-1/+1
| | | | | | - other cleanup - don't need compat.decimal, that approach never panned out. hopefully outside libs aren't pulling it in, they shouldn't be
* :class:`.Index` now supports arbitrary SQL expressions and/orMike Bayer2013-01-161-2/+2
| | | | | | | | functions, in addition to straight columns. Common modifiers include using ``somecolumn.desc()`` for a descending index and ``func.lower(somecolumn)`` for a case-insensitive index, depending on the capabilities of the target backend. [ticket:695]
* happy new year (see #2645)Diana Clarke2013-01-012-2/+2
|
* happy new year (see #2645)Diana Clarke2013-01-013-3/+3
|
* just a pep8 pass of lib/sqlalchemy/dialects/sybaseDiana Clarke2012-11-195-66/+85
|
* Removed caching from SybaseDialect.get_table_idBenjamin Trofatter2012-11-031-1/+0
|
* Updated sybase testing requirementsBenjamin Trofatter2012-10-311-2/+4
|
* Added sybase requirements to testing and improved view reflection.Benjamin Trofatter2012-10-301-33/+17
|
* Added reflection to sqlalchemy.dialects.sybaseBenjamin Trofatter2012-10-301-45/+424
| | | | | | | | | | | | | | | | | | | | | | | | Added missing types supported by Sybase to ischema_names mapping Created a SybaseInspector similar to the PGInspector, with a cached table_id lookup, and added it to the SybaseDialect as the default inspector. Added the following methods to SybaseDialect: get_table_id get_columns _get_column_info : support method for get_columns get_foreign_keys get_indexes get_pk_constraint get_schema_names get_view_definition get_view_names Rewrote the following methods to conform to the style of the rest: get_table_names has_table Reordered colspec builder to put default clause after "NULL/NOT NULL", instead of before. This fixed a syntax error.
* - get 100% lint/pep8 happening for test_compiler; next we will beginMike Bayer2012-10-241-3/+4
| | | | | | cutting up tests and removing old ones - move test_in() to test_operators - slice up migrated operator tests into TOT
* - rework the sphinx customizations into distinct modulesMike Bayer2012-10-194-18/+23
| | | | | | | - build a new Sphinx extension that allows dialect info to be entered as directives which is then rendered consistently throughout all dialect/dbapi sections - break out the "empty_strings" requirement for oracle test
* devMike Bayer2012-09-291-2/+2
|