Commit Graph

62 Commits

Author SHA1 Message Date
Mike Bayer 084b559b44 - [feature] Added "collation" parameter to all
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.
2012-10-10 19:34:29 -04:00
Mike Bayer ce2c450917 - [feature] Added TIME type to mysql dialect,
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
2012-10-10 14:25:21 -04:00
Mike Bayer c0bba14268 - tighten mysql date test to not fail over 1 second boundaries (and probably microsecond boundaries once they support that...) 2012-09-30 11:00:00 -04:00
Mike Bayer 20cdc64588 trying different approaches to test layout. in this one, the testing modules
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.
2012-09-27 02:37:33 -04:00
Mike Bayer f46f16d4c7 fixes to prevent the new MyISAM engine from breaking other tests 2012-08-29 12:16:18 -04:00
Mike Bayer 099c9d39eb - expand out all the methods on insert/update/delete/select for now
- remove deprecation test
2012-08-19 22:04:33 -04:00
Mike Bayer 22ba1c43b7 -whitespace bonanza, contd 2012-07-28 17:05:50 -04:00
Mike Bayer fdda4b0e01 - mysql [bug] Fixed bug whereby if cast() is used
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]
2012-04-16 12:08:32 -04:00
Mike Bayer 3d66f727f5 - test explicitly for 'VIEW', 'SYSTEM VIEW'
- move the test to the reflection tests
2012-04-12 12:21:02 -04:00
elazar 9596595dcf Fixed test_system_views not checking for MySQL >= 5.0.0 as information_schema support is not available in previous versions 2012-04-12 07:35:49 -05:00
elazar 01087224ce Modified MySQLDialect.get_view_names() to also return system views such as those in information_schema 2012-04-11 21:32:00 -05:00
Mike Bayer 3269b73ff7 - adjust mysql patch a bit so that we use
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]
2012-04-08 11:18:39 -04:00
Jeff Dairiki b7abf86f72 Fix innodb autoinc constraint (double)quoting 2012-04-06 21:55:39 -07:00
Mike Bayer 667f8f83fe - [feature] Added support for MySQL index and
primary key constraint types
(i.e. USING) via new mysql_using parameter
to Index and PrimaryKeyConstraint,
courtesy Diana Clarke.  [ticket:2386]
2012-03-14 14:32:13 -07:00
Mike Bayer 09553dc90f - [feature] Dialect-specific compilers now raise
CompileException for all type/statement compilation
issues, instead of InvalidRequestError or ArgumentError.
The DDL for CREATE TABLE will re-raise
CompileExceptions to include table/column information
for the problematic column.  [ticket:2361]
2012-01-28 15:20:21 -05:00
Mike Bayer a0cc36c239 - adjust some tests and such to work better with a mysql 5.5 install
- Added mysql_length parameter to Index construct,
    specifies "length" for indexes.  [ticket:2293]
2011-10-11 00:15:43 -04:00
Mike Bayer 539c7a1ca2 undo that change with the _, it doesn't break round trips 2011-10-03 15:24:26 -04:00
Mike Bayer a9ebba3e1b - a CREATE TABLE will put the COLLATE option
after CHARSET, which appears to be part of
    MySQL's arbitrary rules regarding if it will actually
    work or not.  [ticket:2225]

  - reflecting a MySQL table will ensure that the
    options added to the Table at the table.kwargs
    level have spaces converted to underscores.
    This is a slight behavioral change specifically
    to the "mysql_default_charset" option which
    previously would not be symmetrical.
2011-10-03 15:19:07 -04:00
Mike Bayer 68a350d462 - remove test.sql._base, test.engine._base, test.orm._base, move those classes to a new test.lib.fixtures module
- move testing.TestBase to test.lib.fixtures
- massive search and replace
2011-03-27 16:27:27 -04:00
Michael Trier a50b362b1b Merge 2011-03-15 18:00:17 -04:00
Jim Phares fde2a7f8fe Informix and postgresql reserved words changes -- almost done. 2011-03-15 16:56:45 -04:00
Diana Clarke 13242f766e corrected a bunch of spelling typos 2011-02-28 13:17:46 -05:00
Mike Bayer ad8700a556 - oursql dialect accepts the same "ssl" arguments in
create_engine() as that of MySQLdb.  [ticket:2047]
2011-02-10 18:04:54 -05:00
Mike Bayer 3f9a343d72 - Query.distinct() now accepts column expressions
as *args, interpreted by the Postgresql dialect
  as DISTINCT ON (<expr>). [ticket:1069]
- select.distinct() now accepts column expressions
  as *args, interpreted by the Postgresql dialect
  as DISTINCT ON (<expr>).  Note this was already
  available via passing a list to the `distinct`
  keyword argument to select(). [ticket:1069]
- select.prefix_with() accepts multiple expressions
  (i.e. *expr), 'prefix' keyword argument to select()
  accepts a list or tuple.
- Passing a string to the `distinct` keyword argument
  of `select()` for the purpose of emitting special
  MySQL keywords (DISTINCTROW etc.) is deprecated -
  use `prefix_with()` for this.
- put kw arguments to select() in order
- restore docs for _SelectBase, renamed from _SelectBaseMixin
2011-02-10 14:17:08 -05:00
Mike Bayer 7e8f351097 - Non-DBAPI errors which occur in the scope of an execute()
call are now wrapped in sqlalchemy.exc.StatementError,
and the text of the SQL statement and repr() of params
is included.  This makes it easier to identify statement
executions which fail before the DBAPI becomes
involved.  [ticket:2015]
2011-02-09 18:11:40 -05:00
Mike Bayer 1515073b96 - New DBAPI support for pymysql, a pure Python port
of MySQL-python.  [ticket:1991]
2011-01-26 11:18:03 -05:00
Mike Bayer 350aed3fdb - whitespace removal bonanza 2011-01-02 14:23:42 -05:00
Mike Bayer 426c4356eb - removes the "on_" prefix. 2010-12-30 14:22:43 -05:00
Mike Bayer dff4e0591e - apply pep8 to compiler.py
- deprecate Compiled.compile() - have __init__ do compilation
if statement is present.
2010-12-21 16:34:00 -05:00
Mike Bayer 83be34c047 - hardwire the huge LIMIT number on MySQL. this might fix the OurSQL py3k
bug we're having, though I'm not able to get a good run of OurSQL
on OSX right now either Python 2 or 3.
2010-12-06 18:45:19 -05:00
Mike Bayer 58b2939433 - sqlalchemy.test and nose plugin moves back to being entirely
outside of "sqlalchemy" and under "test/".

Rationale:

- coverage plugin works without issue, without need for an awkward
additional package install
- command line for "nosetests" isn't polluted with SQLAlchemy options

[ticket:1949]
2010-11-28 14:19:44 -05:00
Mike Bayer 45cdb17ef0 - fixes for PG, mysql, twophase
- added "pool_events" arg to create_engine(), "events" to pool, allowing
establishment of listeners which fire before those of the dialect
2010-11-20 17:57:30 -05:00
Mike Bayer e1402efb19 - move sqlalchemy.test to test.lib 2010-11-15 19:37:50 -05:00
Mike Bayer 6fb06409c6 merge tip 2010-11-14 18:25:13 -05:00
Mike Bayer f3c9c87a24 - Fixed mysql bug involving reflection of CURRENT_TIMESTAMP
default used with ON UPDATE clause, thanks to
Taavi Burns [ticket:1940]
2010-10-20 17:44:35 -04:00
Mike Bayer e4bc7d2894 - move LIMIT/OFFSET rendering to be as bind parameters, for all backends
which support it.  This includes SQLite, MySQL, Postgresql, Firebird,
Oracle (already used binds with ROW NUMBER OVER), MSSQL (when ROW NUMBER
is used, not TOP).   Not included are Informix, Sybase, MaxDB, Access
[ticket:805]
- LIMIT/OFFSET parameters need to stay as literals within SQL
constructs.  This because they may not be renderable as binds on
some backends.
2010-08-29 16:35:02 -04:00
Mike Bayer b2c0b50bbf - The generated index name also is based on
a "max index name length" attribute which is
separate from the "max identifier length" -
this to appease MySQL who has a max length
of 64 for index names, separate from their
overall max length of 255.  [ticket:1412]
2010-08-02 01:12:03 -04:00
Mike Bayer e430aa915f test/dialect 2010-07-11 14:28:21 -04:00
Mike Bayer 87664ce88a - The argument to "ESCAPE" of a LIKE operator or similar
is passed through render_literal_value(), which may
implement escaping of backslashes.  [ticket:1400]
- Postgresql render_literal_value() is overridden which escapes
backslashes, currently applies to the ESCAPE clause
of LIKE and similar expressions.
Ultimately this will have to detect the value of
"standard_conforming_strings" for full behavior.
[ticket:1400]
- MySQL render_literal_value() is overridden which escapes
backslashes, currently applies to the ESCAPE clause
of LIKE and similar expressions.   This behavior
is derived from detecting the value of
NO_BACKSLASH_ESCAPES.  [ticket:1400]
2010-06-24 12:19:15 -04:00
Mike Bayer 17073a0155 - MySQL dialect doesn't emit CAST() for MySQL version
detected < 4.0.2.  This allows the unicode
check on connect to proceed. [ticket:1826]
2010-06-19 13:21:19 -04:00
Mike Bayer 7009a3bc32 - func.sysdate() emits "SYSDATE()", i.e. with the ending
parenthesis, on MySQL.  [ticket:1794]
2010-05-08 15:29:08 -04:00
Mike Bayer 7535e19fec - No longer guessing that TINYINT(1) should be BOOLEAN
when reflecting - TINYINT(1) is returned.  Use Boolean/
BOOLEAN in table definition to get boolean conversion
behavior.  [ticket:1752]
2010-03-27 17:27:28 -04:00
Michael Trier 824e42b1e6 Match tests have been completely wrong. 2010-02-26 08:50:04 +00:00
Mike Bayer 0f4770775f - Added reflection/create table support for a wide range
of MySQL keywords.  [ticket:1634]
2010-02-23 20:50:19 +00:00
Mike Bayer 4460f998e3 - Composite PK table on InnoDB where the "autoincrement" column
isn't first will emit an explicit "KEY" phrase within
CREATE TABLE thereby avoiding errors, [ticket:1496]
2010-02-22 19:28:25 +00:00
Mike Bayer 95096847d8 get tests to pass for OurSQL 2010-02-15 23:59:42 +00:00
Mike Bayer 6a935a0e27 - Further fixes for the mysql-connector dialect. [ticket:1668] 2010-02-14 20:24:15 +00:00
Jason Kirtland bef9e234de Fix mysql reflection of TINYINT(1) UNSIGNED columns. 2010-02-10 18:32:56 +00:00
Mike Bayer 10b14a6c5c - Fixed reflection bug whereby when COLLATE was present,
nullable flag and server defaults would not be reflected.
[ticket:1655]
2010-02-10 05:46:03 +00:00
Mike Bayer fc92d14bbe - types.Binary is renamed to types.LargeBinary, it only
produces BLOB, BYTEA, or a similar "long binary" type.
New base BINARY and VARBINARY
types have been added to access these MySQL/MS-SQL specific
types in an agnostic way [ticket:1664].
2010-01-23 19:44:06 +00:00