Commit Graph

63 Commits

Author SHA1 Message Date
Mike Bayer 6458a670c0 reverted unit test change 2007-02-19 04:36:18 +00:00
Rick Morrison e7ac502b81 Completed previously missed patches from tickets 422 and 415
get unit tests to work with pyodbc [ticket:481]
fix blank password on adodbapi [ticket:371]
2007-02-18 19:43:05 +00:00
Mike Bayer b5bb6bb06d - fixed generation of CHECK constraints on columns [ticket:464] 2007-02-17 03:46:13 +00:00
Mike Bayer 225e51a796 - added a Sequence to the unicode test tables to help Oracle
- fixed named PrimaryKeyConstraint generation on oracle [ticket:466] courtesy andrija at gmail
2007-02-17 02:31:56 +00:00
Mike Bayer 5f83c55fc7 - fixed oracle list of binary types to check for their presence in the module (such as BFILE not in all versions of cx_Oracle)
- removed oracle-handicap from binary unit test to test [ticket:435] fix, added an extra row containing None
2007-02-17 01:18:54 +00:00
Mike Bayer 80f48f250b - added literal_column() to specify a column clause that should not undergo any quoting
- straight text sent to select() added as literal_column
- fix for issue in [ticket:450]
2007-02-04 03:43:22 +00:00
Mike Bayer a8cdead326 - more quoting fixes for [ticket:450]...quoting more aggressive (but still skips already-quoted literals)
- got mysql to have "format" as default paramstyle even if mysql module not available, allows unit tests
to pass in non-mysql system for [ticket:457].  all the dialects should be changed to pass in their usual
paramstyle.
2007-02-04 03:12:27 +00:00
Mike Bayer 5ce214c7d4 - sequences on a non-pk column will properly fire off on INSERT for PG/oracle 2007-02-02 18:58:11 +00:00
Mike Bayer ab0a6cf6a8 unit test for "cant execute" 2007-02-02 18:26:42 +00:00
Mike Bayer ac4b2a8d18 fixes to quoting on "fake" column when used off its table 2007-01-29 22:41:53 +00:00
Mike Bayer bbc5e7c285 merged the polymorphic relationship refactoring branch in. i want to go further on that branch and introduce the foreign_keys argument, and further centralize the "intelligence" about the joins and selectables into PropertyLoader so that lazyloader/sync can be simplified, but the current branch goes pretty far.
- relations keep track of "polymorphic_primaryjoin", "polymorphic_secondaryjoin" which it derives from the plain primaryjoin/secondaryjoin.
  - lazy/eagerloaders work from those polymorphic join objects.
  - the join exported by PropertyLoader to Query/SelectResults is the polymorphic join, so that join_to/etc work properly.
  - Query builds itself against the base Mapper again, not the "polymorphic" mapper.  uses the "polymorphic" version
 only as appropriate.  this helps join_by/join_to/etc to work with polymorphic mappers.
  - Query will also adapt incoming WHERE criterion to the polymorphic mapper, i.e. the "people" table becomes the "person_join" automatically.
  - quoting has been modified since labels made out of non-case-sensitive columns could themselves require quoting..so case_sensitive defaults to True if not otherwise specified (used to be based on the identifier itself).
  - the test harness gets an ORMTest base class and a bunch of the ORM unit tests are using it now, decreases a lot of redundancy.
2007-01-28 23:33:53 +00:00
Mike Bayer b8662333bb - *slight* support for binary, but still need to figure out how to insert reasonably large
values (over 4K).  requires auto_setinputsizes=True sent to create_engine(), rows must
be fully fetched individually, etc.
2007-01-23 20:25:48 +00:00
Mike Bayer c95faa5e8d - mysql table create options work on a generic passthru now, i.e. Table(..., mysql_engine='InnoDB',
mysql_collate="latin1_german2_ci", mysql_auto_increment="5", mysql_<somearg>...),
helps [ticket:418]
2007-01-20 21:00:08 +00:00
Mike Bayer 37a61a1b49 - another fix to subquery correlation so that a subquery which has only one FROM
element will *not* correlate that single element, since at least one FROM element is
required in a query.
2007-01-19 02:19:38 +00:00
Mike Bayer 35fcfbc083 added testcase to ensure that type gets propigated from scalar subquery to its label 2007-01-16 23:23:19 +00:00
Mike Bayer 437f1ce670 - postgres cursor option is now server_side_cursors=False; some users get bad results using them
so theyre off by default
- type system slightly modified to support TypeDecorators that can be overridden by the dialect
- added an NVarchar type to mssql (produces NVARCHAR), also MSUnicode which provides Unicode-translation
for the NVarchar regardless of dialect convert_unicode setting.
2007-01-14 20:21:36 +00:00
Mike Bayer a4c73cc8ae - the "op()" function is now treated as an "operation", rather than a "comparison".
the difference is, an operation produces a BinaryExpression from which further operations
  can occur whereas comparison produces the more restrictive BooleanExpression
2007-01-08 19:09:02 +00:00
Mike Bayer 5369b3df8c - fix to correlation of subqueries when the column list of the select statement
is constructed with individual calls to append_column(); this fixes an ORM
bug whereby nested select statements were not getting correlated with the
main select generated by the Query object.
2006-12-28 00:27:58 +00:00
Mike Bayer 422558bc5d fix to the fix for [ticket:396] plus a unit test 2006-12-15 01:07:05 +00:00
Mike Bayer 13d989b2d0 - sending a selectable to an IN no longer creates a "union" out of multiple
selects; only one selectable to an IN is allowed now (make a union yourself
if union is needed; explicit better than implicit, dont guess, etc.)
2006-11-29 22:13:58 +00:00
Mike Bayer b6b0130646 - made kwargs parsing to Table strict; removed various obsoluete "redefine=True" kw's from the unit tests
- documented instance variables in ANSICompiler
- fixed [ticket:120], adds "inline_params" set to ANSICompiler which DefaultDialect picks up on when
determining defaults.  added unittests to query.py
- additionally fixed up the behavior of the "values" parameter on _Insert/_Update
- more cleanup to sql/Select - more succinct organization of FROM clauses, removed silly _process_from_dict
methods and JoinMarker object
2006-11-26 02:36:27 +00:00
Mike Bayer 19fcb943c4 - cleanup on some instance vars in Select (is_scalar, is_subquery, _froms is __froms, removed unused 'nowait', '_text', etc)
- cleaned up __repr__ on Column, AbstractTypeEngine
- added standalone intersect(_all), except(_all) functions, unit tests illustrating nesting patterns [ticket:247]
2006-11-25 21:32:26 +00:00
Mike Bayer 8a2ed6de4f fix to oracle types test, added RAW type [ticket:378] 2006-11-21 22:20:31 +00:00
Mike Bayer f60151ebd3 - fixed direct execution of Compiled objects 2006-10-31 15:58:51 +00:00
Mike Bayer 9bb80a8f11 figured out how a Select can be in its own _froms list, changed assertion to just a continue 2006-10-31 00:51:16 +00:00
Mike Bayer 76597e533f fixed binary types test to use two binary files specifically for testing, instead of
attempting to grab .pyc files
2006-10-30 01:29:43 +00:00
Mike Bayer 4273dd4cfe further fixes to sqlite booleans, weren't working as defaults 2006-10-29 02:40:27 +00:00
Mike Bayer 066d8dc79c added string length to avoid LOB col type in oracle 2006-10-22 05:50:03 +00:00
Mike Bayer 45b6c7d778 added __getattr__() proxy to TypeDecorator 2006-10-22 00:42:43 +00:00
Mike Bayer 0d75e5961c - [ticket:346], session closing the connection on flush
- added unicode assertion for sqlite
2006-10-19 02:52:31 +00:00
Mike Bayer 8340006dd7 - a fair amount of cleanup to the schema package, removal of ambiguous
methods, methods that are no longer needed.  slightly more constrained
useage, greater emphasis on explicitness.
- table_iterator signature fixup, includes fix for [ticket:288]
- the "primary_key" attribute of Table and other selectables becomes
a setlike ColumnCollection object; is no longer ordered or numerically
indexed.  a comparison clause between two pks that are derived from the
same underlying tables (i.e. such as two Alias objects) can be generated
via table1.primary_key==table2.primary_key
- append_item() methods removed from Table and Column; preferably
construct Table/Column/related objects inline, but if needed use
append_column(), append_foreign_key(), append_constraint(), etc.
- table.create() no longer returns the Table object, instead has no
return value.  the usual case is that tables are created via metadata,
which is preferable since it will handle table dependencies.
- added UniqueConstraint (goes at Table level), CheckConstraint
(goes at Table or Column level) fixes [ticket:217]
- index=False/unique=True on Column now creates a UniqueConstraint,
index=True/unique=False creates a plain Index,
index=True/unique=True on Column creates a unique Index.  'index'
and 'unique' keyword arguments to column are now boolean only; for
explcit names and groupings of indexes or unique constraints, use the
UniqueConstraint/Index constructs explicitly.
- relationship of Metadata/Table/SchemaGenerator/Dropper has been
improved so that the schemavisitor receives the metadata object
for greater control over groupings of creates/drops.
- added "use_alter" argument to ForeignKey, ForeignKeyConstraint,
but it doesnt do anything yet.  will utilize new generator/dropper
behavior to implement.
2006-10-14 21:58:04 +00:00
Mike Bayer e16bfad407 - fixes to Date/Time (SLDate/SLTime) types; works as good as postgres
now [ticket:335]
2006-10-12 01:12:17 +00:00
Mike Bayer 758828ed54 assorted firebird fixes from Lele Gaifax 2006-10-07 00:54:14 +00:00
Mike Bayer bbd7c66056 - Function objects know what to do in a FROM clause now. their
behavior should be the same, except now you can also do things like
    select(['*'], from_obj=[func.my_function()]) to get multiple
    columns from the result, or even use sql.column() constructs to name the
    return columns [ticket:172].  generally only postgres understands the
    syntax (and possibly oracle).
2006-10-03 23:00:04 +00:00
Mike Bayer ec6d7b3900 formatting fixup, etc. 2006-10-03 22:56:54 +00:00
Mike Bayer 73f145dc0e - added auto_setinputsizes=False to oracle dialect. if true, all executions will get setinputsizes called ahead of time.
- some tweaks to the types unittest for oracle.  oracle types still need lots more work.
2006-10-03 21:47:48 +00:00
Mike Bayer 93caa5da2e decruftify 2006-09-28 02:13:37 +00:00
Mike Bayer e812785c2d - logging is now implemented via standard python "logging" module.
"echo" keyword parameters are still functional but set/unset
log levels for their respective classes/instances.  all logging
can be controlled directly through the Python API by setting
INFO and DEBUG levels for loggers in the "sqlalchemy" namespace.
class-level logging is under "sqlalchemy.<module>.<classname>",
instance-level logging under "sqlalchemy.<module>.<classname>.<hexid>".
Test suite includes "--log-info" and "--log-debug" arguments
which work independently of --verbose/--quiet.  Logging added
to orm to allow tracking of mapper configurations, row iteration
fixes [ticket:229] [ticket:79]
2006-09-24 23:59:22 +00:00
Mike Bayer 7d74fc7785 - added "pickleable" module to test suite to have cPickle-compatible
test objects
- added copy_function, compare_function arguments to InstrumentedAttribute
- added MutableType mixin, copy_value/compare_values methods to TypeEngine,
PickleType
- ColumnProperty and DeferredProperty propigate the TypeEngine copy/compare
methods to the attribute instrumentation
- cleanup of UnitOfWork, removed unused methods
- UnitOfWork "dirty" list is calculated across the total collection of persistent
objects when called, no longer has register_dirty.
- attribute system can still report "modified" status fairly quickly, but does
extra work for InstrumentedAttributes that have detected a "mutable" type where
catching the __set__() event is not enough (i.e. PickleTypes)
- attribute tracking modified to be more intelligent about detecting
changes, particularly with mutable types.  TypeEngine objects now
take a greater role in defining how to compare two scalar instances,
including the addition of a MutableType mixin which is implemented by
PickleType.  unit-of-work now tracks the "dirty" list as an expression
of all persistent objects where the attribute manager detects changes.
The basic issue thats fixed is detecting changes on PickleType
objects, but also generalizes type handling and "modified" object
checking to be more complete and extensible.
2006-09-23 20:26:20 +00:00
Mike Bayer 372a8d76a6 - added autoincrement=True to Column; will disable schema generation
of SERIAL/AUTO_INCREMENT/identity seq for postgres/mysql/mssql if
explicitly set to False.  #303
2006-09-23 17:21:56 +00:00
Mike Bayer 887fdc87ef - BooleanExpression includes new "negate" argument to specify
the appropriate negation operator if one is available.
- calling a negation on an "IN" or "IS" clause will result in
"NOT IN", "IS NOT" (as opposed to NOT (x IN y)).
2006-09-21 17:15:33 +00:00
Mike Bayer 3dd5d834ad added extract() function to sql dialect 2006-09-14 16:41:18 +00:00
Mike Bayer 47d8b03b14 - changed "for_update" parameter to accept False/True/"nowait"
and "read", the latter two of which are interpreted only by
Oracle and Mysql [ticket:292]
- added "lockmode" argument to base Query select/get functions,
including "with_lockmode" function to get a Query copy that has
a default locking mode.  Will translate "read"/"update"
arguments into a for_update argument on the select side.
[ticket:292]
2006-09-10 23:52:04 +00:00
Mike Bayer f3d72a7187 - unicode fix for startswith()/endswith() [ticket:296] 2006-09-05 15:39:59 +00:00
Mike Bayer 189f015c2a further fixes to case sensitive logic 2006-09-04 23:05:36 +00:00
Mike Bayer f5454c89ea simplification to quoting to just cache strings per-dialect, added quoting for alias and label names
fixes [ticket:294]
2006-09-04 01:56:31 +00:00
Mike Bayer 9f23a5c3de fix to from clause in unittest query...somehow this didnt fail on pg 8.0, but fails on 8.1 2006-08-31 23:41:49 +00:00
Mike Bayer b02b64675e pg formats sequence name, more quote test fixes 2006-08-31 23:26:30 +00:00
Mike Bayer e168ef63a9 some tweaks to oracle casing... 2006-08-31 23:13:14 +00:00
Mike Bayer 0c7250a474 - added case_sensitive argument to MetaData, Table, Column, determines
itself automatically based on if a parent schemaitem has a non-None
setting for the flag, or if not, then whether the identifier name is all lower
case or not.  when set to True, quoting is applied to identifiers with mixed or
uppercase identifiers.  quoting is also applied automatically in all cases to
identifiers that are known to be reserved words or contain other non-standard
characters. various database dialects can override all of this behavior, but
currently they are all using the default behavior.  tested with postgres, mysql,
sqlite.  needs more testing with firebird, oracle, ms-sql. part of the ongoing
work with [ticket:155]
2006-08-31 18:58:22 +00:00