Commit Graph

2162 Commits

Author SHA1 Message Date
Mike Bayer 690f484f5c - move all CHANGES files into the sphinx docs. this is rudimental now
but puts the changelog in a more data driven format, so that we
can begin linking version directives with them as well
as with migration documents, once those are also moved into sphinx.
2012-10-20 18:28:02 -04:00
Mike Bayer 675558bffb - rework the sphinx customizations into distinct modules
- build a new Sphinx extension that allows dialect info
to be entered as directives which is then rendered consistently
throughout all dialect/dbapi sections
- break out the "empty_strings" requirement for oracle test
2012-10-19 19:20:18 -04:00
Mike Bayer 017989ce8b - move out maxdb
- begin consolidating docs for dialects to be more self contained
- add a separate section for "external" dialects
- not sure how we're going to go with this yet.
2012-10-18 18:24:15 -04:00
Mike Bayer ba67f7dbc5 - [bug] TypeDecorator now includes a generic repr()
that works in terms of the "impl" type by default.
    This is a behavioral change for those TypeDecorator
    classes that specify a custom __init__ method; those
    types will need to re-define __repr__() if they need
    __repr__() to provide a faithful constructor representation.
    [ticket:2594]
2012-10-18 12:29:41 -04:00
Mike Bayer 2484ef34c2 - [feature] The Query can now load entity/scalar-mixed
"tuple" rows that contain
    types which aren't hashable, by setting the flag
    "hashable=False" on the corresponding TypeEngine object
    in use.  Custom types that return unhashable types
    (typically lists) can set this flag to False.
    [ticket:2592]
  - [bug] Applying a column expression to a select
    statement using a label with or without other
    modifying constructs will no longer "target" that
    expression to the underlying Column; this affects
    ORM operations that rely upon Column targeting
    in order to retrieve results.  That is, a query
    like query(User.id, User.id.label('foo')) will now
    track the value of each "User.id" expression separately
    instead of munging them together.  It is not expected
    that any users will be impacted by this; however,
    a usage that uses select() in conjunction with
    query.from_statement() and attempts to load fully
    composed ORM entities may not function as expected
    if the select() named Column objects with arbitrary
    .label() names, as these will no longer target to
    the Column objects mapped by that entity.
    [ticket:2591]
2012-10-15 20:07:13 -04:00
Mike Bayer af3c8a75c8 - allow a __clause_element__() to be passed to query.filter() also 2012-10-15 18:13:33 -04:00
Mike Bayer c307df6596 - [feature] "scalar" selects now have a WHERE method
to help with generative building.  Also slight adjustment
    regarding how SS "correlates" columns; the new methodology
    no longer applies meaning to the underlying
    Table column being selected.  This improves
    some fairly esoteric situations, and the logic
    that was there didn't seem to have any purpose.
  - [feature] Some support for auto-rendering of a
    relationship join condition based on the mapped
    attribute, with usage of core SQL constructs.
    E.g. select([SomeClass]).where(SomeClass.somerelationship)
    would render SELECT from "someclass" and use the
    primaryjoin of "somerelationship" as the WHERE
    clause.   This changes the previous meaning
    of "SomeClass.somerelationship" when used in a
    core SQL context; previously, it would "resolve"
    to the parent selectable, which wasn't generally
    useful.  Related to [ticket:2245].
2012-10-15 17:21:38 -04:00
Mike Bayer c30e6d063e - [feature] Improvements to event listening for
mapped classes allows that unmapped classes
    can be specified for instance- and mapper-events.
    The established events will be automatically
    set up on subclasses of that class when the
    propagate=True flag is passed, and the
    events will be set up for that class itself
    if and when it is ultimately mapped.
    [ticket:2585]

  - [bug] The instrumentation events class_instrument(),
    class_uninstrument(), and attribute_instrument()
    will now fire off only for descendant classes
    of the class assigned to listen().  Previously,
    an event listener would be assigned to listen
    for all classes in all cases regardless of the
    "target" argument passed.  [ticket:2590]
2012-10-12 17:21:08 -04:00
Mike Bayer 084b559b44 - [feature] Added "collation" parameter to all
String types.  When present, renders as
    COLLATE <collation>.  This to support the
    COLLATE keyword now supported by several
    databases including MySQL, SQLite, and Postgresql.
    [ticket:2276]

  - [change] The Text() type renders the length
    given to it, if a length was specified.
2012-10-10 19:34:29 -04:00
Mike Bayer ce2c450917 - [feature] Added TIME type to mysql dialect,
accepts "fst" argument which is the new
    "fractional seconds" specifier for recent
    MySQL versions.  The datatype will interpret
    a microseconds portion received from the driver,
    however note that at this time most/all MySQL
    DBAPIs do not support returning this value.
    [ticket:2534]
- attempted to modernize the types tests in test_mysql a little, though has a long
way to go
2012-10-10 14:25:21 -04:00
Mike Bayer b7ecadfbde - changelog update, added 0.7's version of [ticket:2561] and also
r74618cabb1cb referred to the wrong ticket.
2012-10-10 13:26:00 -04:00
Mike Bayer ec538d3555 - [feature] Added "read_timeout" flag to MySQLdb
dialect.  [ticket:2554]
2012-10-10 13:15:16 -04:00
Mike Bayer 17936043c6 - [feature] Added "raise_on_warnings" flag to OurSQL
dialect.  [ticket:2523]
2012-10-10 13:13:41 -04:00
Mike Bayer 0a6e2d9b36 - [feature] Various API tweaks to the "dialect"
API to better support highly specialized
    systems such as the Akiban database, including
    more hooks to allow an execution context to
    access type processors.
2012-10-08 14:41:35 -04:00
Mike Bayer ab59e3e113 - [bug] Continuing [ticket:2566] regarding extra
state post-flush due to event listeners;
    any states that are marked as "dirty" from an
    attribute perspective, usually via column-attribute
    set events within after_insert(), after_update(),
    etc., will get the "history" flag reset
    in all cases, instead of only those instances
    that were part of the flush.  This has the effect
    that this "dirty" state doesn't carry over
    after the flush and won't result in UPDATE
    statements.   A warning is emitted to this
    effect; the set_committed_state()
    method can be used to assign attributes on objects
    without producing history events. [ticket:2582]
2012-10-06 12:46:02 -04:00
Mike Bayer 1c3e322552 - [feature] The Session will produce warnings
when unsupported methods are used inside the
    "execute" portion of the flush.   These are
    the familiar methods add(), delete(), etc.
    as well as collection and related-object
    manipulations, as called within mapper-level
    flush events
    like after_insert(), after_update(), etc.
    It's been prominently documented for a long
    time that  SQLAlchemy cannot guarantee
    results when the Session is manipulated within
    the execution of the flush plan,
    however users are still doing it, so now
    there's a warning.   Maybe someday the Session
    will be enhanced to support these operations
    inside of the flush, but for now, results
    can't be guaranteed.
2012-10-04 13:50:36 -04:00
Mike Bayer d778b2d6fb - [bug] Fixed Session accounting bug whereby replacing
a deleted object in the identity map with another
    object of the same primary key would raise a
   "conflicting state" error on rollback(),
    if the replaced primary key were established either
    via non-unitofwork-established INSERT statement
    or by primary key switch of another instance.
    [ticket:2583]
2012-10-03 10:52:14 -04:00
Mike Bayer 0bb5a9eab8 - fix the fixture here that wasn't creating consistently
- rewrite --dropfirst to be more industrial strength, includes views
- fix order_by="foreign_key" to maintain the same ordering as
metadata.sorted_tables.   Not ideal that this was the other way throughout
0.7 but this is still a little-used method, in contrast to metadata.sorted_tables.
2012-10-01 01:59:59 -04:00
Mike Bayer fab9be5d0e - [feature] the MS Access dialect has been
moved to its own project on Bitbucket,
    taking advantage of the new SQLAlchemy
    dialect compliance suite.   The dialect is
    still in very rough shape and probably not
    ready for general use yet, however
    it does have *extremely* rudimental
    functionality now.
2012-09-30 20:17:49 -04:00
Mike Bayer 502152de2a mssql: - [bug] Fixed bug where reflection of primary key constraint
would double up columns if the same constraint/table
    existed in multiple schemas.
- force returns_rows to False for inserts where we know rows shouldnt be returned;
allows post_exec() to use the cursor without issue
2012-09-30 18:23:21 -04:00
Mike Bayer 62b7a8133a - [bug] Fixed bug in over() construct whereby
passing an empty list for either partition_by
    or order_by, as opposed to None, would fail
    to generate correctly.
    Courtesy Gunnlaugur Por Briem.
    [ticket:2574]
2012-09-30 17:18:14 -04:00
Mike Bayer e35a6b91d6 - [bug] Fixed compiler bug whereby using a correlated
subquery within an ORDER BY would fail to render correctly
    if the stament also used LIMIT/OFFSET, due to mis-rendering
    within the ROW_NUMBER() OVER clause.  Fix courtesy
    sayap [ticket:2538]
2012-09-30 16:57:23 -04:00
Mike Bayer bba1d01b26 - [bug] The CreateIndex construct in Oracle
will now schema-qualify the name of the index
    to be that of the parent table.  Previously this
    name was omitted which apparently creates the
    index in the default schema, rather than that
    of the table.
2012-09-30 20:00:46 +00:00
Mike Bayer b9ea55f861 - more tests, move some tests out of test_reflection, test_query 2012-09-27 16:11:32 -04:00
Mike Bayer 0c7b989ce5 - [feature] Added support for the localtimestamp()
SQL function implemented in SQLite, courtesy
Richard Mitchell.  Added test
2012-09-26 10:20:56 -04:00
Mike Bayer 21fb19e2c6 - [bug] Added 'terminating connection' to the list
of messages we use to detect a disconnect with PG, which
    appears to be present in some versions when the server
    is restarted.  [ticket:2570]
2012-09-25 16:54:50 -04:00
Mike Bayer c7c17e991c - [bug] Fixed the DropIndex construct to support
an Index associated with a Table in a remote
    schema. [ticket:2571]
2012-09-24 11:17:16 -04:00
Mike Bayer 20fe4a012e - [feature] An experimental dialect for the fdb
driver is added, but is untested as I cannot
get the fdb package to build.  [ticket:2504]
2012-09-23 18:30:16 -04:00
Mike Bayer 444abbe847 - got firebird running
- add some failure cases
- [bug] Firebird now uses strict "ansi bind rules"
so that bound parameters don't render in the
columns clause of a statement - they render
literally instead.

- [bug] Support for passing datetime as date when
using the DateTime type with Firebird; other
dialects support this.
2012-09-23 18:09:18 -04:00
Mike Bayer e1d09859c5 - [bug] Columns in reflected primary key constraint
are now returned in the order in which the constraint
    itself defines them, rather than how the table
    orders them.  Courtesy Gunnlaugur Por Briem.
    [ticket:2531].
2012-09-23 13:42:24 -04:00
Mike Bayer 152163b333 - [bug] When the primary key column of a Table
is replaced, such as via extend_existing,
    the "auto increment" column used by insert()
    constructs is reset.  Previously it would
    remain referring to the previous primary
    key column.  [ticket:2525]
2012-09-23 12:51:24 -04:00
Mike Bayer e354dd10f8 - [feature] An explicit error is raised when
a ForeignKeyConstraint() that was
    constructed to refer to multiple remote tables
    is first used. [ticket:2455]
2012-09-23 12:42:38 -04:00
Mike Bayer c7ab095fdb - [bug] Adjusted column default reflection code to
convert non-string values to string, to accommodate
old SQLite versions that don't deliver
default info as a string.  [ticket:2265]
- factor sqlite column reflection to be like we did for postgresql,
in a separate method.
2012-09-23 11:30:07 -04:00
Mike Bayer d345789fa5 move this to 0.8 2012-09-22 16:53:17 -04:00
Mike Bayer 23d300c874 - [bug] A tweak to column precedence which moves the
"concat" and "match" operators to be the same as
    that of "is", "like", and others; this helps with
    parenthesization rendering when used in conjunction
    with "IS". [ticket:2564]
2012-09-22 16:48:49 -04:00
Mike Bayer 1ceda8c23c - [bug] Added missing operators is_(), isnot()
to the ColumnOperators base, so that these long-available
    operators are present as methods like all
    the other operators.  [ticket:2544]
2012-09-22 16:14:58 -04:00
Mike Bayer 03cb8ce548 - [bug] Extra logic has been added to the "flush"
that occurs within Session.commit(), such that the
    extra state added by an after_flush() or
    after_flush_postexec() hook is also flushed in a
    subsequent flush, before the "commit" completes.
    Subsequent calls to flush() will continue until
    the after_flush hooks stop adding new state.
    An "overflow" counter of 100 is also in place,
    in the event of a broken after_flush() hook
    adding new content each time. [ticket:2566]
2012-09-22 16:03:57 -04:00
Mike Bayer 7e815c67a9 finished fixes for mxodbc; need to use at least version 3.2.1 2012-09-21 17:43:22 -04:00
Mike Bayer 248cf4c5d2 - [feature] New session events after_transaction_create
and after_transaction_end
    allows tracking of new SessionTransaction objects.
    If the object is inspected, can be used to determine
    when a session first becomes active and when
    it deactivates.
2012-09-20 18:39:27 -04:00
Mike Bayer 9e3458c479 - [bug] Adjusted a very old bugfix which attempted
to work around a SQLite issue that itself was
    "fixed" as of sqlite 3.6.14, regarding quotes
    surrounding a table name when using
    the "foreign_key_list" pragma.  The fix has been
    adjusted to not interfere with quotes that
    are *actually in the name* of a column or table,
    to as much a degree as possible; sqlite still
    doesn't return the correct result for foreign_key_list()
    if the target table actually has quotes surrounding
    its name, as *part* of its name (i.e. """mytable""").
    [ticket:2568]
2012-09-19 00:34:30 -04:00
Mike Bayer b76995600a - [bug] Fixed bug where incorrect type information
would be passed when the ORM would bind the
"version" column, when using the "version" feature.
Tests courtesy Daniel Miller.  [ticket:2539]
2012-09-16 21:15:55 -04:00
Mike Bayer 6a3e993490 - genericize the test for ischema_names
- some fixes to the patch to handle empty args, whitespace
- changelog clarifies where this API fits at the moment
2012-09-16 17:43:21 -04:00
Mike Bayer 062f0a202a - [bug] Fixed a disconnect that slowly evolved
between a @declared_attr Column and a
directly-defined Column on a mixin. In both
cases, the Column will be applied to the
declared class' table, but not to that of a
joined inheritance subclass.   Previously,
the directly-defined Column would be placed
on both the base and the sub table, which isn't
typically what's desired.  [ticket:2565]
2012-09-14 21:58:19 -04:00
Mike Bayer f2622c0c53 - [bug] CompileError is raised when VARCHAR with
no length is attempted to be emitted, same
way as MySQL. [ticket:2505]
2012-09-10 17:02:31 -04:00
Mike Bayer cd8b9dcd37 - [feature] The cast() and extract() constructs
will now be produced via the func.* accessor
as well, as users naturally try to access these
names from func.* they might as well do
what's expected, even though the returned
object is not a FunctionElement.
[ticket:2562]
2012-09-10 12:58:11 -04:00
Mike Bayer 1c325dc9c7 - [feature] Added a hook to the system of rendering
CREATE TABLE that provides access to the render for each
Column individually, by constructing a @compiles
function against the new schema.CreateColumn
construct.  [ticket:2463]
2012-09-09 14:39:25 -04:00
Mike Bayer d3e60f805d - [feature] The types of columns excluded from the
setinputsizes() set can be customized by sending
    a list of string DBAPI type names to exclude.
   This list was previously fixed.  The list also
    now defaults to STRING, UNICODE, removing
    CLOB, NCLOB from the list.  [ticket:2469]
2012-09-05 18:11:33 -04:00
Mike Bayer bc9ff8fcc9 lshift (<<) and rshift (>>) are also supported as optional operators. 2012-09-04 10:44:37 -04:00
Mike Bayer 51f1fdf3e4 - [bug] Fixed a regression since 0.6 regarding
result-row targeting.   It should be possible
    to use a select() statement with string
    based columns in it, that is
    select(['id', 'name']).select_from('mytable'),
    and have this statement be targetable by
    Column objects with those names; this is the
    mechanism by which
    query(MyClass).from_statement(some_statement)
    works.  At some point the specific case of
    using select(['id']), which is equivalent to
    select([literal_column('id')]), stopped working
    here, so this has been re-instated and of
    course tested. [ticket:2558]
2012-08-31 20:04:04 -04:00
Mike Bayer 7d6c1c4a95 - [feature] Reworked the startswith(), endswith(),
contains() operators to do a better job with
    negation (NOT LIKE), and also to assemble them
    at compilation time so that their rendered SQL
    can be altered, such as in the case for Firebird
    STARTING WITH [ticket:2470]
  - [feature] firebird - The "startswith()" operator renders
    as "STARTING WITH", "~startswith()" renders
    as "NOT STARTING WITH", using FB's more efficient
    operator.  [ticket:2470]
2012-08-27 19:40:12 -04:00