Commit Graph

512 Commits

Author SHA1 Message Date
Mike Bayer cb19f227f3 The :meth:.ColumnOperators.in_ operator will now coerce
values of ``None`` to :func:`.null`.
[ticket:2496]
2013-02-02 16:17:58 -05:00
Audrius Kažukauskas dbdf4f25e2 Add ANY/ALL construct support for PostgreSQL's ARRAY type 2013-01-28 19:58:06 +02:00
Mike Bayer b1a01a6256 - replace mssql_ordering with generalized #695 solution
- documentation for mssql index options plus changelog and fixes
2013-01-20 12:43:39 -05:00
Mike Bayer bc75bbd62d Merged in dharland/sqlalchemy (pull request #35)
Add extra mssql dialect options to Index
2013-01-20 12:23:39 -05:00
Mike Bayer 2244c3febe - "postgres_where" has been removed 2013-01-16 23:53:00 -05:00
Derek Harland f5a5a6bf43 Add mssql_include option for mssql dialect 2013-01-14 17:03:38 +13:00
Derek Harland 38f7650072 Add mssql_ordering option for mssql dialect 2013-01-14 17:02:20 +13:00
Derek Harland 7198abb13e Add mssql_clustered option for mssql dialect 2013-01-14 17:00:37 +13:00
Mike Bayer 46a9209cde Added a py3K conditional around unnecessary .decode()
call in mssql information schema, fixes reflection
in Py3K. Also in 0.7.10. [ticket:2638]
2013-01-12 19:51:13 -05:00
Mike Bayer 56b1f4c884 - changelog for pullreq 32
- Fixed a regression whereby the "collation" parameter
of the character types CHAR, NCHAR, etc. stopped working,
as "collation" is now supported by the base string types.
The TEXT, NCHAR, CHAR, VARCHAR types within the
MSSQL dialect are now synonyms for the base types.
- move out the type rendering tests into DB-agnostic tests
and remove some of the old "create" statements.  tests here
are still very disorganized.
2013-01-12 12:14:15 -05:00
Mike Bayer 17c300eb07 Merged in dharland/sqlalchemy (pull request #32: Allow the MSSQL dialect to support identity columns that are not part of the primary key) 2013-01-12 11:43:36 -05:00
Mike Bayer a94f2f81af Fixed bug in :func:.postgresql.array construct whereby using it
inside of an :func:`.expression.insert` construct would produce an
error regarding a parameter issue in the ``self_group()`` method.
2013-01-02 11:26:37 -05:00
Mike Bayer 850e881ce2 More adjustment to this SQLite related issue which was released in
0.7.9, to intercept legacy SQLite quoting characters when reflecting
foreign keys.  In addition to intercepting double quotes, other
quoting characters such as brackets, backticks, and single quotes
are now also intercepted. [ticket:2568]
2012-12-14 10:29:46 -05:00
Mike Bayer d9d6dcea77 add future 2012-12-11 10:34:33 -05:00
Mike Bayer 70d38af42e Fixed table reflection for Oracle when accessing a synonym that refers
to a DBLINK remote database; while the syntax has been present in the
Oracle dialect for some time, up until now it has never been tested.
The syntax has been tested against a sample database linking to itself,
however there's still some uncertainty as to what should be used for the
"owner" when querying the remote database for table information.
Currently, the value of "username" from user_db_links is used to
match the "owner".  [ticket:2619]
2012-12-09 18:28:08 -05:00
Mike Bayer 927b985983 - multivalued inserts, [ticket:2623]
- update "not supported" messages for empty inserts, mutlivalue inserts

- rework the ValuesBase approach for multiple value sets so that stmt.parameters
does store a list for multiple values; the _has_multiple_parameters flag now indicates
which of the two modes the statement is within.  it now raises exceptions if a subsequent
call to values() attempts to call a ValuesBase with one mode in the style of the other
mode; that is, you can't switch a single- or multi- valued ValuesBase to the other mode,
and also if a multiple value is passed simultaneously with a kwargs set.
Added tests for these error conditions

- Calling values() multiple times in multivalue mode now extends the parameter list to
include the new parameter sets.

- add error/test if multiple *args were passed to ValuesBase.values()

- rework the compiler approach for multivalue inserts, back to where
_get_colparams() returns the same list of (column, value) as before, thereby
maintaining the identical number of append() and other calls when multivalue
is not enabled.  In the case of multivalue, it makes a last-minute switch to return
a list of lists instead of the single list.  As it constructs the additional lists, the inline
defaults and other calculated default parameters of the first parameter
set are copied into the newly generated lists so that these features continue
to function for a multivalue insert.   Multivalue inserts now add no additional
function calls to the compilation for regular insert constructs.

- parameter lists for multivalue inserts now includes an integer index for all
parameter sets.

- add detailed documentation for ValuesBase.values(), including careful wording
to describe the difference between multiple values and an executemany() call.

- add a test for multivalue insert + returning - it works !

- remove the very old/never used "postgresql_returning"/"firebird_returning" flags.
2012-12-08 14:25:42 -05:00
Mike Bayer 9d817406e2 The Oracle LONG type, while an unbounded text type, does not appear
to use the cx_Oracle.LOB type when result rows are returned,
so the dialect has been repaired to exclude LONG from
having cx_Oracle.LOB filtering applied.  Also in 0.7.10.
[ticket:2620]
2012-12-06 19:30:49 -05:00
Mike Bayer af1a545bdd Repaired the usage of `.prepare()` in conjunction with
cx_Oracle so that a return value of ``False`` will result
in no call to ``connection.commit()``, hence avoiding
"no transaction" errors.   Two-phase transactions have
now been shown to work in a rudimental fashion with
SQLAlchemy and cx_oracle, however are subject to caveats
observed with the driver; check the documentation
for details.  Also in 0.7.10.
[ticket:2611]
2012-12-06 19:10:06 -05:00
Derek Harland 72b1f475af Add several MSSQL dialect tests for sequence declarations 2012-12-04 14:49:03 +13:00
Audrius Kažukauskas 64505dcd28 HSTORE.comparator_factory should subclass Concatenable.Comparator 2012-11-21 00:26:20 +02:00
Audrius Kažukauskas 8134f2d0bf Add special containment operation methods for PG array type 2012-11-20 23:24:34 +02:00
Mike Bayer d1adef463a another hide from 2to3 test 2012-11-18 13:34:25 -05:00
Mike Bayer 1e29a74bd6 Fixed a gotcha where inadvertently calling list() on a
:class:`.ColumnElement` would go into an endless loop, if
      :meth:`.ColumnOperators.__getitem__` were implemented.
      A new NotImplementedError is emitted via ``__iter__()``.
2012-11-18 10:38:02 -05:00
Mike Bayer cda08307be - hstore documentation, migration
- don't need a custom exception here, just use ValueError
2012-11-17 22:58:23 -05:00
Mike Bayer 4356741c48 - hstore adjustments 2012-11-17 20:45:17 -05:00
Audrius Kažukauskas 812b1d8614 Add PostgreSQL HStore type support 2012-11-13 16:43:41 +02:00
Mike Bayer 6397a4ff4b Fixed bug in type_coerce() whereby typing information
could be lost if the statement were used as a subquery
inside of another statement, as well as other similar
situations.  Among other things, would cause
typing information to be lost when the Oracle/mssql dialects
would apply limit/offset wrappings. [ticket:2603]
2012-11-12 15:48:40 -05:00
Mike Bayer 017989ce8b - move out maxdb
- 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.
2012-10-18 18:24:15 -04:00
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 fab9be5d0e - [feature] the MS Access dialect has been
moved to its own project on Bitbucket,
    taking advantage of the new SQLAlchemy
    dialect compliance suite.   The dialect is
    still in very rough shape and probably not
    ready for general use yet, however
    it does have *extremely* rudimental
    functionality now.
2012-09-30 20:17:49 -04:00
Mike Bayer e35a6b91d6 - [bug] Fixed compiler bug whereby using a correlated
subquery within an ORDER BY would fail to render correctly
    if the stament also used LIMIT/OFFSET, due to mis-rendering
    within the ROW_NUMBER() OVER clause.  Fix courtesy
    sayap [ticket:2538]
2012-09-30 16:57:23 -04:00
Mike Bayer bba1d01b26 - [bug] The CreateIndex construct in Oracle
will now schema-qualify the name of the index
    to be that of the parent table.  Previously this
    name was omitted which apparently creates the
    index in the default schema, rather than that
    of the table.
2012-09-30 20:00:46 +00: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 bd48c8a9ec pg and oracle fixes 2012-09-30 01:02:56 -04:00
Mike Bayer 00e29c4cc6 - enhance setup.py to support being run from outside the current directory. hopefully there's no
gotchas with this on other platforms.
2012-09-29 13:08:07 -04:00
Mike Bayer be40b51cb0 getting everything to pass again 2012-09-27 16:33:54 -04:00
Mike Bayer b9ea55f861 - more tests, move some tests out of test_reflection, test_query 2012-09-27 16:11:32 -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 0c7b989ce5 - [feature] Added support for the localtimestamp()
SQL function implemented in SQLite, courtesy
Richard Mitchell.  Added test
2012-09-26 10:20:56 -04:00
Mike Bayer e1d09859c5 - [bug] Columns in reflected primary key constraint
are now returned in the order in which the constraint
    itself defines them, rather than how the table
    orders them.  Courtesy Gunnlaugur Por Briem.
    [ticket:2531].
2012-09-23 13:42:24 -04:00
Mike Bayer c7ab095fdb - [bug] Adjusted column default reflection code to
convert non-string values to string, to accommodate
old SQLite versions that don't deliver
default info as a string.  [ticket:2265]
- factor sqlite column reflection to be like we did for postgresql,
in a separate method.
2012-09-23 11:30:07 -04:00
Mike Bayer 62b2955c7a test fixes 2012-09-22 13:37:39 -04:00
Mike Bayer 9e3458c479 - [bug] Adjusted a very old bugfix which attempted
to work around a SQLite issue that itself was
    "fixed" as of sqlite 3.6.14, regarding quotes
    surrounding a table name when using
    the "foreign_key_list" pragma.  The fix has been
    adjusted to not interfere with quotes that
    are *actually in the name* of a column or table,
    to as much a degree as possible; sqlite still
    doesn't return the correct result for foreign_key_list()
    if the target table actually has quotes surrounding
    its name, as *part* of its name (i.e. """mytable""").
    [ticket:2568]
2012-09-19 00:34:30 -04:00
Mike Bayer 6a3e993490 - genericize the test for ischema_names
- some fixes to the patch to handle empty args, whitespace
- changelog clarifies where this API fits at the moment
2012-09-16 17:43:21 -04:00
Éric Lemoine 3a1cc85b20 breaking up PGDialect.get_columns, and add PostGIS column reflection tests 2012-09-12 08:55:10 +02:00
Mike Bayer f2622c0c53 - [bug] CompileError is raised when VARCHAR with
no length is attempted to be emitted, same
way as MySQL. [ticket:2505]
2012-09-10 17:02:31 -04:00
Mike Bayer d3e60f805d - [feature] The types of columns excluded from the
setinputsizes() set can be customized by sending
    a list of string DBAPI type names to exclude.
   This list was previously fixed.  The list also
    now defaults to STRING, UNICODE, removing
    CLOB, NCLOB from the list.  [ticket:2469]
2012-09-05 18:11:33 -04:00
Mike Bayer 48f5c2e4f7 - further mxodbc tweaks affecting other test suites 2012-09-02 16:17:10 -04:00
Hong Minhee 4acf7df4f5 Add a version test for EnterpriseDB 2012-08-31 07:49:01 +09:00