Commit Graph

69 Commits

Author SHA1 Message Date
Jason Kirtland bf36c648f2 Reworked r4042- undeclared deprecation warnings are now *fatal* to tests. No surprises. 2008-01-10 02:37:39 +00:00
Jason Kirtland f44a7f6ae9 correction... 2007-12-14 10:30:14 +00:00
Mike Bayer 1694e33838 try to bang mysql tests to work 2007-12-14 06:29:31 +00:00
Jason Kirtland 8128a6378a - Removed @testing.supported. Dialects in development or maintained outside
the tree can now run the full suite of tests out of the box.
- Migrated most @supported to @fails_on, @fails_on_everything_but, or (last
  resort) @unsupported.  @fails_on revealed a slew of bogus test skippage,
  which was corrected.
- Added @fails_on_everything_but.  Yes, the first usage *was*
  "fails_on_everything_but('postgres')".  How did you guess!
- Migrated @supported in dialect/* to the new test-class attribute __only_on__.
- Test classes can also have __unsupported_on__ and __excluded_on__.
2007-12-13 09:59:14 +00:00
Lele Gaifax 2522534311 Disabled some tests with INTERSECT, not handled by Firebird 2007-12-12 23:06:22 +00:00
Mike Bayer 7bf90e2f4d fix to unique bind params, you *can* use the same unique bindparam multiple times
in a statement.  the collision check is strictly detecting non-unique's that happen to have
the same name.
2007-12-07 16:47:00 +00:00
Mike Bayer 541b6772e9 - generation of "unique" bind parameters has been simplified to use the same
"unique identifier" mechanisms as everything else.  This doesn't affect
user code, except any code that might have been hardcoded against the generated
names.  Generated bind params now have the form "<paramname>_<num>",
whereas before only the second bind of the same name would have this form.

- bindparam() objects themselves can be used as keys for execute(), i.e.
statement.execute({bind1:'foo', bind2:'bar'})
2007-12-06 22:23:10 +00:00
Mike Bayer 238c2c8dbe - basic framework for generic functions, [ticket:615]
- changed the various "literal" generation functions to use an anonymous
bind parameter.  not much changes here except their labels now look
like ":param_1", ":param_2" instead of ":literal"
- from_obj keyword argument to select() can be a scalar or a list.
2007-12-05 03:07:21 +00:00
Mike Bayer 3f6e94e818 - column labels in the form "tablename.columname", i.e. with a dot, are now
supported.
2007-11-27 16:57:56 +00:00
Mike Bayer 65abc78010 added a test to validate ResultProxy truncation behavior 2007-11-27 16:13:45 +00:00
Mike Bayer 7a25be0f42 - identified some cases where Alias needs to be cloned; but still cant clone
when its an alias of a Table; added some test coverage for one particular
case from the doctests
- fixed "having" example in doctests, updated eager load example
2007-11-08 00:26:23 +00:00
Jason Kirtland bcb586a93c Migrated maxdb behavioral assumptions from unsupported to fails_on 2007-11-05 22:11:30 +00:00
Mike Bayer 66cd772094 - merged factor_down_bindparams branch.
- removed ClauseParameters object; compiled.params returns a regular dictionary
  now, as well as result.last_inserted_params()/last_updated_params().
- various code trimming, method removals.
2007-11-01 03:58:21 +00:00
Jason Kirtland 6378c34799 - Added initial version of MaxDB dialect.
- All optional test Sequences are now optional=True
2007-10-23 07:38:07 +00:00
Ants Aasma 6bbc7dd157 change the in_ API to accept a sequence or a selectable [ticket:750] 2007-10-16 22:57:05 +00:00
Mike Bayer 9b22fc0a9b - Fixed SQL compiler's awareness of top-level column labels as used
in result-set processing; nested selects which contain the same column
  names don't affect the result or conflict with result-column metadata.

- query.get() and related functions (like many-to-one lazyloading)
  use compile-time-aliased bind parameter names, to prevent
  name conflicts with bind parameters that already exist in the
  mapped selectable.
2007-10-16 16:03:59 +00:00
Jason Kirtland 9226871456 Fixed a couple of typos & hardened against future similar errors. 2007-10-16 01:17:39 +00:00
Jason Kirtland 833503ed23 More ORDER BY, now with use_labels. 2007-10-12 18:08:11 +00:00
Jason Kirtland df929d364d - Added small DESC exercise to test_order_by. 2007-10-12 17:46:42 +00:00
Jason Kirtland d174b3bd72 Added query coverage for ORDER BY over regular, aliased and DISTINCT columns. 2007-10-11 22:21:33 +00:00
Jason Kirtland 14563004a4 - Expanded JoinTest further, exercising joins the ORM depends on explicitly
in the 'sql' tests.
2007-10-10 20:42:58 +00:00
Mike Bayer ddf875dd0c - initial sybase support checkin, [ticket:785] 2007-10-10 15:19:28 +00:00
Jason Kirtland 2b084b76c0 - Expanded the outer join tests, now covering a situation that looked like it would be wonky in oracle. 2007-10-08 03:31:52 +00:00
Jason Kirtland afa713d9e8 - Loosened up test_cant_execute_join for oracle (probably) + bonus typo fix
- Some docstring formatting waiting for pg to finish the tests...  waiting...
2007-10-08 03:01:04 +00:00
Jason Kirtland 849743acac - Added some outerjoin() execution exercises to the query tests. 2007-10-08 02:17:07 +00:00
Jason Kirtland 585b425850 - Squashed assumption of transparent type coercion support in defaults test 2007-10-07 21:57:42 +00:00
Jason Kirtland a014d289f6 - Tweaked unordered select tests to not be sensitive to result set order, also split apart some tests (aliases) that sapdb has problems with. 2007-10-07 02:01:49 +00:00
Roger Demetrescu 11c70f9d8d Firebird dialect now uses SingletonThreadPool as its poolclass.
(this fixes all "unsuccessful metadata update\n  object XXXXX is in use" test errors)

Minor fixes in tests
2007-10-07 00:06:05 +00:00
Mike Bayer f67fcd1822 - move PG RETURNING tests to postgres dialect test
- added server_version_info() support for PG dialect
- exclude PG versions < 8.4 for RETURNING tests
2007-10-04 03:19:38 +00:00
Ants Aasma e82ca71cc5 add support for returning results from inserts and updates for postgresql 8.2+. [ticket:797] 2007-10-02 23:57:54 +00:00
Mike Bayer 3e672bbfc8 - created a link between QueryContext and SelectionContext; the attribute
dictionary of QueryContext is now passed to SelectionContext inside
of Query.instances(), allowing messages to be passed between the two stages.
- removed the recent "exact match" behavior of Alias objects, they're back to
their usual behavior.
- tightened up the relationship between the Query's generation
  of "eager load" aliases, and Query.instances() which actually grabs the
  eagerly loaded rows.  If the aliases were not specifically generated for
  that statement by EagerLoader, the EagerLoader will not take effect
  when the rows are fetched.  This prevents columns from being grabbed accidentally
  as being part of an eager load when they were not meant for such, which can happen
  with textual SQL as well as some inheritance situations.  It's particularly important
  since the "anonymous aliasing" of columns uses simple integer counts now to generate
  labels.
2007-09-26 17:08:19 +00:00
Mike Bayer a0838e0c47 - columns from Alias objects, when used to target result-row columns, must match exactly
to the label used in the generated statement.  This is so searching for columns in a
  result row which match aliases won't accidentally match non-aliased columns.
  fixes errors which can arise in eager loading scenarios.
2007-09-24 19:27:52 +00:00
Mike Bayer 3126d464e7 - removed "parameters" argument from clauseelement.compile(), replaced with
"column_keys".  the parameters sent to execute() only interact with the
  insert/update statement compilation process in terms of the column names
  present but not the values for those columns.
  produces more consistent execute/executemany behavior, simplifies things a
  bit internally.
2007-09-04 00:08:57 +00:00
Jason Kirtland 6228e72cb1 - omitted 'table' and 'column' from 'from sqlalchemy import *'
- also omitted all modules and classes that aren't expicitly public
- omitted 'Smallinteger' (small i), but it's still in schema
- omitted NullType-related items from types.__all__
- patched up a few tests to use sql.table and sql.column, other related.
2007-08-21 01:31:23 +00:00
Ants Aasma be16b15f2c an early out processing insert/update column parameters was a bit too early. 2007-08-19 23:01:44 +00:00
Mike Bayer 7c6c1b99c2 1. Module layout. sql.py and related move into a package called "sql".
2. compiler names changed to be less verbose, unused classes removed.
3. Methods on Dialect which return compilers, schema generators, identifier preparers
have changed to direct class references, typically on the Dialect class itself
or optionally as attributes on an individual Dialect instance if conditional behavior is needed.
This takes away the need for Dialect subclasses to know how to instantiate these
objects, and also reduces method overhead by one call for each one.
4. as a result of 3., some internal signatures have changed for things like compiler() (now statement_compiler()), preparer(), etc., mostly in that the dialect needs to be passed explicitly as the first argument (since they are just class references now).  The compiler() method on Engine and Connection is now also named statement_compiler(), but as before does not take the dialect as an argument.

5. changed _process_row function on RowProxy to be a class reference, cuts out 50K method calls from insertspeed.py
2007-08-18 21:37:48 +00:00
Jason Kirtland ce0d72e68a Allow '$' in bind param detection [ticket:719], added test suite & fixed an edge case 2007-08-09 22:10:16 +00:00
Mike Bayer ed4fc64bb0 merging 0.4 branch to trunk. see CHANGES for details. 0.3 moves to maintenance branch in branches/rel_0_3. 2007-07-27 04:08:53 +00:00
Paul Johnston a966505992 Properly escape table names when reflecting for mssql and sqlite [ticket:653] 2007-07-17 20:13:36 +00:00
Mike Bayer 8cb8daaafe - fixed "ambiguous column" result detection, when dupe col names exist
in a result [ticket:657]
2007-07-15 15:40:09 +00:00
Jason Kirtland 177d30cc01 - Deprecated DynamicMetaData- use ThreadLocalMetaData or MetaData instead
- Deprecated BoundMetaData- use MetaData instead
- Removed DMD and BMD from documentation
2007-07-06 00:58:09 +00:00
Mike Bayer 3f3d84e754 postgres:
- added support for reflection of domains [ticket:570]
    - types which are missing during reflection resolve to Null type
      instead of raising an error
    - moved reflection/types/query unit tests specific to postgres to new
      postgres unittest module
2007-06-29 23:50:25 +00:00
Ants Aasma 51c0d90c8d add missing grouping for compound selects. fixes ticket #623 2007-06-26 18:00:57 +00:00
Ants Aasma b191254d8a fix #624, modulo operator escaping on mysql and postgres
someone should test this with oracle, firebird and sql server also
2007-06-26 16:37:30 +00:00
Mike Bayer bc58df9c1f - fixed precedence of operators so that parenthesis are correctly applied
[ticket:620]
- calling <column>.in_() (i.e. with no arguments) will return
"CASE WHEN (<column> IS NULL) THEN NULL ELSE 0 END = 1)", so that
NULL or False is returned in all cases, rather than throwing an error
[ticket:545]
2007-06-25 17:07:25 +00:00
Mike Bayer 909758df8e - result.last_inserted_ids() should return a list that is identically
sized to the primary key constraint of the table.  values that were
"passively" created and not available via cursor.lastrowid will be None.
- sqlite: string PK column inserts dont get overwritten with OID [ticket:603]
2007-06-17 00:49:08 +00:00
Paul Johnston 2c65ce7536 Multiple MSSQL fixes; see ticket #581 2007-06-13 18:53:16 +00:00
Mike Bayer ae4b954b1a - parenthesis are applied to clauses via a new _Grouping construct.
uses operator precedence to more intelligently apply parenthesis
to clauses, provides cleaner nesting of clauses (doesnt mutate
clauses placed in other clauses, i.e. no 'parens' flag)
- added 'modifier' keyword, works like func.<foo> except does not
add parenthesis.  e.g. select([modifier.DISTINCT(...)]) etc.
2007-05-14 22:25:36 +00:00
Rick Morrison 22278d02b9 - mssql: replace "select @@identity" with "select @@scope_identity". Should help avoid returning wrong ID when insert triggers are used. Also add unit test (thanks paj)
- mssql: if no db-api module specified, probe in the order [pyodbc, pymssql, adodbapi]
2007-04-29 20:00:43 +00:00
Jason Kirtland 6a30f0ee37 - Fully specify ordering for ordered union test comparison 2007-04-27 00:29:23 +00:00