Commit Graph

6870 Commits

Author SHA1 Message Date
Mike Bayer 87bbba32bc - [feature] The behavior of column targeting
in result sets is now case sensitive by
default.   SQLAlchemy for many years would
run a case-insensitive conversion on these values,
probably to alleviate early case sensitivity
issues with dialects like Oracle and
Firebird.   These issues have been more cleanly
solved in more modern versions so the performance
hit of calling lower() on identifiers is removed.
The case insensitive comparisons can be re-enabled
by setting "case_insensitive=False" on
create_engine().  [ticket:2423]
2012-04-24 16:03:00 -04:00
Mike Bayer a66861031a - [feature] The after_attach event is now
emitted after the object is established
    in Session.new or Session.identity_map
    upon Session.add(), Session.merge(),
    etc., so that the object is represented
    in these collections when the event
    is called. [ticket:2464]
2012-04-24 15:52:09 -04:00
Mike Bayer 59ce77ca93 - [feature] the SQLite date and time types
have been overhauled to support a more open
    ended format for input and output, using
    name based format strings and regexps.  A
    new argument "microseconds" also provides
    the option to omit the "microseconds"
    portion of timestamps.  Thanks to
    Nathan Wright for the work and tests on
    this.  [ticket:2363]
2012-04-24 15:49:52 -04:00
Nathan Wright 55b4295e39 Improve SQLite DATETIME storage format handling [ticket:2363]
This breaks backwards compatibility with old SQLite DATETIME, DATE,
and TIME storage_format strings. Formatting now occurs with named instead
of positional parameters. The regexp argument can still use positional
arguments, but named groupings are also supported. This means that you can
omit fields and change the order of date fields as desired.

SQLite's DATETIME and TIME also gained a truncate_microseconds argument.
This is shorthand for modifying the format string. Fortunately the
str_to_datetime and str_to_time processors written in C already support
omitting microseconds, so we don't have to resort to python processing
for this case.
2012-03-12 21:31:12 -07:00
Nathan Wright d969d3a54a Move a SQLLite datetime test to a new DateTimeTest case 2012-03-12 15:48:29 -07:00
Mike Bayer cb15295850 - remove sqlsoup [ticket:2262]
- remove sqlalchemy.exceptions [ticket:2433]
2012-04-24 13:14:08 -04:00
Mike Bayer d4bf75c7f6 update doc version 2012-04-24 13:07:56 -04:00
Mike Bayer 503bddc879 - [bug] column.label(None) now produces an
anonymous label, instead of returning the
column object itself, consistent with the behavior
of label(column, None).  [ticket:2168]
2012-04-24 13:04:38 -04:00
Mike Bayer 71c0011574 - [feature] Added a new system
for registration of new dialects in-process
without using an entrypoint.  See the
docs for "Registering New Dialects".
[ticket:2462]
2012-04-24 13:00:30 -04:00
Mike Bayer 998c66fa8b - [feature] The column_reflect event now
accepts the Inspector object as the first
argument, preceding "table".   Code which
uses the 0.7 version of this very new
event will need modification to add the
"inspector" object as the first argument.
[ticket:2418]
2012-04-24 12:01:04 -04:00
Mike Bayer 2086728eb5 - [bug] The warning emitted when using
delete-orphan cascade with one-to-many
or many-to-many without single-parent=True
is now an error.  The ORM
would fail to function subsequent to this
warning in any case.  [ticket:2405]
2012-04-24 11:58:14 -04:00
Mike Bayer f5c98d5470 - [bug] The "passive" flag on Session.is_modified()
no longer has any effect. is_modified() in
all cases looks only at local in-memory
modified flags and will not emit any
SQL or invoke loader callables/initializers.
[ticket:2320]
2012-04-24 11:55:04 -04:00
Mike Bayer 1bab44c2ba callcount tweak here, this moved up due to r5b6237e3f068 2012-04-24 11:34:56 -04:00
Mike Bayer 9b73e997b2 - [bug] The names of the columns on the
.c. attribute of a select().apply_labels()
is now based on <tablename>_<colkey> instead
of <tablename>_<colname>, for those columns
that have a distinctly named .key.
[ticket:2397]
2012-04-24 11:24:23 -04:00
Mike Bayer 3d4c6f6816 changelog adjust 2012-04-24 11:16:24 -04:00
Mike Bayer 5c5634c04f - [bug] removed legacy behavior whereby
a column comparison to a scalar SELECT via
== would coerce to an IN with the SQL server
dialect.  This is implicit
behavior which fails in other scenarios
so is removed.  Code which relies on this
needs to be modified to use column.in_(select)
explicitly.  [ticket:2277]
2012-04-24 11:16:03 -04:00
Mike Bayer cb3913a186 - [feature] New standalone function with_polymorphic()
provides the functionality of query.with_polymorphic()
in a standalone form.   It can be applied to any
entity within a query, including as the target
of a join in place of the "of_type()" modifier.
[ticket:2333]
- redo a large portion of the inheritance docs in terms
of declarative, new with_polymorphic() function
- upgrade examples/inheritance/polymorph, rename to "joined"
2012-04-23 22:17:25 -04:00
Mike Bayer 841ea194bd - [removed] The legacy "mutable" system of the
ORM, including the MutableType class as well
as the mutable=True flag on PickleType
and postgresql.ARRAY has been removed.
In-place mutations are detected by the ORM
using the sqlalchemy.ext.mutable extension,
introduced in 0.7.   The removal of MutableType
and associated constructs removes a great
deal of complexity from SQLAlchemy's internals.
The approach performed poorly as it would incur
a scan of the full contents of the Session
when in use. [ticket:2442]
2012-04-23 18:59:17 -04:00
Mike Bayer 101da94e12 the callcounts are greater here since object_mapper() has a little more overhead to it now 2012-04-23 18:53:58 -04:00
Mike Bayer ee5dd855a7 - some adjustments to keep hybrid properties working
- callcount here seems to have gone up by five, reason not certain
2012-04-23 12:48:26 -04:00
Mike Bayer 54017d9de2 merge patch for [ticket:2208]. This still needs documentation. 2012-04-23 12:03:54 -04:00
Mike Bayer 8f35f7a803 - re-merge + CHANGES 2012-04-23 11:50:47 -04:00
Mike Bayer ff0fb31bf2 - merge attribute flag overhaul for [ticket:2358] 2012-04-23 11:45:06 -04:00
Mike Bayer 713a4e19fa - merged #1401 branch from bitbucket
- resolved some serious speed hits I missed, we need to ensure
only deannotated columns are used in the local/remote collections and soforth
so that hash lookups against mapped columns don't dig into __eq__()
- fix some other parity mismatches regarding stuff from [ticket:2453],
including finding another case where _deep_annotate() was doing the wrong thing,
new tests.
- [feature] Major rewrite of relationship()
internals now allow join conditions which
include columns pointing to themselves
within composite foreign keys.   A new
API for very specialized primaryjoin conditions
is added, allowing conditions based on
SQL functions, CAST, etc. to be handled
by placing the annotation functions
remote() and foreign() inline within the
expression when necessary.  Previous recipes
using the semi-private _local_remote_pairs
approach can be upgraded to this new
approach. [ticket:1401]
2012-04-22 19:43:31 -04:00
Mike Bayer 02e8d401fe 0.8 initial prep 2012-04-22 18:10:47 -04:00
Mike Bayer 8719cf3653 - [bug] Fixed bug in 0.7.6 introduced by
[ticket:2409] whereby column_mapped_collection
used against columns that were mapped as
joins or other indirect selectables
would fail to function.

Here, the serialize use case has gotten very complex since to
really target a column we'd need the root MetaData object,
then if we're hitting Alias objects and such there's really
nothing to hold onto.  Short of building a system where
Column objects have some kind of master hash identifier that
is consistently generated, the way this works can't really
suit every case - much easier would be to change the mechanics
of collections.py to make available the Mapper to the
collection adapter when it's first invoked.
2012-04-19 12:31:15 -04:00
Mike Bayer 541e59c3d7 - [bug] UPDATE..FROM syntax with SQL Server
requires that the updated table be present
in the FROM clause when an alias of that
table is also present in the FROM clause.
The updated table is now always present
in the FROM, when FROM is present
in the first place.  Courtesy sayap.
[ticket:2468]
2012-04-18 19:52:58 -04:00
Mike Bayer fdda4b0e01 - mysql [bug] Fixed bug whereby if cast() is used
on a SQL expression whose type is not supported
by cast() and therefore CAST isn't rendered by
the dialect, the order of evaluation could change
if the casted expression required that it be
grouped; grouping is now applied to those
expressions.  [ticket:2467]
2012-04-16 12:08:32 -04:00
Mike Bayer ad9c893dc8 Merged in bentrofatter/sqlalchemy-informix-dialect-fix (pull request #7) 2012-04-12 18:25:11 -04:00
Mike Bayer 9273cdd638 - [bug] If conn.begin() fails when calling
"with engine.begin()", the newly acquired
Connection is closed explicitly before
propagating the exception onward normally.
2012-04-12 14:38:52 -04:00
Benjamin Trofatter 5f6a930784 Changed misspelled 'altere' reserved word to 'alter' 2012-04-12 12:24:50 -05:00
Mike Bayer 3d66f727f5 - test explicitly for 'VIEW', 'SYSTEM VIEW'
- move the test to the reflection tests
2012-04-12 12:21:02 -04:00
Mike Bayer ba199ce80c Merged in elazar/sqlalchemy/fix/mysql-system-views (pull request #6) 2012-04-12 12:16:48 -04:00
elazar 9596595dcf Fixed test_system_views not checking for MySQL >= 5.0.0 as information_schema support is not available in previous versions 2012-04-12 07:35:49 -05:00
elazar 01087224ce Modified MySQLDialect.get_view_names() to also return system views such as those in information_schema 2012-04-11 21:32:00 -05:00
Mike Bayer 747f5edd21 - [feature] Added new flag to @validates
include_removes.  When True, collection
remove and attribute del events
will also be sent to the validation function,
which accepts an additional argument
"is_remove" when this flag is used.
2012-04-11 13:03:52 -04:00
Mike Bayer 5280f26d45 - [feature] Added new connection event
dbapi_error(). Is called for all DBAPI-level
errors passing the original DBAPI exception
before SQLAlchemy modifies the state
of the cursor.
2012-04-10 19:38:22 -04:00
Mike Bayer 3269b73ff7 - adjust mysql patch a bit so that we use
built in quoting for the "idx_" name as well
- [bug] Fixed bug whereby column name inside
of "KEY" clause for autoincrement composite
column with InnoDB would double quote a
name that's a reserved word.  Courtesy Jeff
Dairiki. [ticket:2460]
2012-04-08 11:18:39 -04:00
Jeff Dairiki b7abf86f72 Fix innodb autoinc constraint (double)quoting 2012-04-06 21:55:39 -07:00
Mike Bayer 4cb74452fe - [bug] Repaired the use_scope_identity
create_engine() flag when using the pyodbc
    dialect.  Previously this flag would be
    ignored if set to False.  When set to False,
    you'll get "SELECT @@identity" after each
    INSERT to get at the last inserted ID,
    for those tables which have "implicit_returning"
    set to False.
2012-04-05 14:31:28 -04:00
Mike Bayer f7bb3b17e6 - the inspect interface is done, needs docs.
- start dressing up InstanceState for it's coming out, start moving
internal things to be underscored within the lib
2012-04-04 19:08:05 -04:00
Mike Bayer 60922f7a99 merge fix 2012-04-03 18:55:10 -04:00
Mike Bayer f1bdd4e4bb begin implementing inspection system for #2208 2012-04-03 18:53:39 -04:00
Diana Clarke 879e6bc462 Fixing link to python's logging module (see #2456). Thanks astrochase! 2012-04-03 17:40:51 -04:00
Mike Bayer 35adeb95bf then spiff up that error msg 2012-04-03 11:24:16 -04:00
Mike Bayer abcef12534 every test passing for test_relationships 2012-04-03 11:14:14 -04:00
Mike Bayer 53b4337de3 Merged in _diana_/sqlalchemy-2385 (pull request #4) 2012-04-03 10:34:48 -04:00
Mike Bayer 1378bf0d25 - reopened #2453, needed to put in the original patch as well to cover the case
of column_property() objs building off each other
2012-04-03 09:59:22 -04:00
Diana Clarke 8b16cd876c make auto-correlation the same for Query & select() 2012-04-02 21:42:17 -04:00
Diana Clarke a122db80f2 most of the drizzle docs are copy/pasta, let's just point users to the mysql docs and enhance as questions arise
- see #2385
2012-04-02 21:20:16 -04:00