summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql.py
Commit message (Collapse)AuthorAgeFilesLines
...
* - _Label class overrides compare_self to return its ultimate object.Mike Bayer2007-05-031-0/+3
| | | | | meaning, if you say someexpr.label('foo') == 5, it produces the correct "someexpr == 5".
* - Aliasizer removed. hooray !Mike Bayer2007-05-021-1/+15
| | | | - ClauseVisitor has handy chain() method.
* - applied YAGNI to supports_autoclose_results (this issue would be handled ↵Mike Bayer2007-04-301-4/+4
| | | | | | by BufferedColumnResultProxy) - the docstrings, they do not end
* - restored old "column_property()" ORM function (used to be calledMike Bayer2007-04-291-1/+1
| | | | | | | "column()") to force any column expression to be added as a property on a mapper, particularly those that aren't present in the mapped selectable. this allows "scalar expressions" of any kind to be added as relations (though they have issues with eager loads).
* - the label() method on ColumnElement will properly propigate theMike Bayer2007-04-291-1/+1
| | | | | TypeEngine of the base element out to the label, including a label() created from a scalar=True select() statement.
* added orig_set colleciton to Select when its declared as a scalar, to allowMike Bayer2007-04-291-1/+5
| | | | corresponding_column() to return a result
* docstring tweaksMike Bayer2007-04-291-6/+6
|
* - fixed textual select elements that got broke the other dayMike Bayer2007-04-291-2/+12
| | | | - docstring work
* - support for inline hyperlinks between HTML-generated docstringsMike Bayer2007-04-281-204/+410
| | | | - docstrings for all sql package functions including cross linking.
* - primary key determination within Join maintains table PK orderingMike Bayer2007-04-241-1/+1
|
* - fix to case() construct to propigate the type of the firstMike Bayer2007-04-241-1/+12
| | | | | WHEN condition as the return type of the case statement - various unit test tweaks to get oracle working
* - some docstringsMike Bayer2007-04-201-15/+155
| | | | - some more test scenarios for raw bind params
* - merged in the combined patch for #474, #475, #476 (attached to #476) and a ↵Jason Kirtland2007-04-191-13/+33
| | | | new set of tests
* some docstringsMike Bayer2007-04-191-0/+1
|
* - the "where" criterion of an update() and delete() now correlatesMike Bayer2007-04-181-5/+21
| | | | | | | embedded select() statements against the table being updated or deleted. this works the same as nested select() statement correlation, and can be disabled via the correlate=False flag on the embedded select().
* - got unicode schemas to work with postgresMike Bayer2007-04-151-2/+6
| | | | | - unicode schema with mysql slightly improved, still cant do has_table - got reflection of unicode schemas working with sqlite, pg, mysql
* didnt need that method...Mike Bayer2007-04-141-10/+0
|
* some docstrings to provide more detail in the sql packageMike Bayer2007-04-141-13/+86
|
* - the "mini" column labels generated when using subqueries, whichMike Bayer2007-04-111-2/+19
| | | | | | | | are to work around glitchy SQLite behavior that doesnt understand "foo.id" as equivalent to "id", are now only generated in the case that those named columns are selected from (part of [ticket:513]) - MS-SQL better detects when a query is a subquery and knows not to generate ORDER BY phrases for those [ticket:513]
* - some cleanup of reflection unit testsMike Bayer2007-04-041-0/+3
| | | | | | - removed silly behavior where sqlite would reflect UNIQUE indexes as part of the primary key (?!) - added __contains__ support to ColumnCollection; contains_column() method should be removed
* - merged the "execcontext" branch, refactors engine/dialect codepathsMike Bayer2007-04-021-1/+1
| | | | | | | | | | | | | | | | | | | | - much more functionality moved into ExecutionContext, which impacted the API used by dialects to some degree - ResultProxy and subclasses now designed sanely - merged patch for #522, Unicode subclasses String directly, MSNVarchar implements for MS-SQL, removed MSUnicode. - String moves its "VARCHAR"/"TEXT" switchy thing into "get_search_list()" function, which VARCHAR and CHAR can override to not return TEXT in any case (didnt do the latter yet) - implements server side cursors for postgres, unit tests, #514 - includes overhaul of dbapi import strategy #480, all dbapi importing happens in dialect method "dbapi()", is only called inside of create_engine() for default and threadlocal strategies. Dialect subclasses have a datamember "dbapi" referencing the loaded module which may be None. - added "mock" engine strategy, doesnt require DBAPI module and gives you a "Connecition" which just sends all executes to a callable. can be used to create string output of create_all()/drop_all().
* latest #214 fixupsMike Bayer2007-03-311-36/+91
|
* added keys() to ColumnParameters, needed for setbindparamsizes traversalMike Bayer2007-03-281-1/+4
|
* - sending None as an argument to func.<something> will produceMike Bayer2007-03-281-1/+1
| | | | an argument of NULL
* - column label and bind param "truncation" also generateMike Bayer2007-03-281-16/+34
| | | | | | | | | | | deterministic names now, based on their ordering within the full statement being compiled. this means the same statement will produce the same string across application restarts and allowing DB query plan caching to work better. - cleanup to sql.ClauseParameters since it was just falling apart, API made more explicit - many unit test tweaks to adjust for bind params not being "pre" truncated, changes to ClauseParameters
* added label truncation for bind param names which was lost in the previous ↵Mike Bayer2007-03-281-3/+3
| | | | | | related commit. added more tests plus test for column targeting with text() clause.
* some more docstring patches for [ticket:214]Mike Bayer2007-03-281-9/+15
|
* - fixes [ticket:185], join object determines primary key and removesMike Bayer2007-03-271-17/+47
| | | | | | | | columns that are FK's to other columns in the primary key collection. - removed workaround code from query.py get() - removed obsolete inheritance test from mapper - added new get() test to inheritance.py for this particular issue - ColumnCollection has nicer string method
* - some logging cleanupMike Bayer2007-03-271-1/+3
| | | | - added 'encodedname' prop to a few ClauseElements to aid logging
* - preliminary support for unicode table and column names added.Mike Bayer2007-03-271-3/+10
|
* - column labels are now generated in the compilation phase, whichMike Bayer2007-03-241-3/+13
| | | | | | | | | | | | | | | means their lengths are dialect-dependent. So on oracle a label that gets truncated to 30 chars will go out to 63 characters on postgres. Also, the true labelname is always attached as the accessor on the parent Selectable so theres no need to be aware of the genrerated label names [ticket:512]. - ResultProxy column targeting is greatly simplified, and relies upon the ANSICompiler's column_labels map to translate the built-in label on a _ColumnClause (which is now considered to be a unique identifier of that column) to the label which was generated at compile time. - still need to put a baseline of ColumnClause targeting for ResultProxy objects that originated from a textual query.
* - slightly better support for bind params as column clauses, eitherMike Bayer2007-03-211-9/+10
| | | | | | | | | | | | | | via bindparam() or via literal(), i.e. select([literal('foo')]) - removed "table" argument from column(). this does not add the column to the table anyway so was misleading. - Select _exportable_columns() only exports Selectable instances - Select uses _exportable_columns() when searching for engines instead of _raw_columns for similar reasons (non selectables have no engine) - _BindParamClause no longer has a _make_proxy(). its not a ColumnElement. - _Label detects underlying column element and will generate its own column()._make_proxy() if the element is not a ColumnElement. this allows a Label to be declared for nearly anything and it can export itself as a column on a containing Selectable.
* integrated docutils formatting into generated documentation;Mike Bayer2007-03-171-14/+16
| | | | restructuredtext fixes throughout docstrings
* fix CASE statement when else_ is zeroRick Morrison2007-03-151-1/+1
|
* some formattingMike Bayer2007-03-131-5/+23
|
* - for hackers, refactored the "visitor" system of ClauseElement andMike Bayer2007-03-111-96/+206
| | | | | | | | | | | | | | | SchemaItem so that the traversal of items is controlled by the ClauseVisitor itself, using the method visitor.traverse(item). accept_visitor() methods can still be called directly but will not do any traversal of child items. ClauseElement/SchemaItem now have a configurable get_children() method to return the collection of child elements for each parent object. This allows the full traversal of items to be clear and unambiguous (as well as loggable), with an easy method of limiting a traversal (just pass flags which are picked up by appropriate get_children() methods). [ticket:501] - accept_schema_visitor() methods removed, replaced with get_children(schema_visitor=True) - various docstring/changelog cleanup/reformatting
* - added concept of 'require_embedded' to corresponding_column.Mike Bayer2007-03-051-8/+28
| | | | | | | | | | | | requires that the target column be present in a sub-element of the target selectable. - embedded logic above more appropriate for ClauseAdapter functionality since its trying to "pull up" clauses that represent columns within a larger union up to the level of the union itself. - the "direction" test against the "foreign_keys" collection apparently works for an exact "column 'x' is present in the collection", no proxy relationships needed. fixes the case of relating a selectable/alias to one of its underlying tables, probably fixes other scenarios
* - bindparam() names are now repeatable! specify twoMike Bayer2007-03-031-16/+33
| | | | | | | | | distinct bindparam()s with the same name in a single statement, and the key will be shared. proper positional/named args translate at compile time. for the old behavior of "aliasing" bind parameters with conflicting names, specify "unique=True" - this option is still used internally for all the auto-genererated (value-based) bind parameters.
* - added "fold_equivalents" argument to Join.select(), which removesMike Bayer2007-03-021-3/+50
| | | | | | | | | | | | 'duplicate' columns from the resulting column clause that are known to be equivalent based on the join condition. this is of great usage when constructing subqueries of joins which Postgres complains about if duplicate column names are present. - added support to polymorphic stuff for more than one "equivalent column", when trying to target columns in the polymorphic union; this applies to multi-leveled inheritance - put above-two concepts together to get the abc_inheritance tests to work with postgres
* - use_labels flag on select() wont auto-create labels for literal textMike Bayer2007-03-011-3/+18
| | | | | | | | column elements, since we can make no assumptions about the text. to create labels for literal columns, you can say "somecol AS somelabel", or use literal_column("somecol").label("somelabel") - quoting wont occur for literal columns when they are "proxied" into the column collection for their selectable (is_literal flag is propigated)
* migrated (most) docstrings to pep-257 format, docstring generator using ↵Mike Bayer2007-02-251-376/+820
| | | | | | straight <pre> + trim() func for now. applies most of [ticket:214], compliemnts of Lele Gaifax
* - correlated subqueries work inside of ORDER BY, GROUP BYMike Bayer2007-02-241-4/+13
|
* - exists() becomes useable as a standalone selectable, not just in aMike Bayer2007-02-231-4/+11
| | | | WHERE clause
* - implemented foreign_keys argument on relation() [ticket:385]Mike Bayer2007-02-101-1/+1
| | | | | | | - PropertyLoader figures out accurate remote_side collection based on foreign_keys, legacy foreignkey, primary/secondaryjoin/polymorphic - reworked lazyloader, sync to work straight off foreign_keys/ remote_side collections
* - added literal_column() to specify a column clause that should not undergo ↵Mike Bayer2007-02-041-5/+10
| | | | | | | any quoting - straight text sent to select() added as literal_column - fix for issue in [ticket:450]
* OK nevermind that last commit, rolling the quoting fix backMike Bayer2007-02-041-1/+1
|
* - more quoting fixes for [ticket:450]...quoting more aggressive (but still ↵Mike Bayer2007-02-041-5/+6
| | | | | | | | skips already-quoted literals) - got mysql to have "format" as default paramstyle even if mysql module not available, allows unit tests to pass in non-mysql system for [ticket:457]. all the dialects should be changed to pass in their usual paramstyle.
* - added a "supports_execution()" method to ClauseElement, so that individualMike Bayer2007-02-021-3/+15
| | | | | kinds of clauses can express if they are appropriate for executing...such as, you can execute a "select", but not a "Table" or a "Join".
* removed various print statementsMike Bayer2007-01-281-1/+0
|
* merged the polymorphic relationship refactoring branch in. i want to go ↵Mike Bayer2007-01-281-1/+7
| | | | | | | | | | | | | further on that branch and introduce the foreign_keys argument, and further centralize the "intelligence" about the joins and selectables into PropertyLoader so that lazyloader/sync can be simplified, but the current branch goes pretty far. - relations keep track of "polymorphic_primaryjoin", "polymorphic_secondaryjoin" which it derives from the plain primaryjoin/secondaryjoin. - lazy/eagerloaders work from those polymorphic join objects. - the join exported by PropertyLoader to Query/SelectResults is the polymorphic join, so that join_to/etc work properly. - Query builds itself against the base Mapper again, not the "polymorphic" mapper. uses the "polymorphic" version only as appropriate. this helps join_by/join_to/etc to work with polymorphic mappers. - Query will also adapt incoming WHERE criterion to the polymorphic mapper, i.e. the "people" table becomes the "person_join" automatically. - quoting has been modified since labels made out of non-case-sensitive columns could themselves require quoting..so case_sensitive defaults to True if not otherwise specified (used to be based on the identifier itself). - the test harness gets an ORMTest base class and a bunch of the ORM unit tests are using it now, decreases a lot of redundancy.