Commit Graph

124 Commits

Author SHA1 Message Date
Mike Bayer e94baeaacd some comparison fixes 2007-06-28 18:25:39 +00:00
Ants Aasma 8b89aa795c merge compound select grouping patch from trunk (ticket #623) 2007-06-26 18:31:57 +00:00
Ants Aasma c533030643 merge from trunk #624 fix, modulo operator escaping 2007-06-26 16:38:16 +00:00
Ants Aasma 73b76e57ac merged between precedence from trunk ([2785]) 2007-06-25 19:20:53 +00:00
Mike Bayer 9225b3dee9 merged operator precedence fixes/tests IN fixes/tests from trunk r2782-r2783 2007-06-25 17:22:14 +00:00
Mike Bayer 0e209828b5 moved "clone" conditional blocks into separate copy_internals() method; was a
conflation of tasks having them in the same place like that.
2007-06-25 03:14:01 +00:00
Mike Bayer 11b0fdc1b6 merged trunk r2755-r2778 2007-06-24 20:09:54 +00:00
Mike Bayer 13ac46eb3f - merge of generative_sql branch
- copy_container() removed.  ClauseVisitor.traverse() now features "clone"
flag which allows traversal with copy-and-modify-in-place behavior
- select() objects copyable now [ticket:52] [ticket:569]
- improved support for custom column_property() attributes which
  feature correlated subqueries...work better with eager loading now.
- accept_visitor()  methods removed.  ClauseVisitor now genererates method
names based on class names, or an optional __visit_name__ attribute.  calls
regular visit_XXX methods as they exist, can optionally call an additional
"pre-descent" enter_XXX method to allow stack-based operations on traversals
- select() and union()'s now have "generative" behavior.  methods like
order_by() and group_by() return a *new* instance - the original instance
is left unchanged.  non-generative methods remain as well.
- the internals of select/union vastly simplified - all decision making
regarding "is subquery" and "correlation" pushed to SQL generation phase.
select() elements are now *never* mutated by their enclosing containers
or by any dialect's compilation process
2007-06-24 19:58:41 +00:00
Mike Bayer a0f01fc86c - merged trunk r2730-r2755
- removed "clear_mapper()" method
2007-06-20 22:53:03 +00:00
Mike Bayer 37762aad5c - merged last_inserted_ids() fix from trunk [changeset:2743] 2007-06-17 00:57:06 +00:00
Jason Kirtland 5b779d30c3 - Added testbase.Table and testbase.Column, interceptors that can set up
test-run- and dialect-specific options on those objects
  All tests re-pointed to go through the interceptors
- Removed mysql_engine= from table declarations, replaced with a general
  flag indicating storage requirements
- Added ability to choose a global MySQL storage engine for all tests
  --mysql-engine=<whatever>
  If none is specified, tests use the old db-default/InnoDB behavior
- Added ability to append arbitrary table creation params
  --table-option=KEY=VALUE
  For MySQL 3, use this to set mysql_type instead of --mysql-engine
- Removed a couple dead test modules
2007-06-15 22:35:53 +00:00
Mike Bayer 4b3af119f7 - added "explcit" create/drop/execute support for sequences
(i.e. you can pass a "connectable" to each of those methods
on Sequence)
- checkfirst flag propigates for sequence creates/drops
2007-06-15 16:51:25 +00:00
Mike Bayer 47c3ce38aa - merged trunk 2629-2730
- fixes to is_select() which is now an important method
- mysql unit tests fixes
2007-06-14 18:37:20 +00:00
Mike Bayer 6b293a78d3 - MetaData loses 'name' attribute
- no more global_connect()
2007-06-11 19:48:36 +00:00
Mike Bayer ce2d1c7159 added separate test for metadata
some cleanup to query.py unit test
added settable "engine" property on MetaData
2007-06-11 19:31:19 +00:00
Mike Bayer 5430c7177a - fixed bug where selectable.corresponding_column(selectable.c.col)
would not return selectable.c.col, if the selectable is a join
of a table and another join involving the same table.  messed
up ORM decision making [ticket:593]
- removed is_natural_case function from ANSIIdentifierPreparer
2007-06-06 23:39:25 +00:00
Mike Bayer 9b61ea39a8 - moved another chunk of mapper.py tests to query.py test suite
- got all tests/extensions working with new APIs
- axed proxyengine until further notice
- SelectResults folds into a 10 line wrapper for Query, loses join_to() (use join())
- test cleanup
2007-06-05 23:12:03 +00:00
Mike Bayer 5c31a8c5e9 - merged trunk r2653
- small orm fixes
2007-05-26 20:10:06 +00:00
Mike Bayer 9102d678ab - removed "no group by's in a select thats part of a UNION"
restriction [ticket:578]
2007-05-18 19:01:47 +00:00
Mike Bayer 1848439d44 restored outerjoin test 2007-05-15 16:51:40 +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
Mike Bayer 3de128138a - _Label propigates "_hide_froms()" so that scalar selects
behave more properly with regards to FROM clause #574
2007-05-11 00:21:29 +00:00
Mike Bayer e23c3a8974 - fix to long name generation when using oid_column as an order by
(oids used heavily in mapper queries)
2007-05-07 20:29:26 +00:00
Mike Bayer 752ef2802c - _Label class overrides compare_self to return its ultimate object.
meaning, if you say someexpr.label('foo') == 5, it produces
the correct "someexpr == 5".
2007-05-03 22:31:52 +00:00
Jason Kirtland d03b5327b7 - MySQL ENUM types can now optionally ensure that values are within the
enum's allowed range on insert and update, with strict=True
- Added new 'dialect' category of unit tests, and migrated MySQL-specific
  dialect tests there.
- Noted the max identifier length in the MySQL dialect (the max alias length,
  actually)
2007-05-02 00:41:52 +00:00
Jason Kirtland 29c20992dc Removed an unneeded and troublesome subquery test. 2007-05-02 00:21:06 +00:00
Mike Bayer a19cec2de3 some notes on a labeling issue that arises when label truncation doesnt match col truncation 2007-05-01 18:11:24 +00:00
Jason Kirtland 546518d75c - allow MySQL column-level CHARACTER SET and COLLATE, plus shortcuts like
ASCII, UNICODE, and BINARY.  support NATIONAL.
- added MySQL-specific reserved words
- added tests for MySQL numeric and string column DDL generation
- various minor cleanups, also tweak regex to not break emacs syntax hilighting
2007-05-01 00:05:47 +00:00
Mike Bayer 8d5a0729ab - the label() method on ColumnElement will properly propigate the
TypeEngine of the base element out to the label, including a label()
created from a scalar=True select() statement.
2007-04-29 21:33:05 +00:00
Mike Bayer 8d2c9ae434 - mysql uses "DESCRIBE [<schemaname>].<tablename>", catching exceptions
if table doesnt exist, in order to determine if a table exists.
this supports unicode table names as well as schema names. tested
with MySQL5 but should work with 4.1 series as well. (#557)
2007-04-29 20:08:55 +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
Mike Bayer 38c6c7ffdf - added a col label to help sqlite with order by 2007-04-24 21:51:40 +00:00
Mike Bayer 49f633b7d1 - fix to case() construct to propigate the type of the first
WHEN condition as the return type of the case statement
- various unit test tweaks to get oracle working
2007-04-24 21:33:07 +00:00
Jason Kirtland 93d212a138 - merged in the combined patch for #474, #475, #476 (attached to #476) and a new set of tests 2007-04-19 19:35:03 +00:00
Mike Bayer 4fffc21c87 - the "where" criterion of an update() and delete() now correlates
embedded select() statements against the table being updated or
deleted.  this works the same as nested select() statement
correlation, and can be disabled via the correlate=False flag on
the embedded select().
2007-04-18 22:54:40 +00:00
Mike Bayer aabb6e530b - the dialects within sqlalchemy.databases become a setuptools
entry points. loading the built-in database dialects works the
same as always, but if none found will fall back to trying
pkg_resources to load an external module [ticket:521]
2007-04-17 20:49:35 +00:00
Mike Bayer 07cd648f3f - got unicode schemas to work with postgres
- unicode schema with mysql slightly improved, still cant do has_table
- got reflection of unicode schemas working with sqlite, pg, mysql
2007-04-15 22:04:53 +00:00
Mike Bayer b9ce8e38c9 - small fix to allow successive compiles of the same SELECT object
which features LIMIT/OFFSET.  oracle dialect needs to modify
the object to have ROW_NUMBER OVER and wasn't performing
the full series of steps on successive compiles.
2007-04-13 22:22:07 +00:00
Mike Bayer aee39b2847 - the "mini" column labels generated when using subqueries, which
are to work around glitchy SQLite behavior that doesnt understand
"foo.id" as equivalent to "id", are now only generated in the case
that those named columns are selected from (part of [ticket:513])
- MS-SQL better detects when a query is a subquery and knows not to
generate ORDER BY phrases for those [ticket:513]
2007-04-11 20:55:27 +00:00
Mike Bayer cdceb3c371 - merged the "execcontext" branch, refactors engine/dialect codepaths
- much more functionality moved into ExecutionContext, which impacted
the API used by dialects to some degree
- ResultProxy and subclasses now designed sanely
- merged patch for #522, Unicode subclasses String directly,
MSNVarchar implements for MS-SQL, removed MSUnicode.
- String moves its "VARCHAR"/"TEXT" switchy thing into
"get_search_list()" function, which VARCHAR and CHAR can override
to not return TEXT in any case (didnt do the latter yet)
- implements server side cursors for postgres, unit tests, #514
- includes overhaul of dbapi import strategy #480, all dbapi
importing happens in dialect method "dbapi()", is only called
inside of create_engine() for default and threadlocal strategies.
Dialect subclasses have a datamember "dbapi" referencing the loaded
module which may be None.
- added "mock" engine strategy, doesnt require DBAPI module and
gives you a "Connecition" which just sends all executes to a callable.
can be used to create string output of create_all()/drop_all().
2007-04-02 21:36:11 +00:00
Mike Bayer e9bbf54b71 added keys() to ColumnParameters, needed for setbindparamsizes traversal 2007-03-28 23:30:22 +00:00
Mike Bayer c13846c6b6 - sending None as an argument to func.<something> will produce
an argument of NULL
2007-03-28 23:18:04 +00:00
Mike Bayer e0b638a704 - column label and bind param "truncation" also generate
deterministic names now, based on their ordering within the
full statement being compiled.  this means the same statement
will produce the same string across application restarts and
allowing DB query plan caching to work better.
- cleanup to sql.ClauseParameters since it was just falling
apart, API made more explicit
- many unit test tweaks to adjust for bind params not being
"pre" truncated, changes to ClauseParameters
2007-03-28 07:19:14 +00:00
Mike Bayer ccbcbda43e added label truncation for bind param names which was lost in the previous related commit.
added more tests plus test for column targeting with text() clause.
2007-03-28 01:39:58 +00:00
Mike Bayer 0491452799 - fix for fetchmany() "size" argument being positional in most
dbapis [ticket:505]
2007-03-28 00:09:55 +00:00
Mike Bayer 32440f2b3b - preliminary support for unicode table and column names added. 2007-03-27 16:04:34 +00:00
Mike Bayer 748f9b9acf - column labels are now generated in the compilation phase, which
means their lengths are dialect-dependent.  So on oracle a label
that gets truncated to 30 chars will go out to 63 characters
on postgres.  Also, the true labelname is always attached as the
accessor on the parent Selectable so theres no need to be aware
of the genrerated label names [ticket:512].
- ResultProxy column targeting is greatly simplified, and relies
upon the ANSICompiler's column_labels map to translate the built-in
label on a _ColumnClause (which is now considered to be a unique
identifier of that column) to the label which was generated at compile
time.
- still need to put a baseline of ColumnClause targeting for
ResultProxy objects that originated from a textual query.
2007-03-24 19:24:27 +00:00
Mike Bayer cef652a2d6 - slightly better support for bind params as column clauses, either
via bindparam() or via literal(), i.e. select([literal('foo')])
- removed "table" argument from column().  this does not add the column
to the table anyway so was misleading.
- Select _exportable_columns() only exports Selectable instances
- Select uses _exportable_columns() when searching for engines
instead of _raw_columns for similar reasons (non selectables have no engine)
- _BindParamClause no longer has a _make_proxy().  its not a ColumnElement.
- _Label detects underlying column element and will generate its own
column()._make_proxy() if the element is not a ColumnElement.  this
allows a Label to be declared for nearly anything and it can export
itself as a column on a containing Selectable.
2007-03-21 20:43:34 +00:00
Mike Bayer c249066dbf "alltests" runners call testbase.main(), which takes an optional suite,
so that exit code is propigated
2007-03-15 18:11:05 +00:00