summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/ansisql.py
Commit message (Collapse)AuthorAgeFilesLines
* 1. Module layout. sql.py and related move into a package called "sql".Mike Bayer2007-08-181-1156/+0
| | | | | | | | | | | | 2. compiler names changed to be less verbose, unused classes removed. 3. Methods on Dialect which return compilers, schema generators, identifier preparers have changed to direct class references, typically on the Dialect class itself or optionally as attributes on an individual Dialect instance if conditional behavior is needed. This takes away the need for Dialect subclasses to know how to instantiate these objects, and also reduces method overhead by one call for each one. 4. as a result of 3., some internal signatures have changed for things like compiler() (now statement_compiler()), preparer(), etc., mostly in that the dialect needs to be passed explicitly as the first argument (since they are just class references now). The compiler() method on Engine and Connection is now also named statement_compiler(), but as before does not take the dialect as an argument. 5. changed _process_row function on RowProxy to be a class reference, cuts out 50K method calls from insertspeed.py
* - modified SQL operator functions to be module-level operators, allowingMike Bayer2007-08-181-35/+35
| | | | | | | SQL expressions to be pickleable [ticket:735] - small adjustment to mapper class.__init__ to allow for Py2.6 object.__init__() behavior
* - merged "fasttypes" branch. this branch changes the signatureMike Bayer2007-08-141-15/+5
| | | | | | | | | | | | | of convert_bind_param() and convert_result_value() to callable-returning bind_processor() and result_processor() methods. if no callable is returned, no pre/post processing function is called. - hooks added throughout base/sql/defaults to optimize the calling of bind param/result processors so that method call overhead is minimized. special cases added for executemany() scenarios such that unneeded "last row id" logic doesn't kick in, parameters aren't excessively traversed. - new performance tests show a combined mass-insert/mass-select test as having 68% fewer function calls than the same test run against 0.3. - general performance improvement of result set iteration is around 10-20%.
* - got is_subquery() working in the case of compound selects, test for ms-sqlMike Bayer2007-08-121-5/+13
|
* - fixed compiler bug in mssqlMike Bayer2007-08-121-1/+4
| | | | | | - marked as unsupported for mssql all two-phase and nested transcation tests - marked as unsupported for mssql various transactional/session tests which require two connections looking at uncommitted/external data at the same time (ms-sql cant handle it) - put better explicit closeout step in unitofwork.py tests to appease ms-sqls hard locking
* - precompiled regexp for anonymous labelsMike Bayer2007-08-111-13/+16
| | | | - has_key()->__contains__()
* - removed _calculate_correlations() methods, removed correlation_stack, ↵Mike Bayer2007-08-111-38/+59
| | | | | | | select_stack; all are merged into a single stack thats all within ansicompiler. clause visiting cut down significantly.
* - case_sensitive=(True|False) setting removed from schema items, sinceMike Bayer2007-08-111-10/+9
| | | | | | | checking this state added a lot of method call overhead and there was no decent reason to ever set it to False. Table and column names which are all lower case will be treated as case-insenstive (yes we adjust for Oracle's UPPERCASE style too).
* repaired oracle savepoint implementationMike Bayer2007-08-111-5/+5
|
* - fixes to PG unicode table/sequence reflection/create/dropsMike Bayer2007-08-101-1/+1
|
* Allow '$' in bind param detection [ticket:719], added test suite & fixed an ↵Jason Kirtland2007-08-091-2/+2
| | | | edge case
* Added 'unformat_identifiers', produces a list of unquoted identifiers from ↵Jason Kirtland2007-08-091-0/+32
| | | | an identifier or a fully qualified identifier string.
* Added 'SET' to reserved words, plus gratuitous reindenting.Jason Kirtland2007-08-071-24/+28
|
* - migrated 'desc', 'asc', and 'distinct' to be in the Operators frameworkMike Bayer2007-08-071-1/+5
| | | | - fixes to operator() method signature/calling
* - editsMike Bayer2007-08-061-0/+3
| | | | - added "params" to ansisql compiler
* switch (simple) occurences of 'if len(x)' to 'if x': find . -name '*.py' ↵Jonathan Ellis2007-08-031-6/+6
| | | | |xargs perl -pi.bak -e 's/if len\((\S+)\):/if $1:/' && find . -name '*.bak' |xargs rm
* Promoted format_table_seq from mysql to ansisql. Formats a fully qualified ↵Jason Kirtland2007-08-011-0/+14
| | | | table reference as a quoted sequence, suitable for '.'.joining or whatever. [ticket:666]
* merging 0.4 branch to trunk. see CHANGES for details. 0.3 moves to ↵Mike Bayer2007-07-271-387/+362
| | | | maintenance branch in branches/rel_0_3.
* Better quoting of identifiers when manipulating schemasJason Kirtland2007-07-191-18/+30
| | | | Merged from r2981
* more query methods, overhauliung docs for forwards 0.4 methodMike Bayer2007-07-151-2/+2
|
* - long-identifier detection fixed to use > rather than >= forMike Bayer2007-06-051-2/+2
| | | | max ident length [ticket:589]
* - parenthesis are applied to clauses via a new _Grouping construct.Mike Bayer2007-05-141-45/+35
| | | | | | | | uses operator precedence to more intelligently apply parenthesis to clauses, provides cleaner nesting of clauses (doesnt mutate clauses placed in other clauses, i.e. no 'parens' flag) - added 'modifier' keyword, works like func.<foo> except does not add parenthesis. e.g. select([modifier.DISTINCT(...)]) etc.
* - fix to long name generation when using oid_column as an order byMike Bayer2007-05-071-2/+4
| | | | (oids used heavily in mapper queries)
* more docstrings stuffMike Bayer2007-04-141-1/+1
|
* - the "mini" column labels generated when using subqueries, whichMike Bayer2007-04-111-9/+10
| | | | | | | | 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]
* - merged the "execcontext" branch, refactors engine/dialect codepathsMike Bayer2007-04-021-27/+21
| | | | | | | | | | | | | | | | | | | | - 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().
* - column label and bind param "truncation" also generateMike Bayer2007-03-281-24/+53
| | | | | | | | | | | 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-9/+27
| | | | | | related commit. added more tests plus test for column targeting with text() clause.
* - preliminary support for unicode table and column names added.Mike Bayer2007-03-271-11/+9
|
* - column labels are now generated in the compilation phase, whichMike Bayer2007-03-241-9/+15
| | | | | | | | | | | | | | | 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.
* - for hackers, refactored the "visitor" system of ClauseElement andMike Bayer2007-03-111-21/+23
| | | | | | | | | | | | | | | 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-2/+2
| | | | | | | | | | | | 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/+23
| | | | | | | | | 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.
* - use_labels flag on select() wont auto-create labels for literal textMike Bayer2007-03-011-4/+9
| | | | | | | | 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-172/+253
| | | | | | straight <pre> + trim() func for now. applies most of [ticket:214], compliemnts of Lele Gaifax
* - fixed generation of CHECK constraints on columns [ticket:464]Mike Bayer2007-02-171-0/+4
|
* - moved change for [ticket:466] to ansisql, since thats the syntax for all ↵Mike Bayer2007-02-171-2/+3
| | | | | | databases. the change is across all dialects, not just oracle
* - added "schema" argument to all has_table() calls, only supported so far by PGMike Bayer2007-02-041-2/+2
| | | | - added basic unit test for PG reflection of tables in an alternate schema
* - added literal_column() to specify a column clause that should not undergo ↵Mike Bayer2007-02-041-3/+1
| | | | | | | 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-14/+15
|
* - more quoting fixes for [ticket:450]...quoting more aggressive (but still ↵Mike Bayer2007-02-041-15/+14
| | | | | | | | 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.
* fixes to quoting on "fake" column when used off its tableMike Bayer2007-01-291-1/+1
|
* oracle can conditionally decide if it wants to say "use rowid" in a select ↵Mike Bayer2007-01-241-1/+1
| | | | | | | statement. needs to be tweaked vs. when ROW NUMBER OVER ORDER BY is being used, but currently fixes [ticket:436]
* - added support for column "key" attribute to be useable in row[<key>]/row.<key>Mike Bayer2007-01-231-0/+4
|
* copyright updateMike Bayer2007-01-051-1/+1
|
* - order of constraint creation puts primary key first before all other ↵Mike Bayer2007-01-031-2/+6
| | | | | | constraints; required for firebird, not a bad idea for others [ticket:408]
* - global "insure"->"ensure" change. in US english "insure" is actuallyMike Bayer2007-01-011-1/+1
| | | | | | largely interchangeable with "ensure" (so says the dictionary), so I'm not completely illiterate, but its definitely sub-optimal to "ensure" which is non-ambiguous.
* - made kwargs parsing to Table strict; removed various obsoluete ↵Mike Bayer2006-11-261-40/+81
| | | | | | | | | | | "redefine=True" kw's from the unit tests - documented instance variables in ANSICompiler - fixed [ticket:120], adds "inline_params" set to ANSICompiler which DefaultDialect picks up on when determining defaults. added unittests to query.py - additionally fixed up the behavior of the "values" parameter on _Insert/_Update - more cleanup to sql/Select - more succinct organization of FROM clauses, removed silly _process_from_dict methods and JoinMarker object
* - cleanup on some instance vars in Select (is_scalar, is_subquery, _froms is ↵Mike Bayer2006-11-251-2/+2
| | | | | | | __froms, removed unused 'nowait', '_text', etc) - cleaned up __repr__ on Column, AbstractTypeEngine - added standalone intersect(_all), except(_all) functions, unit tests illustrating nesting patterns [ticket:247]
* converted imports to absoluteMike Bayer2006-10-261-1/+1
|