Commit Graph

33 Commits

Author SHA1 Message Date
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
Mike Bayer 2d4dfb959b - added "timezone=True" flag to DateTime and Time types. postgres
so far will convert this to "TIME[STAMP] (WITH|WITHOUT) TIME ZONE",
so that control over timezone presence is more controllable (psycopg2
returns datetimes with tzinfo's if available, which can create confusion
against datetimes that dont).
[ticket:275]
2006-08-26 19:46:33 +00:00
Mike Bayer 23e3420fc9 added limit/offset to union queries 2006-08-26 14:42:18 +00:00
Mike Bayer fc17f7e659 [ticket:280] statement execution supports using the same BindParam
object more than once in an expression; simplified handling of positional
parameters.  nice job by Bill Noon figuring out the basic idea.
2006-08-18 20:12:39 +00:00
Mike Bayer 9e8fad2abc quoting facilities set up so that database-specific quoting can be
turned on for individual table, schema, and column identifiers when
used in all queries/creates/drops.  Enabled via "quote=True" in
Table or Column, as well as "quote_schema=True" in Table.  Thanks to
Aaron Spike for his excellent efforts.  [ticket:155]
2006-08-12 17:28:15 +00:00
Mike Bayer bc6fbfa84a overhaul to schema, addition of ForeignKeyConstraint/
PrimaryKeyConstraint objects (also UniqueConstraint not
completed yet).  table creation and reflection modified
to be more oriented towards these new table-level objects.
reflection for sqlite/postgres/mysql supports composite
foreign keys; oracle/mssql/firebird not converted yet.
2006-07-14 20:06:09 +00:00
Mike Bayer 2cb2b624f9 fixed up boolean datatype for sqlite, mysql, ms-sql 2006-07-13 01:12:53 +00:00
Mike Bayer b3927fbb88 inserting './lib/' into sys.path since PYTHONPATH no longer straightforward with latest setuptools 2006-06-29 00:28:55 +00:00
Mike Bayer 1ffed8432e cast converted into its own ClauseElement so that it can have an explicit compilation
function in ANSICompiler
MySQLCompiler then skips most CAST calls since it only seems to support the standard syntax for Date
types; other types now a TODO for MySQL
then, polymorphic_union() function now CASTs null()s to the type corresponding to the columns in the UNION,
since postgres doesnt like mixing NULL with integer types
(long road for that .....)
2006-06-17 00:53:33 +00:00
Mike Bayer 0642dcb796 unit tests for dangling subquery, many-to-many clear-and-resave 2006-06-14 15:39:46 +00:00
Mike Bayer 6d22c93181 separated standalone between(), column.between(), put literal checking for both, favor column.between() 2006-06-08 17:38:37 +00:00
Mike Bayer c133b136e1 fixed typing for between() operator, [ticket:202] 2006-06-08 17:29:18 +00:00
Mike Bayer 2c64bca214 0.2.2 prep, added "pickler" option to Pickle type 2006-06-05 19:18:48 +00:00
Mike Bayer 120dcee5a7 reorganized unit tests into subdirectories 2006-06-05 17:25:51 +00:00