summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/compiler.py
Commit message (Collapse)AuthorAgeFilesLines
* - types.Binary is renamed to types.LargeBinary, it onlyMike Bayer2010-01-231-1/+7
| | | | | | | produces BLOB, BYTEA, or a similar "long binary" type. New base BINARY and VARBINARY types have been added to access these MySQL/MS-SQL specific types in an agnostic way [ticket:1664].
* fixed the illegal_initial_chars collection + unit test, [ticket:1659]Mike Bayer2010-01-211-1/+1
|
* happy new yearMike Bayer2010-01-071-1/+1
|
* - Column() supports a keyword argument "sqlite_autoincrement", whichMike Bayer2009-12-181-1/+3
| | | | | | | | applies the SQLite keyword "AUTOINCREMENT" to columns within DDL - will prevent generation of a separate PRIMARY KEY constraint. [ticket:1016] - added docs - fixed underlines in mysql.rst
* - reworked the DDL generation of ENUM and similar to be more platform agnostic.Mike Bayer2009-12-061-21/+11
| | | | | | | Uses a straight CheckConstraint with a generic expression. Preparing for boolean constraint in [ticket:1589] - CheckConstraint now accepts SQL expressions, though support for quoting of values will be very limited. we don't want to get into formatting dates and such.
* - The "start" and "increment" attributes on Sequence nowMike Bayer2009-11-031-0/+11
| | | | | | generate "START WITH" and "INCREMENT BY" by default, on Oracle and Postgresql. Firebird doesn't support these keywords right now. [ticket:1545]
* - generalized Enum to issue a CHECK constraint + VARCHAR on default platformMike Bayer2009-10-251-6/+23
| | | | - added native_enum=False flag to do the same on MySQL, PG, if desired
* - Added new ENUM type to the Postgresql dialect, which exists as a schema-levelMike Bayer2009-10-251-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | construct and extends the generic Enum type. Automatically associates itself with tables and their parent metadata to issue the appropriate CREATE TYPE/DROP TYPE commands as needed, supports unicode labels, supports reflection. [ticket:1511] - MySQL ENUM now subclasses the new generic Enum type, and also handles unicode values implicitly, if the given labelnames are unicode objects. - Added a new Enum generic type, currently supported on Postgresql and MySQL. Enum is a schema-aware object to support databases which require specific DDL in order to use enum or equivalent; in the case of PG it handles the details of `CREATE TYPE`, and on other databases without native enum support can support generation of CHECK constraints. [ticket:1109] [ticket:1511] - types documentation updates - some cleanup on schema/expression docs
* - insert() and update() constructs can now embed bindparam()Mike Bayer2009-10-231-4/+9
| | | | | | | objects using names that match the keys of columns. These bind parameters will circumvent the usual route to those keys showing up in the VALUES or SET clause of the generated SQL. [ticket:1579]
* merge r6418 from 0.5, dedupe expressions on clause ident, not string valueMike Bayer2009-10-201-3/+3
| | | | [ticket:1574]
* merged r6416 of 0.5 branch, fix the "numeric" paramstyle and add testsMike Bayer2009-10-201-1/+1
|
* deprecations per [ticket:1498]:Mike Bayer2009-10-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - deprecated PassiveDefault - use DefaultClause. - the BINARY and MSBinary types now generate "BINARY" in all cases. Omitting the "length" parameter will generate "BINARY" with no length. Use BLOB to generate an unlengthed binary column. - the "quoting='quoted'" argument to MSEnum/ENUM is deprecated. It's best to rely upon the automatic quoting. - "shortname" attribute on bindparam() is removed. - fold_equivalents flag on join is deprecated (will remain until [ticket:1131] is implemented) - "scalar" flag on select() is removed, use select.as_scalar(). - 'transactional' flag on sessionmaker() and others is removed. Use 'autocommit=True' to indicate 'transactional=False'. - 'polymorphic_fetch' argument on mapper() is removed. Loading can be controlled using the 'with_polymorphic' option. - 'select_table' argument on mapper() is removed. Use 'with_polymorphic=("*", <some selectable>)' for this functionality. - 'proxy' argument on synonym() is removed. This flag did nothing throughout 0.5, as the "proxy generation" behavior is now automatic. - Passing a single list of elements to eagerload(), eagerload_all(), contains_eager(), lazyload(), defer(), and undefer() instead of multiple positional -args is deprecated. - Passing a single list of elements to query.order_by(), query.group_by(), query.join(), or query.outerjoin() instead of multiple positional *args is deprecated. - query.iterate_instances() is removed. Use query.instances(). - Query.query_from_parent() is removed. Use the sqlalchemy.orm.with_parent() function to produce a "parent" clause, or alternatively query.with_parent(). - query._from_self() is removed, use query.from_self() instead. - the "comparator" argument to composite() is removed. Use "comparator_factory". - RelationProperty._get_join() is removed. - the 'echo_uow' flag on Session is removed. Use logging on the "sqlalchemy.orm.unitofwork" name. - session.clear() is removed. use session.expunge_all(). - session.save(), session.update(), session.save_or_update() are removed. Use session.add() and session.add_all(). - the "objects" flag on session.flush() remains deprecated. - the "dont_load=True" flag on session.merge() is deprecated in favor of "load=False". - passing an InstanceState (internal SQLAlchemy state object) to attributes.init_collection() or attributes.get_history() is deprecated. These functions are public API and normally expect a regular mapped object instance. - the 'engine' parameter to declarative_base() is removed. Use the 'bind' keyword argument.
* - an executemany() now requires that all bound parameterMike Bayer2009-10-151-8/+15
| | | | | | | | | | | | sets require that all keys are present which are present in the first bound parameter set. The structure and behavior of an insert/update statement is very much determined by the first parameter set, including which defaults are going to fire off, and a minimum of guesswork is performed with all the rest so that performance is not impacted. For this reason defaults would otherwise silently "fail" for missing parameters, so this is now guarded against. [ticket:1566]
* remove instanceof() in favor of memoized flags, part of [ticket:1566]Mike Bayer2009-10-141-9/+7
|
* - added "ddl" argument to the "on" callable of DDLElement [ticket:1538]Mike Bayer2009-10-121-3/+3
| | | | | | - fixed the imports in the "postgres" cleanup dialect - renamed "schema_item" attribute/argument of DDLElement to "target".
* merge from branches/clauseelement-nonzeroPhilip Jenvey2009-09-241-5/+5
| | | | | | adds a __nonzero__ to _BinaryExpression to avoid faulty comparisons during hash collisions (which only occur on Jython) fixes #1547
* - Inserting NULL into a primary key + foreign key columnMike Bayer2009-08-311-2/+1
| | | | | | | | | | | will allow the "not null constraint" error to raise, not an attempt to execute a nonexistent "col_id_seq" sequence. [ticket:1516] - autoincrement SELECT statements, i.e. those which select from a procedure that modifies rows, now work with server-side cursor mode (the named cursor isn't used for such statements.)
* always visit returning clauses in the right order for positional paramstylePhilip Jenvey2009-08-181-8/+4
| | | | sanity
* - simplify MySQLIdentifierPreparer into standard pattern,Mike Bayer2009-08-101-3/+5
| | | | | | | thus allowing easy subclassing - move % sign logic for MySQLIdentifierPreparer into MySQLdb dialect - paramterize the escape/unescape quote char in IdentifierPreparer - cut out MySQLTableDefinitionParser cruft
* - the Oracle dialect now features NUMBER which intendsMike Bayer2009-08-091-0/+2
| | | | | | | to act justlike Oracle's NUMBER type. It is the primary numeric type returned by table reflection and attempts to return Decimal()/float/int based on the precision/scale parameters. [ticket:885]
* clean up the way we detect MSSQL's form of RETURNINGMike Bayer2009-08-081-10/+22
|
* unwrapped _get_colparams a bit, dropped out an isinstance() callMike Bayer2009-08-081-22/+23
|
* - turned on auto-returning for oracle, some errorsMike Bayer2009-08-081-11/+11
| | | | | - added make_transient() [ticket:1052] - ongoing refactor of compiler _get_colparams() (more to come)
* fix non2.4 gremlinMike Bayer2009-08-061-1/+1
|
* merge 0.6 series to trunk.Mike Bayer2009-08-061-334/+538
|
* - Unary expressions such as DISTINCT propagate theirMike Bayer2009-07-251-2/+2
| | | | | type handling to result sets, allowing conversions like unicode and such to take place. [ticket:1420]
* - sqlMike Bayer2009-05-291-1/+1
| | | | | | | | | | | | | | | | - Removed an obscure feature of execute() (including connection, engine, Session) whereby a bindparam() construct can be sent as a key to the params dictionary. This usage is undocumented and is at the core of an issue whereby the bindparam() object created implicitly by a text() construct may have the same hash value as a string placed in the params dictionary and may result in an inappropriate match when computing the final bind parameters. Internal checks for this condition would add significant latency to the critical task of parameter rendering, so the behavior is removed. This is a backwards incompatible change for any application that may have been using this feature, however the feature has never been documented.
* Added multi part schema name support. Closes #594 and #1341.Michael Trier2009-04-111-6/+14
|
* extract() is now dialect-sensitive and supports SQLite and others.Jason Kirtland2009-03-301-0/+22
|
* - anonymous alias names now truncate down to the max lengthMike Bayer2009-02-101-3/+7
| | | | | allowed by the dialect. More significant on DBs like Oracle with very small character limits. [ticket:1309]
* - _CalculatedClause is goneMike Bayer2009-01-281-2/+10
| | | | | | | | - Function rolls the various standalone execution functionality of CC into itself, accesses its internal state more directly - collate just uses _BinaryExpression, don't know why it didn't do this already - added new _Case construct, compiles directly - the world is a happier place
* - Further fixes to the "percent signs and spaces in column/tableMike Bayer2009-01-181-3/+3
| | | | | | | | names" functionality. [ticket:1284] - Still doesn't work for PG/MySQL, which unfortunately would require post_process_text() calls all over the place. Perhaps % escaping can be assembled into IdentifierPreparer.quote() since that's where identifier names are received.
* - Improved the methodology to handling percent signs in columnMike Bayer2009-01-141-4/+6
| | | | | | names from [ticket:1256]. Added more tests. MySQL and Postgres dialects still do not issue correct CREATE TABLE statements for identifiers with percent signs in them.
* happy new yearMike Bayer2009-01-121-1/+1
|
* NotSupportedError is a DBAPI wrapper which takes four args and is expected ↵Mike Bayer2009-01-111-1/+1
| | | | | | to originate from the DBAPI layer. Moved those error throws to CompileError/InvalidRequestError.
* - mysql, postgres: "%" signs in text() constructs are automatically escaped ↵Mike Bayer2009-01-021-1/+4
| | | | | | | to "%%". Because of the backwards incompatible nature of this change, a warning is emitted if '%%' is detected in the string. [ticket:1267]
* - sqlalchemy.sql.expression.Function is now a publicMike Bayer2009-01-021-1/+1
| | | | | | | class. It can be subclassed to provide user-defined SQL functions in an imperative style, including with pre-established behaviors. The postgis.py example illustrates one usage of this.
* - Can pass mapped attributes and column objects as keysMike Bayer2008-12-281-2/+2
| | | | | | | | | to query.update({}). [ticket:1262] - Mapped attributes passed to the values() of an expression level insert() or update() will use the keys of the mapped columns, not that of the mapped attribute.
* use new anonymize style for the public _anonymize as wellMike Bayer2008-12-231-1/+1
|
* silly negative ID numbers on linux...Mike Bayer2008-12-231-1/+1
|
* - Columns can again contain percent signs within theirMike Bayer2008-12-231-2/+3
| | | | names. [ticket:1256]
* merged -r5299:5438 of py3k warnings branch. this fixes some sqlite py2.6 ↵Mike Bayer2008-12-181-6/+7
| | | | | | | | testing issues, and also addresses a significant chunk of py3k deprecations. It's mainly expicit __hash__ methods. Additionally, most usage of sets/dicts to store columns uses util-based placeholder names.
* - merged -r5338:5429 of sphinx branch.Mike Bayer2008-12-061-4/+4
| | | | | | | | | | | | | - Documentation has been converted to Sphinx. In particular, the generated API documentation has been constructed into a full blown "API Reference" section which organizes editorial documentation combined with generated docstrings. Cross linking between sections and API docs are vastly improved, a javascript-powered search feature is provided, and a full index of all classes, functions and members is provided.
* - Removed the 'properties' attribute of theMike Bayer2008-11-091-4/+5
| | | | | Connection object, Connection.info should be used. - Method consoliation in Connection, ExecutionContext
* Global propigate -> propagate change to correct spelling. Additionally found ↵Michael Trier2008-11-091-1/+1
| | | | a couple of insures that should be ensure.
* avoid some often unnecessary method calls. i think we might have squeezed ↵Mike Bayer2008-11-071-9/+14
| | | | all we're going to squeeze out of compiler at this point.
* - Dialects can now generate label names of adjustable length.Mike Bayer2008-11-051-41/+42
| | | | | | | | | | | | | Pass in the argument "label_length=<value>" to create_engine() to adjust how many characters max will be present in dynamically generated column labels, i.e. "somecolumn AS somelabel". Any value less than 6 will result in a label of minimal size, consiting of an underscore and a numeric counter. The compiler uses the value of dialect.max_identifier_length as a default. [ticket:1211] - removed ANON_NAME regular expression, using string patterns now - _generated_label() unicode subclass is used to indicate generated names which are subject to truncation
* - moved _FigureVisitName into visitiors.VisitorType, added Visitor base ↵Mike Bayer2008-10-251-3/+2
| | | | | | | class to reduce dependencies - implemented _generative decorator for select/update/insert/delete constructs - other minutiae
* - CompileTests run without the DBAPI being usedMike Bayer2008-10-231-1/+4
| | | | - added stack logic back to visit_compound(), pared down is_subquery
* call count pinata partyMike Bayer2008-10-231-10/+24
|