summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/mysql/base.py
Commit message (Collapse)AuthorAgeFilesLines
* Add basic support of unique constraints reflectionpr/4Roman Podolyaka2013-06-091-0/+15
| | | | | | | | | | | | Inspection API already supports reflection of table indexes information and those also include unique constraints (at least for PostgreSQL and MySQL). But it could be actually useful to distinguish between indexes and plain unique constraints (though both are implemented in the same way internally in RDBMS). This change adds a new method to Inspection API - get_unique_constraints() and implements it for SQLite, PostgreSQL and MySQL dialects.
* - changelog for [ticket:2704]Mike Bayer2013-06-081-9/+13
| | | | - use an isinstance() check, concerned a TypeError might be indiscriminate
* Fix using of 'mysql_length' for composite indexesRoman Podolyaka2013-06-081-7/+25
| | | | | | | | | | | | | | | | | Currently, one can specify the prefix length for an index column using 'mysql_length' keyword argument when creating an Index instance. But in case of composite indexes the prefix length value is applied only to the last column. Extend the existing API in way so that 'mysql_length' argument value can be either: - an integer specifying the same prefix length value for each column of an index - a (column_name --> integer value) mapping specifying the prefix length value for each column of an index separately Fixes issue #2704.
* The ``deferrable`` keyword argument on :class:`.ForeignKey` andMike Bayer2013-06-031-0/+2
| | | | | | | | :class:`.ForeignKeyConstraint` will not render the ``DEFERRABLE`` keyword on the MySQL dialect. For a long time we left this in place because a non-deferrable foreign key would act very differently than a deferrable one, but some environments just disable FKs on MySQL, so we'll be less opinionated here. [ticket:2721]
* mysql testsMike Bayer2013-05-261-5/+1
|
* merge defaultMike Bayer2013-04-291-26/+15
|\
| * - fix long-outdated documentation for sql_mode/ansiquotes,Mike Bayer2013-04-291-26/+15
| | | | | | | | closes [ticket:1552]
* | plugging awayMike Bayer2013-04-271-18/+9
| |
* | - the raw 2to3 runMike Bayer2013-04-271-21/+23
|/ | | | - went through examples/ and cleaned out excess list() calls
* - changelogMike Bayer2013-04-211-1/+1
| | | | - just do a fetchone() here, no need for len() etc.
* merge cymysql branchMike Bayer2013-04-211-1/+1
|\
| * select not return rowcount at mysql+cymysqlHajime Nakagami2013-04-061-1/+1
| |
* | - Improvements to the operation of the pymysql dialect onMike Bayer2013-04-211-5/+2
| | | | | | | | | | | | | | | | Python 3, including some important decode/bytes steps. Issues remain with BLOB types due to driver issues. Courtesy Ben Trofatter. - start using util.py3k, we will eventually remove the sa2to3 fixer entirely
* | Merged in bentrofatter/sqlalchemy-2663 (pull request #49)Mike Bayer2013-04-211-0/+5
|\ \ | |/ |/| | | Fixed PyMySQL problems for Python 2.x and mitigated some issues with Python 3.x
| * Added workaround for pymysql3 double wrapping ProgrammingErrors to pymysql ↵Ben Trofatter2013-03-181-0/+5
| | | | | | | | | | | | dialect. Added workaround for pymysql3 return a bytes object when queried for isolation level.
* | - add a nose runner that erases out argv, otherwiseMike Bayer2013-03-251-1/+0
|/ | | | | you get "import test" as what it tries to run with setup.py test
* more egregious long linesMike Bayer2013-02-021-37/+68
|
* Added a new argument to :class:`.Enum` and its baseMike Bayer2013-02-011-0/+1
| | | | | | | | | | | | :class:`.SchemaType` ``inherit_schema``. When set to ``True``, the type will set its ``schema`` attribute of that of the :class:`.Table` to which it is associated. This also occurs during a :meth:`.Table.tometadata` operation; the :class:`.SchemaType` is now copied in all cases when :meth:`.Table.tometadata` happens, and if ``inherit_schema=True``, the type will take on the new schema name passed to the method. The ``schema`` is important when used with the Postgresql backend, as the type results in a ``CREATE TYPE`` statement. [ticket:2657]
* fix incorrect quoting in mysql indexesMike Bayer2013-01-171-3/+1
|
* :class:`.Index` now supports arbitrary SQL expressions and/orMike Bayer2013-01-161-6/+8
| | | | | | | | 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]
* remove all specifics from the "supported features" section as thisMike Bayer2013-01-121-21/+3
| | | | is not maintainable
* happy new year (see #2645)Diana Clarke2013-01-011-1/+1
|
* internally at least refer to multirow as "multivalues", to distinguish betweenMike Bayer2012-12-081-1/+1
| | | | | an INSERT that's used in executemany() as opposed to one which has a VALUES clause with multiple entries.
* compiler: add support for multirow insertsIdan Kamara2012-12-061-0/+1
| | | | | | | | | | | | | | | | | | | | | Some databases support this syntax for inserts: INSERT INTO table (id, name) VALUES ('v1', 'v2'), ('v3', 'v4'); which greatly increases INSERT speed. It is now possible to pass a list of lists/tuples/dictionaries as the values param to the Insert construct. We convert it to a flat dictionary so we can continue using bind params. The above query will be converted to: INSERT INTO table (id, name) VALUES (:id, :name), (:id0, :name0); Currently only supported on postgresql, mysql and sqlite.
* - recognize that do_rollback() and do_commit() work with a DBAPI connection,Mike Bayer2012-11-221-4/+4
| | | | | | | | | | | | | | | | | | whereas the other do_rollback_twophase(), savepoint etc. work with :class:`.Connection`. the context on these are different as twophase/savepoint are available at the :class:`.Connection` level, whereas commit/rollback are needed at a lower level as well. Rename the argument to "dbapi_connection" when the conneciton is in fact the DBAPI interface. - start thinking about being able to track "autocommit" vs. "commit", but not sure we have a need for this yet. - have Pool call out to a Dialect for all rollback/commit/close operations now. Pool no longer calls DBAPI methods directly. May use this for a workaround for [ticket:2611] - add a new Pool event reset() to allow the pool's reset of the connection to be intercepted. - remove methods in Informix dialect which appear to be hardcoding some isolation settings on new Transaction only; the isolation API should be implemented for Informix. also removed "flag" for transaction commit/rollback being not available; this should be based on server/DBAPI version and we will need someone with test access in order to help determine how this should work
* kill me now, pep8 pass, so closeDiana Clarke2012-11-201-17/+17
|
* just a pep8 passDiana Clarke2012-11-201-8/+3
|
* juts a 'expected 2 blank lines' pep8 passDiana Clarke2012-11-191-2/+31
|
* - rework the sphinx customizations into distinct modulesMike Bayer2012-10-191-25/+3
| | | | | | | - 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
* - move out maxdbMike Bayer2012-10-181-0/+20
| | | | | | - begin consolidating docs for dialects to be more self contained - add a separate section for "external" dialects - not sure how we're going to go with this yet.
* python 3 divisionMike Bayer2012-10-101-2/+2
|
* - [feature] Added "collation" parameter to allMike Bayer2012-10-101-19/+11
| | | | | | | | | | | String types. When present, renders as COLLATE <collation>. This to support the COLLATE keyword now supported by several databases including MySQL, SQLite, and Postgresql. [ticket:2276] - [change] The Text() type renders the length given to it, if a length was specified.
* - [feature] Added TIME type to mysql dialect,Mike Bayer2012-10-101-6/+39
| | | | | | | | | | | | accepts "fst" argument which is the new "fractional seconds" specifier for recent MySQL versions. The datatype will interpret a microseconds portion received from the driver, however note that at this time most/all MySQL DBAPIs do not support returning this value. [ticket:2534] - attempted to modernize the types tests in test_mysql a little, though has a long way to go
* - improve docs for MySQL/SQLite foreign key/ON UPDATE|DELETE instructions,Mike Bayer2012-09-231-1/+8
| | | | [ticket:2514]
* removed outdated reference to TINYINT(1) => BOOLEAN reflection in mysql dialectPaul Butler2012-08-271-4/+0
|
* - fix concat() operator, testsMike Bayer2012-08-141-4/+6
| | | | | | | | - [feature] Custom unary operators can now be used by combining operators.custom_op() with UnaryExpression(). - clean up the operator dispatch system and make it more consistent. This does change the compiler contract for custom ops.
* more import cleanupsMike Bayer2012-08-071-13/+14
|
* -whitespace bonanza, contdMike Bayer2012-07-281-51/+51
|
* - a big renaming of all the _Underscore classes to haveMike Bayer2012-07-171-2/+2
| | | | | | plain names. The old names are still defined for backwards compatibility. - _BindParamClause renamed to BindParameter
* - rewrite rowcount documentation to be as absolutely clear as possibleMike Bayer2012-06-121-0/+18
|
* Add some `Sphinx` paragraph level versions informations markups,Mike Bayer2012-06-081-1/+1
| | | | such as ``.. versionadded::``, ``.. versionchanged::`` and ``.. deprecated::``.
* - [bug] Dialect no longer emits expensive serverMike Bayer2012-05-241-2/+0
| | | | | | collations query, as well as server casing, on first connect. These functions are still available as semi-private. [ticket:2404]
* - [feature] Inspector.get_primary_keys() isMike Bayer2012-04-241-4/+4
|\ | | | | | | | | | | | | | | deprecated; use Inspector.get_pk_constraint(). Courtesy Diana Clarke. [ticket:2422] - restored default get_primary_keys()/get_pk_constraint() wrapper to help maintain compatibility with third party dialects created against 0.6 or 0.7
| * deprecate inspector.get_primary_keys() in favor of inspector.get_pk_constraint()Diana Clarke2012-04-021-4/+4
| | | | | | | | - see #2422
* | - mysql [bug] Fixed bug whereby if cast() is usedMike Bayer2012-04-161-2/+2
| | | | | | | | | | | | | | | | | | on a SQL expression whose type is not supported by cast() and therefore CAST isn't rendered by the dialect, the order of evaluation could change if the casted expression required that it be grouped; grouping is now applied to those expressions. [ticket:2467]
* | - test explicitly for 'VIEW', 'SYSTEM VIEW'Mike Bayer2012-04-121-1/+1
| | | | | | | | - move the test to the reflection tests
* | Modified MySQLDialect.get_view_names() to also return system views such as ↵elazar2012-04-111-2/+1
| | | | | | | | those in information_schema
* | - adjust mysql patch a bit so that we useMike Bayer2012-04-081-2/+6
| | | | | | | | | | | | | | | | | | built in quoting for the "idx_" name as well - [bug] Fixed bug whereby column name inside of "KEY" clause for autoincrement composite column with InnoDB would double quote a name that's a reserved word. Courtesy Jeff Dairiki. [ticket:2460]
* | Fix innodb autoinc constraint (double)quotingJeff Dairiki2012-04-061-1/+1
| |
* | most of the drizzle docs are copy/pasta, let's just point users to the mysql ↵Diana Clarke2012-04-021-3/+3
|/ | | | | | docs and enhance as questions arise - see #2385