Sqlalchemy

Latest version: v2.0.30

Safety actively analyzes 629564 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 44 of 50

0.4.2

Not secure
:released: Wed Jan 02 2008

.. change::
:tags: sql
:tickets: 615

generic functions ! we introduce a database of known SQL functions, such
as current_timestamp, coalesce, and create explicit function objects
representing them. These objects have constrained argument lists, are
type aware, and can compile in a dialect-specific fashion. So saying
func.char_length("foo", "bar") raises an error (too many args),
func.coalesce(datetime.date(2007, 10, 5), datetime.date(2005, 10, 15))
knows that its return type is a Date. We only have a few functions
represented so far but will continue to add to the system

.. change::
:tags: sql
:tickets:

auto-reconnect support improved; a Connection can now automatically
reconnect after its underlying connection is invalidated, without
needing to connect() again from the engine. This allows an ORM session
bound to a single Connection to not need a reconnect.
Open transactions on the Connection must be rolled back after an invalidation
of the underlying connection else an error is raised. Also fixed
bug where disconnect detect was not being called for cursor(), rollback(),
or commit().

.. change::
:tags: sql
:tickets:

added new flag to String and create_engine(),
assert_unicode=(True|False|'warn'\|None). Defaults to `False` or `None` on
create_engine() and String, `'warn'` on the Unicode type. When `True`,
results in all unicode conversion operations raising an exception when a
non-unicode bytestring is passed as a bind parameter. 'warn' results
in a warning. It is strongly advised that all unicode-aware applications
make proper use of Python unicode objects (i.e. u'hello' and not 'hello')
so that data round trips accurately.

.. change::
:tags: sql
:tickets:

generation of "unique" bind parameters has been simplified to use the same
"unique identifier" mechanisms as everything else. This doesn't affect
user code, except any code that might have been hardcoded against the generated
names. Generated bind params now have the form "<paramname>_<num>",
whereas before only the second bind of the same name would have this form.

.. change::
:tags: sql
:tickets:

select().as_scalar() will raise an exception if the select does not have
exactly one expression in its columns clause.

.. change::
:tags: sql
:tickets:

bindparam() objects themselves can be used as keys for execute(), i.e.
statement.execute({bind1:'foo', bind2:'bar'})

.. change::
:tags: sql
:tickets:

added new methods to TypeDecorator, process_bind_param() and
process_result_value(), which automatically take advantage of the processing
of the underlying type. Ideal for using with Unicode or Pickletype.
TypeDecorator should now be the primary way to augment the behavior of any
existing type including other TypeDecorator subclasses such as PickleType.

.. change::
:tags: sql
:tickets:

selectables (and others) will issue a warning when two columns in
their exported columns collection conflict based on name.

.. change::
:tags: sql
:tickets: 890

tables with schemas can still be used in sqlite, firebird,
schema name just gets dropped

.. change::
:tags: sql
:tickets:

changed the various "literal" generation functions to use an anonymous
bind parameter. not much changes here except their labels now look
like ":param_1", ":param_2" instead of ":literal"

.. change::
:tags: sql
:tickets:

column labels in the form "tablename.columname", i.e. with a dot, are now
supported.

.. change::
:tags: sql
:tickets:

from_obj keyword argument to select() can be a scalar or a list.

.. change::
:tags: orm
:tickets: 871

a major behavioral change to collection-based backrefs: they no
longer trigger lazy loads ! "reverse" adds and removes
are queued up and are merged with the collection when it is
actually read from and loaded; but do not trigger a load beforehand.
For users who have noticed this behavior, this should be much more
convenient than using dynamic relations in some cases; for those who
have not, you might notice your apps using a lot fewer queries than
before in some situations.

.. change::
:tags: orm
:tickets:

mutable primary key support is added. primary key columns can be
changed freely, and the identity of the instance will change upon
flush. In addition, update cascades of foreign key referents (primary
key or not) along relations are supported, either in tandem with the
database's ON UPDATE CASCADE (required for DB's like Postgres) or
issued directly by the ORM in the form of UPDATE statements, by setting
the flag "passive_cascades=False".

.. change::
:tags: orm
:tickets: 490

inheriting mappers now inherit the MapperExtensions of their parent
mapper directly, so that all methods for a particular MapperExtension
are called for subclasses as well. As always, any MapperExtension
can return either EXT_CONTINUE to continue extension processing
or EXT_STOP to stop processing. The order of mapper resolution is:
<extensions declared on the classes mapper> <extensions declared on the
classes' parent mapper> <globally declared extensions>.

Note that if you instantiate the same extension class separately
and then apply it individually for two mappers in the same inheritance
chain, the extension will be applied twice to the inheriting class,
and each method will be called twice.

To apply a mapper extension explicitly to each inheriting class but
have each method called only once per operation, use the same
instance of the extension for both mappers.

.. change::
:tags: orm
:tickets: 907

MapperExtension.before_update() and after_update() are now called
symmetrically; previously, an instance that had no modified column
attributes (but had a relation() modification) could be called with
before_update() but not after_update()

.. change::
:tags: orm
:tickets:

columns which are missing from a Query's select statement
now get automatically deferred during load.

.. change::
:tags: orm
:tickets: 908

mapped classes which extend "object" and do not provide an
__init__() method will now raise TypeError if non-empty \*args
or \**kwargs are present at instance construction time (and are
not consumed by any extensions such as the scoped_session mapper),
consistent with the behavior of normal Python classes

.. change::
:tags: orm
:tickets: 899

fixed Query bug when filter_by() compares a relation against None

.. change::
:tags: orm
:tickets:

improved support for pickling of mapped entities. Per-instance
lazy/deferred/expired callables are now serializable so that
they serialize and deserialize with _state.

.. change::
:tags: orm
:tickets: 801

new synonym() behavior: an attribute will be placed on the mapped
class, if one does not exist already, in all cases. if a property
already exists on the class, the synonym will decorate the property
with the appropriate comparison operators so that it can be used in
column expressions just like any other mapped attribute (i.e. usable in
filter(), etc.) the "proxy=True" flag is deprecated and no longer means
anything. Additionally, the flag "map_column=True" will automatically
generate a ColumnProperty corresponding to the name of the synonym,
i.e.: 'somename':synonym('_somename', map_column=True) will map the
column named 'somename' to the attribute '_somename'. See the example
in the mapper docs.

.. change::
:tags: orm
:tickets:

Query.select_from() now replaces all existing FROM criterion with
the given argument; the previous behavior of constructing a list
of FROM clauses was generally not useful as is required
filter() calls to create join criterion, and new tables introduced
within filter() already add themselves to the FROM clause. The
new behavior allows not just joins from the main table, but select
statements as well. Filter criterion, order bys, eager load
clauses will be "aliased" against the given statement.

.. change::
:tags: orm
:tickets:

this month's refactoring of attribute instrumentation changes
the "copy-on-load" behavior we've had since midway through 0.3
with "copy-on-modify" in most cases. This takes a sizable chunk
of latency out of load operations and overall does less work
as only attributes which are actually modified get their
"committed state" copied. Only "mutable scalar" attributes
(i.e. a pickled object or other mutable item), the reason for
the copy-on-load change in the first place, retain the old
behavior.

.. change::
:tags: attrname, orm
:tickets:

a slight behavioral change to attributes is, del'ing an attribute
does *not* cause the lazyloader of that attribute to fire off again;
the "del" makes the effective value of the attribute "None". To
re-trigger the "loader" for an attribute, use
session.expire(instance,).

.. change::
:tags: orm
:tickets:

query.filter(SomeClass.somechild == None), when comparing
a many-to-one property to None, properly generates "id IS NULL"
including that the NULL is on the right side.

.. change::
:tags: orm
:tickets:

query.order_by() takes into account aliased joins, i.e.
query.join('orders', aliased=True).order_by(Order.id)

.. change::
:tags: orm
:tickets:

eagerload(), lazyload(), eagerload_all() take an optional
second class-or-mapper argument, which will select the mapper
to apply the option towards. This can select among other
mappers which were added using add_entity().

.. change::
:tags: orm
:tickets:

eagerloading will work with mappers added via add_entity().

.. change::
:tags: orm
:tickets:

added "cascade delete" behavior to "dynamic" relations just like
that of regular relations. if passive_deletes flag (also just added)
is not set, a delete of the parent item will trigger a full load of
the child items so that they can be deleted or updated accordingly.

.. change::
:tags: orm
:tickets:

also with dynamic, implemented correct count() behavior as well
as other helper methods.

.. change::
:tags: orm
:tickets:

fix to cascades on polymorphic relations, such that cascades
from an object to a polymorphic collection continue cascading
along the set of attributes specific to each element in the collection.

.. change::
:tags: orm
:tickets: 893

query.get() and query.load() do not take existing filter or other
criterion into account; these methods *always* look up the given id
in the database or return the current instance from the identity map,
disregarding any existing filter, join, group_by or other criterion
which has been configured.

.. change::
:tags: orm
:tickets: 883

added support for version_id_col in conjunction with inheriting mappers.
version_id_col is typically set on the base mapper in an inheritance
relationship where it takes effect for all inheriting mappers.

.. change::
:tags: orm
:tickets:

relaxed rules on column_property() expressions having labels; any
ColumnElement is accepted now, as the compiler auto-labels non-labeled
ColumnElements now. a selectable, like a select() statement, still
requires conversion to ColumnElement via as_scalar() or label().

.. change::
:tags: orm
:tickets:

fixed backref bug where you could not del instance.attr if attr
was None

.. change::
:tags: orm
:tickets:

several ORM attributes have been removed or made private:
mapper.get_attr_by_column(), mapper.set_attr_by_column(),
mapper.pks_by_table, mapper.cascade_callable(),
MapperProperty.cascade_callable(), mapper.canload(),
mapper.save_obj(), mapper.delete_obj(), mapper._mapper_registry,
attributes.AttributeManager

.. change::
:tags: orm
:tickets:

Assigning an incompatible collection type to a relation attribute now
raises TypeError instead of sqlalchemy's ArgumentError.

.. change::
:tags: orm
:tickets: 886

Bulk assignment of a MappedCollection now raises an error if a key in the
incoming dictionary does not match the key that the collection's keyfunc
would use for that value.

.. change::
:tags: orm, newval1, newval2
:tickets:

Custom collections can now specify a converter method to translate
objects used in "bulk" assignment into a stream of values, as in:

.. sourcecode:: text

obj.col =
or
obj.dictcol = {'foo': newval1, 'bar': newval2}

The MappedCollection uses this hook to ensure that incoming key/value
pairs are sane from the collection's perspective.

.. change::
:tags: orm
:tickets: 872

fixed endless loop issue when using lazy="dynamic" on both
sides of a bi-directional relationship

.. change::
:tags: orm
:tickets: 904

more fixes to the LIMIT/OFFSET aliasing applied with Query + eagerloads,
in this case when mapped against a select statement

.. change::
:tags: orm
:tickets:

fix to self-referential eager loading such that if the same mapped
instance appears in two or more distinct sets of columns in the same
result set, its eagerly loaded collection will be populated regardless
of whether or not all of the rows contain a set of "eager" columns for
that collection. this would also show up as a KeyError when fetching
results with join_depth turned on.

.. change::
:tags: orm
:tickets:

fixed bug where Query would not apply a subquery to the SQL when LIMIT
was used in conjunction with an inheriting mapper where the eager
loader was only in the parent mapper.

.. change::
:tags: orm
:tickets:

clarified the error message which occurs when you try to update()
an instance with the same identity key as an instance already present
in the session.

.. change::
:tags: orm
:tickets:

some clarifications and fixes to merge(instance, dont_load=True).
fixed bug where lazy loaders were getting disabled on returned instances.
Also, we currently do not support merging an instance which has uncommitted
changes on it, in the case that dont_load=True is used....this will
now raise an error. This is due to complexities in merging the
"committed state" of the given instance to correctly correspond to the
newly copied instance, as well as other modified state.
Since the use case for dont_load=True is caching, the given instances
shouldn't have any uncommitted changes on them anyway.
We also copy the instances over without using any events now, so that
the 'dirty' list on the new session remains unaffected.

.. change::
:tags: orm
:tickets:

fixed bug which could arise when using session.begin_nested() in conjunction
with more than one level deep of enclosing session.begin() statements

.. change::
:tags: orm
:tickets: 914

fixed session.refresh() with instance that has custom entity_name

.. change::
:tags: dialects
:tickets:

sqlite SLDate type will not erroneously render "microseconds" portion
of a datetime or time object.

.. change::
:tags: dialects
:tickets: 902

oracle
- added disconnect detection support for Oracle
- some cleanup to binary/raw types so that cx_oracle.LOB is detected
on an ad-hoc basis

.. change::
:tags: dialects
:tickets: 824, 839, 842, 901

MSSQL
- PyODBC no longer has a global "set nocount on".
- Fix non-identity integer PKs on autoload
- Better support for convert_unicode
- Less strict date conversion for pyodbc/adodbapi
- Schema-qualified tables / autoload

.. change::
:tags: firebird, backend
:tickets: 410

does properly reflect domains (partially fixing) and
PassiveDefaults

.. change::
:tags: 3562, firebird, backend
:tickets:

reverted to use default poolclass (was set to SingletonThreadPool in
0.4.0 for test purposes)

.. change::
:tags: firebird, backend
:tickets:

map func.length() to 'char_length' (easily overridable with the UDF
'strlen' on old versions of Firebird)

.. changelog::

0.4.1

Not secure
:released: Sun Nov 18 2007

.. change::
:tags: sql
:tickets:

the "shortname" keyword parameter on bindparam() has been
deprecated.

.. change::
:tags: sql
:tickets:

Added contains operator (generates a "LIKE %<other>%" clause).

.. change::
:tags: sql
:tickets:

anonymous column expressions are automatically labeled.
e.g. select([x* 5]) produces "SELECT x * 5 AS anon_1".
This allows the labelname to be present in the cursor.description
which can then be appropriately matched to result-column processing
rules. (we can't reliably use positional tracking for result-column
matches since text() expressions may represent multiple columns).

.. change::
:tags: sql
:tickets:

operator overloading is now controlled by TypeEngine objects - the
one built-in operator overload so far is String types overloading
'+' to be the string concatenation operator.
User-defined types can also define their own operator overloading
by overriding the adapt_operator(self, op) method.

.. change::
:tags: sql
:tickets: 819

untyped bind parameters on the right side of a binary expression
will be assigned the type of the left side of the operation, to better
enable the appropriate bind parameter processing to take effect

.. change::
:tags: sql
:tickets: 833

Removed regular expression step from most statement compilations.
Also fixes

.. change::
:tags: sql
:tickets:

Fixed empty (zero column) sqlite inserts, allowing inserts on
autoincrementing single column tables.

.. change::
:tags: sql
:tickets:

Fixed expression translation of text() clauses; this repairs various
ORM scenarios where literal text is used for SQL expressions

.. change::
:tags: sql
:tickets:

Removed ClauseParameters object; compiled.params returns a regular
dictionary now, as well as result.last_inserted_params() /
last_updated_params().

.. change::
:tags: sql
:tickets:

Fixed INSERT statements w.r.t. primary key columns that have
SQL-expression based default generators on them; SQL expression
executes inline as normal but will not trigger a "postfetch" condition
for the column, for those DB's who provide it via cursor.lastrowid

.. change::
:tags: sql
:tickets: 844

func. objects can be pickled/unpickled

.. change::
:tags: sql
:tickets:

rewrote and simplified the system used to "target" columns across
selectable expressions. On the SQL side this is represented by the
"corresponding_column()" method. This method is used heavily by the ORM
to "adapt" elements of an expression to similar, aliased expressions,
as well as to target result set columns originally bound to a
table or selectable to an aliased, "corresponding" expression. The new
rewrite features completely consistent and accurate behavior.

.. change::
:tags: sql
:tickets: 573

Added a field ("info") for storing arbitrary data on schema items

.. change::
:tags: sql
:tickets:

The "properties" collection on Connections has been renamed "info" to
match schema's writable collections. Access is still available via
the "properties" name until 0.5.

.. change::
:tags: sql
:tickets:

fixed the close() method on Transaction when using strategy='threadlocal'

.. change::
:tags: sql
:tickets: 853

fix to compiled bind parameters to not mistakenly populate None

.. change::
:tags: sql
:tickets:

<Engine|Connection>._execute_clauseelement becomes a public method
Connectable.execute_clauseelement

.. change::
:tags: orm
:tickets: 843

eager loading with LIMIT/OFFSET applied no longer adds the primary
table joined to a limited subquery of itself; the eager loads now
join directly to the subquery which also provides the primary table's
columns to the result set. This eliminates a JOIN from all eager loads
with LIMIT/OFFSET.

.. change::
:tags: orm
:tickets: 802

session.refresh() and session.expire() now support an additional argument
"attribute_names", a list of individual attribute keynames to be refreshed
or expired, allowing partial reloads of attributes on an already-loaded
instance.

.. change::
:tags: orm
:tickets: 767

added op() operator to instrumented attributes; i.e.
User.name.op('ilike')('%somename%')

.. change::
:tags: orm
:tickets: 676

Mapped classes may now define __eq__, __hash__, and __nonzero__ methods
with arbitrary semantics. The orm now handles all mapped instances on
an identity-only basis. (e.g. 'is' vs '==')

.. change::
:tags: orm
:tickets:

the "properties" accessor on Mapper is removed; it now throws an informative
exception explaining the usage of mapper.get_property() and
mapper.iterate_properties

.. change::
:tags: orm
:tickets:

added having() method to Query, applies HAVING to the generated statement
in the same way as filter() appends to the WHERE clause.

.. change::
:tags: orm
:tickets: 777

The behavior of query.options() is now fully based on paths, i.e. an
option such as eagerload_all('x.y.z.y.x') will apply eagerloading to
only those paths, i.e. and not 'x.y.x'; eagerload('children.children')
applies only to exactly two-levels deep, etc.

.. change::
:tags: orm
:tickets:

PickleType will compare using `==` when set up with mutable=False,
and not the `is` operator. To use `is` or any other comparator, send
in a custom comparison function using PickleType(comparator=my_custom_comparator).

.. change::
:tags: orm
:tickets: 848

query doesn't throw an error if you use distinct() and an order_by()
containing UnaryExpressions (or other) together

.. change::
:tags: orm
:tickets: 786

order_by() expressions from joined tables are properly added to columns
clause when using distinct()

.. change::
:tags: orm
:tickets: 858

fixed error where Query.add_column() would not accept a class-bound
attribute as an argument; Query also raises an error if an invalid
argument was sent to add_column() (at instances() time)

.. change::
:tags: orm
:tickets:

added a little more checking for garbage-collection dereferences in
InstanceState.__cleanup() to reduce "gc ignored" errors on app
shutdown

.. change::
:tags: orm
:tickets:

The session API has been solidified:

.. change::
:tags: orm
:tickets: 840

It's an error to session.save() an object which is already
persistent

.. change::
:tags: orm
:tickets:

It's an error to session.delete() an object which is *not*
persistent.

.. change::
:tags: orm
:tickets:

session.update() and session.delete() raise an error when updating
or deleting an instance that is already in the session with a
different identity.

.. change::
:tags: orm
:tickets:

The session checks more carefully when determining "object X already
in another session"; e.g. if you pickle a series of objects and
unpickle (i.e. as in a Pylons HTTP session or similar), they can go
into a new session without any conflict

.. change::
:tags: orm
:tickets:

merge() includes a keyword argument "dont_load=True". setting this
flag will cause the merge operation to not load any data from the
database in response to incoming detached objects, and will accept
the incoming detached object as though it were already present in
that session. Use this to merge detached objects from external
caching systems into the session.

.. change::
:tags: orm
:tickets:

Deferred column attributes no longer trigger a load operation when the
attribute is assigned to. In those cases, the newly assigned value
will be present in the flushes' UPDATE statement unconditionally.

.. change::
:tags: orm
:tickets: 834

Fixed a truncation error when re-assigning a subset of a collection
(obj.relation = obj.relation[1:])

.. change::
:tags: orm
:tickets: 832

De-cruftified backref configuration code, backrefs which step on
existing properties now raise an error

.. change::
:tags: orm
:tickets: 831

Improved behavior of add_property() etc., fixed involving
synonym/deferred.

.. change::
:tags: orm
:tickets:

Fixed clear_mappers() behavior to better clean up after itself.

.. change::
:tags: orm
:tickets: 841

Fix to "row switch" behavior, i.e. when an INSERT/DELETE is combined
into a single UPDATE; many-to-many relations on the parent object
update properly.

.. change::
:tags: orm
:tickets:

Fixed __hash__ for association proxy- these collections are unhashable,
just like their mutable Python counterparts.

.. change::
:tags: orm
:tickets:

Added proxying of save_or_update, __contains__ and __iter__ methods for
scoped sessions.

.. change::
:tags: orm
:tickets: 852

fixed very hard-to-reproduce issue where by the FROM clause of Query
could get polluted by certain generative calls

.. change::
:tags: dialects
:tickets:

Added experimental support for MaxDB (versions >= 7.6.03.007 only).

.. change::
:tags: dialects
:tickets:

oracle will now reflect "DATE" as an OracleDateTime column, not
OracleDate

.. change::
:tags: dialects
:tickets: 847

added awareness of schema name in oracle table_names() function,
fixes metadata.reflect(schema='someschema')

.. change::
:tags: dialects
:tickets:

MSSQL anonymous labels for selection of functions made deterministic

.. change::
:tags: dialects
:tickets:

sqlite will reflect "DECIMAL" as a numeric column.

.. change::
:tags: dialects
:tickets: 828

Made access dao detection more reliable

.. change::
:tags: dialects
:tickets:

Renamed the Dialect attribute 'preexecute_sequences' to
'preexecute_pk_sequences'. An attribute proxy is in place for
out-of-tree dialects using the old name.

.. change::
:tags: dialects
:tickets:

Added test coverage for unknown type reflection. Fixed sqlite/mysql
handling of type reflection for unknown types.

.. change::
:tags: dialects
:tickets:

Added REAL for mysql dialect (for folks exploiting the
REAL_AS_FLOAT sql mode).

.. change::
:tags: dialects
:tickets:

mysql Float, MSFloat and MSDouble constructed without arguments
now produce no-argument DDL, e.g.'FLOAT'.

.. change::
:tags: misc
:tickets:

Removed unused util.hash().

.. changelog::

0.4.0

Not secure
:released: Wed Oct 17 2007

.. change::
:tags:
:tickets:

(see 0.4.0beta1 for the start of major changes against 0.3,
as well as https://www.sqlalchemy.org/trac/wiki/WhatsNewIn04 )

.. change::
:tags:
:tickets: 785

Added initial Sybase support (mxODBC so far)

.. change::
:tags:
:tickets:

Added partial index support for PostgreSQL. Use the postgres_where keyword
on the Index.

.. change::
:tags:
:tickets: 817

string-based query param parsing/config file parser understands
wider range of string values for booleans

.. change::
:tags:
:tickets: 813

backref remove object operation doesn't fail if the other-side
collection doesn't contain the item, supports noload collections

.. change::
:tags:
:tickets: 818

removed __len__ from "dynamic" collection as it would require issuing
a SQL "count()" operation, thus forcing all list evaluations to issue
redundant SQL

.. change::
:tags:
:tickets: 816

inline optimizations added to locate_dirty() which can greatly speed up
repeated calls to flush(), as occurs with autoflush=True

.. change::
:tags:
:tickets:

The IdentifierPreprarer's _requires_quotes test is now regex based. Any
out-of-tree dialects that provide custom sets of legal_characters or
illegal_initial_characters will need to move to regexes or override
_requires_quotes.

.. change::
:tags:
:tickets:

Firebird has supports_sane_rowcount and supports_sane_multi_rowcount set
to False due to ticket 370 (right way).

.. change::
:tags:
:tickets:

Improvements and fixes on Firebird reflection:
* FBDialect now mimics OracleDialect, regarding case-sensitivity of TABLE and
COLUMN names (see 'case_sensitive remotion' topic on this current file).
* FBDialect.table_names() doesn't bring system tables (ticket:796).
* FB now reflects Column's nullable property correctly.

.. change::
:tags:
:tickets:

Fixed SQL compiler's awareness of top-level column labels as used
in result-set processing; nested selects which contain the same column
names don't affect the result or conflict with result-column metadata.

.. change::
:tags:
:tickets:

query.get() and related functions (like many-to-one lazyloading)
use compile-time-aliased bind parameter names, to prevent
name conflicts with bind parameters that already exist in the
mapped selectable.

.. change::
:tags:
:tickets: 795

Fixed three- and multi-level select and deferred inheritance loading
(i.e. abc inheritance with no select_table).

.. change::
:tags:
:tickets:

Ident passed to id_chooser in shard.py always a list.

.. change::
:tags:
:tickets:

The no-arg ResultProxy._row_processor() is now the class attribute
`_process_row`.

.. change::
:tags:
:tickets: 797

Added support for returning values from inserts and updates for
PostgreSQL 8.2+.

.. change::
:tags:
:tickets:

PG reflection, upon seeing the default schema name being used explicitly
as the "schema" argument in a Table, will assume that this is the
user's desired convention, and will explicitly set the "schema" argument
in foreign-key-related reflected tables, thus making them match only
with Table constructors that also use the explicit "schema" argument
(even though its the default schema).
In other words, SA assumes the user is being consistent in this usage.

.. change::
:tags:
:tickets: 808

fixed sqlite reflection of BOOL/BOOLEAN

.. change::
:tags:
:tickets:

Added support for UPDATE with LIMIT on mysql.

.. change::
:tags:
:tickets: 803

null foreign key on a m2o doesn't trigger a lazyload

.. change::
:tags:
:tickets: 800

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

.. change::
:tags:
:tickets: 806

fix to anonymous label generation of long table/column names

.. change::
:tags:
:tickets:

Firebird dialect now uses SingletonThreadPool as poolclass.

.. change::
:tags:
:tickets:

Firebird now uses dialect.preparer to format sequences names

.. change::
:tags:
:tickets: 810

Fixed breakage with postgres and multiple two-phase transactions. Two-phase
commits and rollbacks didn't automatically end up with a new transaction
as the usual dbapi commits/rollbacks do.

.. change::
:tags:
:tickets:

Added an option to the _ScopedExt mapper extension to not automatically
save new objects to session on object initialization.

.. change::
:tags:
:tickets:

fixed Oracle non-ansi join syntax

.. change::
:tags:
:tickets:

PickleType and Interval types (on db not supporting it natively) are now
slightly faster.

.. change::
:tags:
:tickets:

Added Float and Time types to Firebird (FBFloat and FBTime). Fixed
BLOB SUB_TYPE for TEXT and Binary types.

.. change::
:tags:
:tickets:

Changed the API for the in\_ operator. in_() now accepts a single argument
that is a sequence of values or a selectable. The old API of passing in
values as varargs still works but is deprecated.

.. changelog::

0.4.0beta6

:released: Thu Sep 27 2007

.. change::
:tags:
:tickets:

The Session identity map is now *weak referencing* by default, use
weak_identity_map=False to use a regular dict. The weak dict we are using
is customized to detect instances which are "dirty" and maintain a
temporary strong reference to those instances until changes are flushed.

.. change::
:tags:
:tickets: 758

Mapper compilation has been reorganized such that most compilation occurs
upon mapper construction. This allows us to have fewer calls to
mapper.compile() and also to allow class-based properties to force a
compilation (i.e. User.addresses == 7 will compile all mappers; this is). The only caveat here is that an inheriting mapper now
looks for its inherited mapper upon construction; so mappers within
inheritance relationships need to be constructed in inheritance order
(which should be the normal case anyway).

.. change::
:tags:
:tickets:

added "FETCH" to the keywords detected by Postgres to indicate a
result-row holding statement (i.e. in addition to "SELECT").

.. change::
:tags:
:tickets:

Added full list of SQLite reserved keywords so that they get escaped
properly.

.. change::
:tags:
:tickets:

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.

.. change::
:tags:
:tickets:

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.

.. change::
:tags:
:tickets: 560

Added 'comparator' keyword argument to PickleType. By default, "mutable"
PickleType does a "deep compare" of objects using their dumps()
representation. But this doesn't work for dictionaries. Pickled objects
which provide an adequate __eq__() implementation can be set up with
"PickleType(comparator=operator.eq)"

.. change::
:tags:
:tickets:

Added session.is_modified(obj) method; performs the same "history"
comparison operation as occurs within a flush operation; setting
include_collections=False gives the same result as is used when the flush
determines whether or not to issue an UPDATE for the instance's row.

.. change::
:tags:
:tickets: 584, 761

Added "schema" argument to Sequence; use this with Postgres /Oracle when
the sequence is located in an alternate schema. Implements part of, should fix.

.. change::
:tags:
:tickets:

Fixed reflection of the empty string for mysql enums.

.. change::
:tags:
:tickets: 794

Changed MySQL dialect to use the older LIMIT <offset>, <limit> syntax
instead of LIMIT <l> OFFSET <o> for folks using 3.23.

.. change::
:tags:
:tickets:

Added 'passive_deletes="all"' flag to relation(), disables all nulling-out
of foreign key attributes during a flush where the parent object is
deleted.

.. change::
:tags:
:tickets:

Column defaults and onupdates, executing inline, will add parenthesis for
subqueries and other parenthesis-requiring expressions

.. change::
:tags:
:tickets: 793

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.

.. change::
:tags:
:tickets: 771

Fixes to ShardedSession to work with deferred columns.

.. change::
:tags:
:tickets:

User-defined shard_chooser() function must accept "clause=None" argument;
this is the ClauseElement passed to session.execute(statement) and can be
used to determine correct shard id (since execute() doesn't take an
instance.)

.. change::
:tags:
:tickets: 764

Adjusted operator precedence of NOT to match '==' and others, so that
~(x <operator> y) produces NOT (x <op> y), which is better compatible
with older MySQL versions.. 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.

.. change::
:tags:
:tickets: 757, 768, 779, 728

Other tickets:,,.

.. changelog::

0.4.0beta5

:released:

.. change::
:tags:
:tickets: 754

Connection pool fixes; the better performance of beta4 remains but fixes
"connection overflow" and other bugs which were present (like).

.. change::
:tags:
:tickets: 769

Fixed bugs in determining proper sync clauses from custom inherit
conditions.

.. change::
:tags:
:tickets: 763

Extended 'engine_from_config' coercion for QueuePool size / overflow.

.. change::
:tags:
:tickets: 748

mysql views can be reflected again.

.. change::
:tags:
:tickets:

AssociationProxy can now take custom getters and setters.

.. change::
:tags:
:tickets:

Fixed malfunctioning BETWEEN in orm queries.

.. change::
:tags:
:tickets: 762

Fixed OrderedProperties pickling

.. change::
:tags:
:tickets:

SQL-expression defaults and sequences now execute "inline" for all
non-primary key columns during an INSERT or UPDATE, and for all columns
during an executemany()-style call. inline=True flag on any insert/update
statement also forces the same behavior with a single execute().
result.postfetch_cols() is a collection of columns for which the previous
single insert or update statement contained a SQL-side default expression.

.. change::
:tags:
:tickets: 759

Fixed PG executemany() behavior.

.. change::
:tags:
:tickets:

postgres reflects tables with autoincrement=False for primary key columns
which have no defaults.

.. change::
:tags:
:tickets:

postgres no longer wraps executemany() with individual execute() calls,
instead favoring performance. "rowcount"/"concurrency" checks with
deleted items (which use executemany) are disabled with PG since psycopg2
does not report proper rowcount for executemany().

.. change::
:tags: tickets, fixed
:tickets: 742



.. change::
:tags: tickets, fixed
:tickets: 748



.. change::
:tags: tickets, fixed
:tickets: 760



.. change::
:tags: tickets, fixed
:tickets: 762



.. change::
:tags: tickets, fixed
:tickets: 763



.. changelog::

0.4.0beta4

:released: Wed Aug 22 2007

.. change::
:tags:
:tickets:

Tidied up what ends up in your namespace when you 'from sqlalchemy import \*':

.. change::
:tags:
:tickets:

'table' and 'column' are no longer imported. They remain available by
direct reference (as in 'sql.table' and 'sql.column') or a glob import
from the sql package. It was too easy to accidentally use a
sql.expressions.table instead of schema.Table when just starting out
with SQLAlchemy, likewise column.

.. change::
:tags:
:tickets:

Internal-ish classes like ClauseElement, FromClause, NullTypeEngine,
etc., are also no longer imported into your namespace

.. change::
:tags:
:tickets:

The 'Smallinteger' compatibility name (small i!) is no longer imported,
but remains in schema.py for now. SmallInteger (big I!) is still
imported.

.. change::
:tags:
:tickets:

The connection pool uses a "threadlocal" strategy internally to return
the same connection already bound to a thread, for "contextual" connections;
these are the connections used when you do a "connectionless" execution
like insert().execute(). This is like a "partial" version of the
"threadlocal" engine strategy but without the thread-local transaction part
of it. We're hoping it reduces connection pool overhead as well as
database usage. However, if it proves to impact stability in a negative way,
we'll roll it right back.

.. change::
:tags:
:tickets:

Fix to bind param processing such that "False" values (like blank strings)
still get processed/encoded.

.. change::
:tags:
:tickets: 752

Fix to select() "generative" behavior, such that calling column(),
select_from(), correlate(), and with_prefix() does not modify the
original select object

.. change::
:tags:
:tickets:

Added a "legacy" adapter to types, such that user-defined TypeEngine
and TypeDecorator classes which define convert_bind_param() and/or
convert_result_value() will continue to function. Also supports
calling the super() version of those methods.

.. change::
:tags:
:tickets:

Added session.prune(), trims away instances cached in a session that
are no longer referenced elsewhere. (A utility for strong-ref
identity maps).

.. change::
:tags:
:tickets:

Added close() method to Transaction. Closes out a transaction using
rollback if it's the outermost transaction, otherwise just ends
without affecting the outer transaction.

.. change::
:tags:
:tickets:

Transactional and non-transactional Session integrates better with
bound connection; a close() will ensure that connection
transactional state is the same as that which existed on it before
being bound to the Session.

.. change::
:tags:
:tickets: 735

Modified SQL operator functions to be module-level operators,
allowing SQL expressions to be pickleable.

.. change::
:tags:
:tickets:

Small adjustment to mapper class.__init__ to allow for Py2.6
object.__init__() behavior.

.. change::
:tags:
:tickets:

Fixed 'prefix' argument for select()

.. change::
:tags:
:tickets:

Connection.begin() no longer accepts nested=True, this logic is now
all in begin_nested().

.. change::
:tags:
:tickets:

Fixes to new "dynamic" relation loader involving cascades

.. change::
:tags: tickets, fixed
:tickets: 735



.. change::
:tags: tickets, fixed
:tickets: 752



.. changelog::

Page 44 of 50

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.