Commit Graph

1194 Commits

Author SHA1 Message Date
Mike Bayer b27ddac20a - fix to anonymous label generation of long table/column names [ticket:806] 2007-10-07 01:58:40 +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 29291f4c32 - oracle does not implicitly convert to unicode for non-typed result
sets (i.e. when no TypeEngine/String/Unicode type is even being used;
  previously it was detecting DBAPI types and converting regardless).
  should fix [ticket:800]
- fixed oracle out_parameters, likely broke in beta6
- fixed oracle _normalize_case for encoded names, gets unicode reflection test to work
- a few extra tests tweaked/unsupported for oracle
2007-10-06 16:12:58 +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
Jason Kirtland 73b0c40946 - Tweaked the sql.text date test 2007-10-02 20:58:58 +00:00
Jason Kirtland 1880e6d8c3 - Unraveled DateTest, removed bogus coverage omission for MySQL TIME types 2007-10-02 20:51:17 +00:00
Jason Kirtland 3a04b7e4d4 Avoid tickling the MySQL-python 1.2.2 executemany parsing bug on a couple tests. 2007-09-26 23:35:14 +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 e37a3a961c - the behavior of String/Unicode types regarding that they auto-convert
to TEXT/CLOB when no length is present now occurs *only* for an exact type
  of String or Unicode with no arguments.  If you use VARCHAR or NCHAR
  (subclasses of String/Unicode) with no length, they will be interpreted
  by the dialect as VARCHAR/NCHAR; no "magic" conversion happens there.
  This is less surprising behavior and in particular this helps Oracle keep
  string-based bind parameters as VARCHARs and not CLOBs [ticket:793].
2007-09-26 14:55:44 +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 8c14291b6d - adjusted operator precedence of NOT to match '==' and others, so that
~(x <operator> y) produces NOT (x <op> y), which is better compatible with MySQL.
   [ticket:764].  this doesn't apply to "~(x==y)" as it does in 0.3 since ~(x==y)
   compiles to "x != y", but still applies to operators like BETWEEN.
2007-09-08 20:28:26 +00:00
Mike Bayer 5ba8a25afe added assertion case for [ticket:764] 2007-09-08 20:13:54 +00:00
Mike Bayer 0ebccb4abd [ticket:768] dont assume join criterion consists only of column objects 2007-09-08 20:08:41 +00:00
Mike Bayer 986e82700e - column defaults and onupdates, executing inline, will add parenthesis
for subqueries and other parenthesis-requiring expressions
2007-09-06 16:37:37 +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
Mike Bayer 8386fc6dc5 sequence pre-executes dont create an ExecutionContext, use straight cursor 2007-09-01 22:42:51 +00:00
Mike Bayer 5df1759e15 - got all examples working
- inline default execution occurs for *all* non-PK columns
unconditionally - preexecute only for non-executemany PK cols on
PG, Oracle, etc.
- new default docs
2007-09-01 21:21:29 +00:00
Mike Bayer 69f7084c9b - merged inline inserts branch
- all executemany() style calls put all sequences and SQL defaults inline into a single SQL statement
and don't do any pre-execution
- regular Insert and Update objects can have inline=True, forcing all executions to be inlined.
- no last_inserted_ids(), lastrow_has_defaults() available with inline execution
- calculation of pre/post execute pushed into compiler; DefaultExecutionContext greatly simplified
- fixed postgres reflection of primary key columns with no sequence/default generator, sets autoincrement=False
- fixed postgres executemany() behavior regarding sequences present, not present, passivedefaults, etc.
- all tests pass for sqlite, mysql, postgres; oracle tests pass as well as they did previously including all
insert/update/default functionality
2007-09-01 19:49:26 +00:00
Jason Kirtland ea44deff14 Adjusted ColumnDefault default function fitness check to only insure that a given function had no more than one non-defaulted positional arg. 2007-08-22 15:15:52 +00:00
Jason Kirtland fba14f6047 from foo import (name, name) isn't valid syntax for 2.3. ah well.
omitting modules from sqlalchemy.__all__...
2007-08-21 22:20:52 +00:00
Mike Bayer 72efa9db3a fixed generative behavior to copy collections, [ticket:752] 2007-08-21 20:43:54 +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
Mike Bayer 109d535961 - method call removal 2007-08-20 21:50:59 +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
Paul Johnston 1b1da969eb mssql unit test fixes 2007-08-19 15:30:02 +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
Mike Bayer 820346549b - modified SQL operator functions to be module-level operators, allowing
SQL expressions to be pickleable [ticket:735]

- small adjustment to mapper class.__init__ to allow for Py2.6 object.__init__()
  behavior
2007-08-18 01:00:44 +00:00
Mike Bayer 74595d900c - Added a "legacy" adapter to types, such that user-defined TypeEngine
and TypeDecorator classes which define convert_bind_param()/convert_result_value()
  will continue to function.  Also supports calling the super() version of
  those methods.
2007-08-17 23:45:29 +00:00
Mike Bayer 13af7230dc - fix to bind param processing such that "False" values (like blank strings)
still get processed/encoded
2007-08-16 18:25:11 +00:00
Mike Bayer dd99a207d6 added support for string date passthru in sqlite 2007-08-16 14:48:48 +00:00
Mike Bayer e02a48ed24 mass has_key->__contains__ migration, [ticket:738] 2007-08-15 17:28:52 +00:00
Mike Bayer 2708a3489e - moved unicode schema ORM tests to unitofwork.py tests. mostly
is to test mappers so limited DB support (really hard to get these unicode schemas
to work...)
- fixed [ticket:739]
2007-08-15 16:48:57 +00:00
Mike Bayer 087f235c33 - merged "fasttypes" branch. this branch changes the signature
of convert_bind_param() and convert_result_value() to callable-returning
bind_processor() and result_processor() methods.  if no callable is
returned, no pre/post processing function is called.
- hooks added throughout base/sql/defaults to optimize the calling
of bind param/result processors so that method call overhead is minimized.
special cases added for executemany() scenarios such that unneeded "last row id"
logic doesn't kick in, parameters aren't excessively traversed.
- new performance tests show a combined mass-insert/mass-select test as having 68%
fewer function calls than the same test run against 0.3.
- general performance improvement of result set iteration is around 10-20%.
2007-08-14 21:53:32 +00:00
Mike Bayer a7a837489d commented out unicode foriegn keys for now, not working on mysql or postgres 2007-08-14 04:17:44 +00:00
Mike Bayer 6614209895 - generalized a SQLCompileTest out of select.py, installed
into dialect/mssql.py, dialect/oracle.py, sql/generative.py
- fixed oracle issues [ticket:732], [ticket:733], [ticket:734]
2007-08-13 20:00:38 +00:00
Jason Kirtland 58f8db9955 Added more unicode foreign key tests for [ticket:729] 2007-08-12 23:43:49 +00:00
Mike Bayer e8793a5b59 - case_sensitive=(True|False) setting removed from schema items, since
checking this state added a lot of method call overhead and there was
    no decent reason to ever set it to False.  Table and column names which are
    all lower case will be treated as case-insenstive (yes we adjust for
    Oracle's UPPERCASE style too).
2007-08-11 14:03:23 +00:00
Mike Bayer b852fcbce0 - oracle reflection of case-sensitive names all fixed up
- other unit tests corrected for oracle
2007-08-10 23:24:06 +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 578efcfeb3 - decoupled all ColumnElements from also being Selectables. this means
that anything which is a column expression does not have a "c" or a
"columns" attribute.  Also works for select().as_scalar(); _ScalarSelect
is a columnelement, so you can't say select().as_scalar().c.foo, which is
a pretty confusing mistake to make.  in the case of _ScalarSelect made
an explicit raise if you try to access 'c'.
2007-08-09 21:50:23 +00:00
Jason Kirtland 72b02cc093 Added 'unformat_identifiers', produces a list of unquoted identifiers from an identifier or a fully qualified identifier string. 2007-08-09 21:01:50 +00:00
Mike Bayer c7ee47e545 - migrated 'desc', 'asc', and 'distinct' to be in the Operators framework
- fixes to operator() method signature/calling
2007-08-07 17:12:35 +00:00
Mike Bayer 8446b80533 - added desc() and asc() directly to CompareMixin 2007-08-06 21:52:24 +00:00
Mike Bayer 2dde45881b - docs
- added some convenience functions to selects, clauseelements
- fixed distinct()
2007-08-06 21:32:37 +00:00
Mike Bayer 68fd1be8d2 - edits
- added "params" to ansisql compiler
2007-08-06 01:51:54 +00:00
Mike Bayer b73b14f070 - draft sqlexpression tutorial
- added some generative methods to exists()
- got clause adapter to work with join()
2007-08-06 00:59:09 +00:00
Jason Kirtland 4cee19e8f0 Revert r3169 and r3148 changes to unicode schema reflection test, will add an explicit engine/reflection test to cover. 2007-08-04 19:34:30 +00:00
Jason Kirtland 65f9550a0a Update for osx 2007-08-04 16:55:08 +00:00
Jason Kirtland 4b0c6aff01 Rearranged engine initialization, its now easy to make ad-hoc testing engines that preserve all of the --options requested
Promoted the 'utf8 bind' logic for tests needing utf8 connections into testlib
Added a pause before issuing DROPs to rid the testing db of clutter
2007-08-03 20:08:26 +00:00