Commit Graph

4117 Commits

Author SHA1 Message Date
Mike Bayer ea81fa93a4 fix typo 2010-10-23 13:43:39 -04:00
Mike Bayer 92fb9f91af - New Query methods: query.label(name), query.as_scalar(),
return the query's statement as a scalar subquery
with /without label [ticket:1920];
query.with_entities(*ent), replaces the SELECT list of
the query with new entities.
Roughly equivalent to a generative form of query.values()
which accepts mapped entities as well as column
expressions.
2010-10-23 13:07:56 -04:00
Mike Bayer c5579f77e2 - A mixin can now specify a column that overrides
a column of the same name associated with a superclass.
Thanks to Oystein Haaland.
2010-10-21 16:54:39 -04:00
Mike Bayer ee345b055c - Fixed bug in TypeDecorator whereby the dialect-specific
type was getting pulled in to generate the DDL for a
given type, which didn't always return the correct result.

- TypeDecorator can now have a fully constructed type
specified as its "impl", in addition to a type class.

- TypeDecorator will now place itself as the resulting
type for a binary expression where the type coercion
rules would normally return its impl type - previously,
a copy of the impl type would be returned which would
have the TypeDecorator embedded into it as the "dialect"
impl, this was probably an unintentional way of achieving
the desired effect.

- TypeDecorator.load_dialect_impl() returns "self.impl" by
default, i.e. not the dialect implementation type of
"self.impl".   This to support compilation correctly.
Behavior can be user-overridden in exactly the same way
as before to the same effect.
2010-10-21 16:42:32 -04:00
Mike Bayer 3d9ca1b7d6 - document is_modified() caveats including that the "old" value isn't always
present, and that this results in a positive response for "changed"
[ticket:1928]
2010-10-20 17:58:35 -04:00
Mike Bayer f3c9c87a24 - Fixed mysql bug involving reflection of CURRENT_TIMESTAMP
default used with ON UPDATE clause, thanks to
Taavi Burns [ticket:1940]
2010-10-20 17:44:35 -04:00
Mike Bayer 60197fb0f4 - Fixed bug which prevented "domain" built from a
custom type such as "enum" from being reflected.
[ticket:1933]
2010-10-20 17:28:08 -04:00
Mike Bayer 42ac34a701 - Added "as_tuple" flag to pg ARRAY type, returns results
as tuples instead of lists to allow hashing.
2010-10-20 16:17:17 -04:00
Mike Bayer db318240d1 - Fixed bug where aliasing of tables with "schema" would
fail to compile properly.  [ticket:1943]
2010-10-20 16:15:54 -04:00
Mike Bayer 976df5bf96 - the NoseSQLAlchemyPlugin has been moved to a
new package "sqlalchemy_nose" which installs
along with "sqlalchemy".  This so that the "nosetests"
script works as always but also allows the
--with-coverage option to turn on coverage before
SQLAlchemy modules are imported, allowing coverage
to work correctly.
- added some new ignores
2010-10-17 15:23:14 -04:00
Mike Bayer a8fff06cb4 edit 2010-10-17 00:07:13 -04:00
Mike Bayer 5b0fc34b72 note expire_on_commit in the docstring for commit() as well 2010-10-16 23:50:33 -04:00
Mike Bayer a714db53b3 - Fixed MSSQL reflection bug which did not properly handle
reflection of unknown types.  [ticket:1946]
2010-10-16 12:15:40 -04:00
Mike Bayer 295fd90125 - Added a new "lazyload" option "immediateload".
Issues the usual "lazy" load operation automatically
as the object is populated.   The use case
here is when loading objects to be placed in
an offline cache, or otherwise used after
the session isn't available, and straight 'select'
loading, not 'joined' or 'subquery', is desired.
[ticket:1914]
2010-10-15 11:59:02 -04:00
Mike Bayer 35508a30d7 - engine_from_config() now accepts 'debug' for
'echo', 'echo_pool', 'force' for 'convert_unicode',
boolean values for 'use_native_unicode'.
[ticket:1899]
2010-10-15 11:43:59 -04:00
Mike Bayer b47983f8ec - Fixed labeling bug in Query whereby the NamedTuple
would mis-apply labels if any of the column
expressions were un-labeled.
2010-10-14 12:04:51 -04:00
Chris Withers a376f3e2da warn when two classes with the same name end up in the declarative registry 2010-10-06 12:04:25 +01:00
Chris Withers 526d73ecfc document creating indexes for columns in mixins 2010-10-04 10:14:54 +01:00
Mike Bayer ee9102622c - default compilation of a type will check if the type class's module is
inside of sqlalchemy.dialects, in which case that dialect's default
will be used instead of DefaultDialect.
2010-10-03 13:11:41 -04:00
Mike Bayer 15442ed1f4 - added "views=True" option to metadata.reflect(),
will add the list of available views to those
being reflected.  [ticket:1936]
2010-10-02 18:05:19 -04:00
Mike Bayer 761b4f29e2 - *Major* cleanup / modernization of the Informix
dialect for 0.6, courtesy Florian Apolloner.
[ticket:1906]
2010-10-01 21:26:05 -04:00
Mike Bayer 4557fd5a9a - Fixed bug in query.update() where 'evaluate' or 'fetch'
expiration would fail if the column expression key was
a class attribute with a different keyname as the
actual column name.  [ticket:1935]
2010-10-01 20:55:42 -04:00
Mike Bayer 83a87b3f54 - add additional logic that duplicates mapper's prop.copy(); prop.columns.append(col)
logic when columns are present in a joined subclass with an attribute name different
than the column name itself [ticket:1931]
- add coverage to verify that we need to check (obj.name or name) when
deciding if a Column from a mixin should be added to the mapped table
2010-10-01 20:29:04 -04:00
Mike Bayer 755aca7f5f - reworked the internals of mapper.cascade_iterator() to
cut down method calls by about 9% in some circumstances.
[ticket:1932]
2010-10-01 14:23:01 -04:00
Mike Bayer 2a2257b1e7 py2.4 didn't seem to like super() on an exception 2010-09-29 10:34:45 -04:00
Mike Bayer a9875e3950 don't need itertools here 2010-09-29 02:15:07 -04:00
Mike Bayer e9e221977b - CircularDependencyError now has .cycles and .edges
members, which are the set of elements involved in
one or more cycles, and the set of edges as 2-tuples.
[ticket:1890]
2010-09-29 02:11:38 -04:00
Mike Bayer ec3e6c7dc2 - Fixed bug whereby columns on a mixin wouldn't propagate
correctly to a single-table inheritance scheme where
the attribute name is different than that of the column.
[ticket:1930].   Note [ticket:1931] which is the same
issue for joined inh, not yet resolved.
2010-09-28 12:43:36 -04:00
Mike Bayer abc8e45b2f @mapperproperty -> @declared_attr 2010-09-27 10:01:48 -04:00
Mike Bayer 1ff666ffdf - @classproperty 's official name/location for usage
with declarative is sqlalchemy.ext.declarative.mapperproperty.
Same thing, but moving there since it is more of a
"marker" that's specific to declararative,
not just an attribute technique.  [ticket:1915]
2010-09-25 19:25:31 -04:00
Mike Bayer a4a09a687a - Fixed recursion overflow which could occur when operating
with two expressions both of type "NullType", but
not the singleton NULLTYPE instance. [ticket:1907]
2010-09-25 18:38:01 -04:00
Mike Bayer f1648baa4b - fix a typo that was apparently not really impacting anything 2010-09-25 16:19:49 -04:00
Mike Bayer cb610d783e fix the default here 2010-09-25 16:15:32 -04:00
Chris Withers 63fc8cb313 make less ficticious ;-) 2010-09-24 12:10:43 +01:00
Mike Bayer 21d2a6d790 doc edits 2010-09-23 19:24:28 -04:00
Mike Bayer 30e4b186f2 doc edits 2010-09-22 23:48:17 -04:00
Mike Bayer eae4de02a9 - in depth docs about some merge() tips
- docs about backref cascade
- Another new flag on relationship(), cascade_backrefs,
disables the "save-update" cascade when the event was
initiated on the "reverse" side of a bidirectional
relationship.   This is a cleaner behavior so that
many-to-ones can be set on a transient object without
it getting sucked into the child object's session,
while still allowing the forward collection to
cascade.   We *might* default this to False in 0.7.
2010-09-22 14:22:16 -04:00
Mike Bayer 7b8b23b427 - Query.select_from() has been beefed up to help
ensure that a subsequent call to query.join()
will use the select_from() entity, assuming it's
a mapped entity and not a plain selectable,
as the default "left" side, not the first entity
in the Query object's list of entities.
2010-09-21 18:09:29 -04:00
Mike Bayer 0fdd6698ce - the logging message emitted by the engine when
a connection is first used is now "BEGIN (implicit)"
to emphasize that DBAPI has no explicit begin().
2010-09-21 11:10:07 -04:00
Mike Bayer c9125a9efd - Patched a case where query.join() would adapt the
right side to the right side of the left's join
inappropriately [ticket:1925]
2010-09-21 10:11:10 -04:00
Mike Bayer 634d547425 - scoped_session emits a warning when configure() is
called if a Session is already present (checks only the
current thread) [ticket:1924]
2010-09-21 09:33:30 -04:00
Mike Bayer 4fbd16e045 - @classproperty (soon/now @mapperproperty) takes effect for
__mapper_args__, __table_args__, __tablename__ on
a base class that is not a mixin, as well as mixins.
[ticket:1922]
2010-09-20 12:00:14 -04:00
Mike Bayer c5c8cdf3b4 - as_scalar(), label() can be called on a selectable
which contains a Column that is not yet named.
[ticket:1862]
2010-09-18 13:34:04 -04:00
Mike Bayer 003149c504 - An informative error message is raised if a Column
which has not yet been assigned a name, i.e. as in
declarative, is used in a context where it is
exported to the columns collection of an enclosing
select() construct, or if any construct involving
that column is compiled before its name is
assigned.  [ticket:1862]
2010-09-18 13:18:44 -04:00
Mike Bayer f46c4028bc add oursql to has lastrowid 2010-09-18 12:35:25 -04:00
Mike Bayer 611fb77186 - use "key in dict" rather than KeyError if the usual case
is that the key is not present.
- don't need to uniquify Index schemes, just don't copy Indexes
that were known to be generated from the index=True flag
- user facing changes go in CHANGES
- Table.c allows string lookup
2010-09-18 11:40:25 -04:00
Chris Withers 065eb91c4d merge 2010-09-16 21:11:32 +01:00
Chris Withers 4bcb4c98f9 add warning about dodgy use of tometadata 2010-09-16 21:10:17 +01:00
Chris Withers 27cf184b50 tometadata now copies indexes as well 2010-09-16 20:58:15 +01:00
Chris Withers fd6c85cf7f make sure kwargs are copied by tometadata 2010-09-16 20:03:18 +01:00