Project

General

Profile

# Date Author Comment
13079 04/09/2014 02:55 AM Aaron Marcuse-Kubitza

lib/sql_gen.py: map_expr(): documented that unlike bin/repl SQL identifier handling, this does simplify the resulting expression

13078 04/09/2014 02:54 AM Aaron Marcuse-Kubitza

lib/sql_gen.py: map_expr(): documented that this is a special case of bin/repl SQL identifier handling which does not handle entire source files

13076 04/09/2014 02:50 AM Aaron Marcuse-Kubitza

bin/repl, lib/sql_gen.py Expression transforming: documented that this can also be done in Postgres with expression substitution (wiki.vegpath.org/Postgres_queries#expression-substitution)

11970 01/20/2014 11:33 AM Aaron Marcuse-Kubitza

moved everything into /trunk/ to create the standard svn layout, for use with tools that require this (eg. git-svn). IMPORTANT: do NOT do an `svn up`. instead, re-use your working copy's existing files with `svn switch` (http://svnbook.red-bean.com/en/1.6/svn.ref.svn.c.switch.html).

10842 08/31/2013 05:48 PM Aaron Marcuse-Kubitza

lib/sql_gen.py: Join: added custom_cond param that can be used to add to the JOIN condition

10840 08/31/2013 01:01 AM Aaron Marcuse-Kubitza

lib/sql_gen.py: ColValueCond: support conds that are just plain SQL (without separate left and right sides) using special custom_cond flag value

10186 07/06/2013 07:18 PM Aaron Marcuse-Kubitza

lib/sql_gen.py: added table2regclass_text()

10138 07/02/2013 02:28 PM Aaron Marcuse-Kubitza

lib/sql_gen.py: added col2col_ref() for interfacing with for SQL functions that take a util.col_ref

9383 05/15/2013 03:30 PM Aaron Marcuse-Kubitza

lib/sql_gen.py: import OrderedDict from collections instead of ordereddict for Mac 10.8 Mountain Lion upgrade

7176 01/11/2013 05:45 AM Aaron Marcuse-Kubitza

sql_gen.py: Join: Added support for mapping values which are lists, for use in USING joins

6299 11/19/2012 05:30 PM Aaron Marcuse-Kubitza

sql_gen.py: Cast: Support casts to unknown by casting to text first

6225 11/15/2012 10:43 PM Aaron Marcuse-Kubitza

sql_gen.py: Added get_value()

5893 10/31/2012 09:58 PM Aaron Marcuse-Kubitza

sql_gen.py: NotCond: Treat a condition that evaluates to NULL as false instead, so that the boolean effect of the condition is completely inverted

5892 10/31/2012 09:42 PM Aaron Marcuse-Kubitza

sql_gen.py: null_as_str: Use new null instead of hardcoding 'NULL'

5891 10/31/2012 09:41 PM Aaron Marcuse-Kubitza

sql_gen.py: Added null

5826 10/29/2012 10:26 PM Aaron Marcuse-Kubitza

sql_gen.py: simplify_expr(): Don't require () around NULL IS NULL and NULL IS NOT NULL because extra parentheses are not provided in index conditions, only in check constraint conditions

5816 10/26/2012 05:38 PM Aaron Marcuse-Kubitza

sql_gen.py: If no cols had srcs, return [] instead of the [()] that itertools.product() would have returned

5552 10/16/2012 09:18 PM Aaron Marcuse-Kubitza

sql_gen.py: concat(): Allow multiple "column" suffixes with "." when matching the existing suffix

5524 10/15/2012 02:51 PM Aaron Marcuse-Kubitza

sql_gen.py: Table: Added order_by attr to cache the results of table_order_by()

5507 10/15/2012 09:05 AM Aaron Marcuse-Kubitza

sql_gen.py: map_expr(): Don't replace an unquoted name when followed by ",", as it would be in an into table name for a function with multiple arguments (e.g. family in "_join_words(1=Field family, 2=Field name)")

5498 10/15/2012 07:43 AM Aaron Marcuse-Kubitza

sql_gen.py: null_sentinels: Added entry for date

5448 10/12/2012 03:05 AM Aaron Marcuse-Kubitza

sql_gen.py: map_expr(): Fixed bug where names were being replaced when they were inside another name. This occurred with combined names created by sql_io.into_table_name().

5397 10/10/2012 07:07 AM Aaron Marcuse-Kubitza

sql_gen.py: Added canon_type()

5378 10/10/2012 02:41 AM Aaron Marcuse-Kubitza

sql_gen.py: simplify_parens(): Removed extra simplify_parens() at end because it is done in the final iteration that performs no other replacements, so it is not necessary to also do it explicitly

5372 10/10/2012 01:57 AM Aaron Marcuse-Kubitza

sql_gen.py: not_false_re, not_true_re: Appended \b to ensure that true/false is only matched as a single word

5371 10/10/2012 01:56 AM Aaron Marcuse-Kubitza

sql_gen.py: simplify_expr(): Also simplify "NOT false" to true

5370 10/10/2012 01:53 AM Aaron Marcuse-Kubitza

sql_gen.py: simplify_expr(): Also simplify "NOT true" to false

5367 10/10/2012 12:55 AM Aaron Marcuse-Kubitza

Moved expression transforming functions from sql.py to sql_gen.py because they do not manipulate an actual database and merely generate SQL

5335 10/09/2012 09:09 PM Aaron Marcuse-Kubitza

sql_gen.py: is_text_col(): Use new is_text_type()

5334 10/09/2012 09:09 PM Aaron Marcuse-Kubitza

sql_gen.py: Added is_text_type()

5333 10/09/2012 09:05 PM Aaron Marcuse-Kubitza

sql_gen.py: ensure_not_null(): Documented that NULL has no type, hence the NoUnderlyingTableException being re-raised

5332 10/09/2012 09:04 PM Aaron Marcuse-Kubitza

sql_gen.py: ensure_not_null(): Just store the column type in col_type, instead of storing typed_col and using typed_col.type, now that other info in typed_col is no longer needed

5331 10/09/2012 09:02 PM Aaron Marcuse-Kubitza

sql_gen.py: ensure_not_null(): Use is_nullable() instead of determining nullability itself, for clarity

5330 10/09/2012 08:59 PM Aaron Marcuse-Kubitza

sql_gen.py: is_nullable(): Fixed bug where non-columns could not be sent to db.col_info()

5329 10/09/2012 08:53 PM Aaron Marcuse-Kubitza

sql_gen.py: ensure_not_null(): Always remove_col_rename() the column to ensure that it is acceptable by helper functions like is_nullable()

5266 10/05/2012 07:56 PM Aaron Marcuse-Kubitza

sql_gen.py: null_sentinels: Added 'unknown' for taxonrank

5074 09/27/2012 10:49 AM Aaron Marcuse-Kubitza

sql_gen.py: Added is_nullable()

4938 09/24/2012 11:22 AM Aaron Marcuse-Kubitza

sql_gen.py: EnsureNotNull: Support ArrayType types

4935 09/24/2012 11:03 AM Aaron Marcuse-Kubitza

sql_gen.py: Added ArrayType

4488 09/06/2012 07:14 PM Aaron Marcuse-Kubitza

sql_gen.py: ensure_not_null(): If type_ is set, cast the column to it if needed

4442 09/05/2012 03:29 AM Aaron Marcuse-Kubitza

sql_gen.py: is_text_col(): Also consider character varying to be a text type

4406 09/04/2012 06:40 PM Aaron Marcuse-Kubitza

sql_gen.py: Added is_text_col()

4114 08/20/2012 06:17 PM Aaron Marcuse-Kubitza

sql_gen.py: NoUnderlyingTableException: Take a (required) parameter for the item that had no underlying table, and provide this wherever a NoUnderlyingTableException is created

4026 08/15/2012 03:44 AM Aaron Marcuse-Kubitza

Removed trailing whitespace on non-empty lines

3750 08/02/2012 04:32 PM Aaron Marcuse-Kubitza

Use strings.ustr() or strings.urepr() everywhere that columns are stringified, in order to support column names with non-ASCII characters (such as in the Madidi data)

3707 08/01/2012 01:05 AM Aaron Marcuse-Kubitza

sql_gen.py: merge_not_null(): For clarity, use to_text() to represent NULL as the string 'NULL' instead of as the null sentinel for the column's type

3706 08/01/2012 01:02 AM Aaron Marcuse-Kubitza

sql_gen.py: Added to_text() and helper value null_as_str

3691 07/30/2012 08:18 PM Aaron Marcuse-Kubitza

sql_gen.py: ColDict: Documented that anything that isn't a column is wrapped in a NamedCol

3639 07/27/2012 05:32 PM Aaron Marcuse-Kubitza

sql_gen.py: ColDict.__setitem__(): Fixed bug where None value should not be replaced with column default value if column has no underlying table

3598 07/24/2012 09:52 AM Aaron Marcuse-Kubitza

sql_gen.py: plpythonu_error_handler: Fixed bug where PL/Python exceptions could not be filtered by strings after the first line, because only the "message" portion of the exception is available in SQLERRM

3596 07/24/2012 09:33 AM Aaron Marcuse-Kubitza

sql_gen.py: plpythonu_error_handler: Always raise PL/Python exceptions as data_exception so they go in the errors table, instead of aborting the iteration

3595 07/24/2012 09:16 AM Aaron Marcuse-Kubitza

sql_gen.py: plpythonu_error_handler: Fixed bug where not all PL/Python exceptions start with "PL/Python: " (e.g. on PostgreSQL 9.1 on vegbiendev), so the PL/Python prefix must be optional. Refactored to put IF clause for non-PL/Python exception at end for a more logical ordering of the conditions.

3591 07/24/2012 08:14 AM Aaron Marcuse-Kubitza

sql_gen.py: plpythonu_error_handler: Added section comment before handler block, so that it's clear in the (very long) wrapper function definition what the block is doing

3555 07/23/2012 10:28 PM Aaron Marcuse-Kubitza

sql_gen.py: plpythonu_error_handler: Translate specific Python exception types to PostgreSQL error codes (ValueError -> data_exception) instead of assuming everything is a data_exception. When removing the PL/Python prefix, preserve the Python exception class in a DETAIL message. Support non-PL/Python internal_errors by re-raising them.

3554 07/23/2012 10:25 PM Aaron Marcuse-Kubitza

sql_gen.py: Added reraise_exc

3549 07/23/2012 07:14 PM Aaron Marcuse-Kubitza

sql_gen.py: Exceptions: Added suppress_exc and use it in ExcHandler.to_str()

3539 07/20/2012 07:03 AM Aaron Marcuse-Kubitza

sql_gen.py: Cast: Support types which are Code objects

3537 07/20/2012 06:03 AM Aaron Marcuse-Kubitza

sql_gen.py: Added merge_not_null()

3536 07/20/2012 06:03 AM Aaron Marcuse-Kubitza

sql_gen.py: Added try_mk_not_null()

3535 07/20/2012 05:54 AM Aaron Marcuse-Kubitza

sql_gen.py: Renamed ArrayJoin to ArrayMerge to avoid confusion with Join (a SQL construct)

3533 07/20/2012 05:38 AM Aaron Marcuse-Kubitza

sql_gen.py: RowExcIgnore.to_str(): Compare self.row_var to global const row_var using == to allow caller to provide a copy of row_var with the underlying table set appropriately

3532 07/20/2012 05:35 AM Aaron Marcuse-Kubitza

sql_gen.py: underlying_table(): Support derived tables and row vars by obtaining the underlying table from the srcs

3529 07/20/2012 04:43 AM Aaron Marcuse-Kubitza

sql_gen.py: RowExcIgnore: If a custom row_var is used, require it to already be defined. This also allows sql_io.ExcToErrorsTable to place the column var definition in the outer DECLARE, eliminating the extra DECLARE block.

3527 07/20/2012 04:28 AM Aaron Marcuse-Kubitza

sql_gen.py: RowExcIgnore: Created global constant for default row_var for callers to use

3526 07/20/2012 04:24 AM Aaron Marcuse-Kubitza

sql_gen.py: RowExcIgnore.to_str(): Moved SQL comment explaining the use of an EXCEPTION block for each individual row to Python code to avoid cluttering the logged SQL code

3523 07/20/2012 04:10 AM Aaron Marcuse-Kubitza

sql_gen.py: Added ArrayJoin

3522 07/20/2012 04:10 AM Aaron Marcuse-Kubitza

sql_gen.py: Added Array and to_Array()

3521 07/20/2012 02:47 AM Aaron Marcuse-Kubitza

sql_gen.py: Added List and inherit from it in Tuple

3520 07/20/2012 02:45 AM Aaron Marcuse-Kubitza

sql_gen.py: Renamed Tuple to Row and List to Tuple to more accurately reflect the datatype generated by each class (a Tuple being merely a grouping of values)

3519 07/20/2012 02:43 AM Aaron Marcuse-Kubitza

sql_gen.py: Moved Composite types to Literal values section as a subsection, since Composite types was really about just the input syntaxes for these types

3518 07/20/2012 02:32 AM Aaron Marcuse-Kubitza

sql_gen.py: Replaced srcs_str() with cross_join_srcs() which more correctly combines the srcs of each column using a Cartesian product. Eventually, the entire tree of srcs will need to be preserved instead of flattened in order to properly attribute errors to a specific column or set of columns.

3517 07/20/2012 02:03 AM Aaron Marcuse-Kubitza

sql_gen.py: srcs_str(): Fixed bug where needed to filter out columns with no srcs so that there aren't empty elements in the ","-separated list

3516 07/20/2012 02:00 AM Aaron Marcuse-Kubitza

sql_gen.py: Added has_srcs()

3515 07/20/2012 01:44 AM Aaron Marcuse-Kubitza

sql_gen.py: Added NestedExcHandler

3514 07/20/2012 01:44 AM Aaron Marcuse-Kubitza

sql_gen.py: Added srcs_str()

3513 07/20/2012 01:43 AM Aaron Marcuse-Kubitza

sql_gen.py: as_Col(): Support non-Code, non-string inputs by making them Literals

3512 07/20/2012 01:42 AM Aaron Marcuse-Kubitza

sql_gen.py: Added is_col() and use it in is_table_col()

3510 07/19/2012 11:22 PM Aaron Marcuse-Kubitza

sql_gen.py: Moved repr() from ExcHandler to BaseExcHandler

3509 07/19/2012 11:21 PM Aaron Marcuse-Kubitza

sql_gen.py: Added BaseExcHandler and inherit from it in ExcHandlers

3505 07/19/2012 10:43 PM Aaron Marcuse-Kubitza

sql_gen.py: Added data_exception_handler

3503 07/19/2012 10:03 PM Aaron Marcuse-Kubitza

sql_gen.py: Added ExcToWarning

3496 07/19/2012 09:05 PM Aaron Marcuse-Kubitza

sql_gen.py: Added ReturnQuery

3493 07/19/2012 08:44 PM Aaron Marcuse-Kubitza

sql_gen.py: with_table(): Only set the table if the passed-in value is a Col or FunctionCall

3492 07/19/2012 08:41 PM Aaron Marcuse-Kubitza

sql_gen.py: Added Tuple

3491 07/19/2012 08:41 PM Aaron Marcuse-Kubitza

sql_gen.py: Added List and use it in Values.to_str()

3488 07/19/2012 07:06 PM Aaron Marcuse-Kubitza

sql_gen.py: Added SetOf

3487 07/19/2012 07:06 PM Aaron Marcuse-Kubitza

sql_gen.py: FunctionDef: Support return_types which are Code objects

3485 07/19/2012 06:54 PM Aaron Marcuse-Kubitza

sql_gen.py: Added ColType

3483 07/19/2012 06:45 PM Aaron Marcuse-Kubitza

sql_gen.py: Added RowType

3482 07/19/2012 06:45 PM Aaron Marcuse-Kubitza

sql_gen.py: RowExcIgnore: Accept row types which are Code objects

3481 07/19/2012 06:42 PM Aaron Marcuse-Kubitza

sql_gen.py: TypedCol: Accept types which are Code objects

3471 07/19/2012 04:39 PM Aaron Marcuse-Kubitza

sql_gen.py: FunctionDef: Renamed args to params

3470 07/19/2012 04:35 PM Aaron Marcuse-Kubitza

sql_gen.py: FunctionDef: Accept parameters as FunctionParam objects instead of strings

3469 07/19/2012 04:32 PM Aaron Marcuse-Kubitza

sql_gen.py: Added FunctionParam

3468 07/19/2012 04:04 PM Aaron Marcuse-Kubitza

sql_gen.py: Added plpythonu_error_handler

3467 07/18/2012 11:06 PM Aaron Marcuse-Kubitza

Autogenerated SQL code: Use new strings.indent() where needed

3463 07/18/2012 10:28 PM Aaron Marcuse-Kubitza

sql_gen.py: ExcHandler: Removed extra newline after handler

3461 07/18/2012 10:23 PM Aaron Marcuse-Kubitza

sql_gen.py: FunctionDef: Added support for parameters

3458 07/18/2012 09:58 PM Aaron Marcuse-Kubitza

sql_gen.py: ExcHandler.to_str(): Removed extra newline after body

3457 07/18/2012 08:41 PM Aaron Marcuse-Kubitza

sql_gen.py: ExcHandler: Added repr() since it's not a Code object