Project

General

Profile

Statistics
| Revision:

# Date Author Comment
2664 06/06/2012 09:35 PM Aaron Marcuse-Kubitza

sql.py: DbConn.run_query(): Log query before running if no debug_msg_ref specified. Documented debug_msg_ref param.

2663 06/06/2012 08:43 PM Aaron Marcuse-Kubitza

sql.py: DbConn: Added mogrify() and use it in esc_value()

2662 06/06/2012 07:58 PM Aaron Marcuse-Kubitza

schemas/functions.sql: _nullIf(): Fixed bug where wrong var name was used to retrieve type param. Reenabled _nullIf now that it's working.

2661 06/06/2012 07:25 PM Aaron Marcuse-Kubitza

sql_gen.py: ColDict.__setitem__(): Translate NULL values to the appropriate default value of the key column (which is often NULL, but not always) so that select query filtering/joins work correctly

2660 06/06/2012 07:21 PM Aaron Marcuse-Kubitza

sql.py: DbConn.col_default(): Fixed bug where returned string needed to be wrapped in sql_gen.as_Code() because it's sometimes a SQL expression and sometimes NULL

2659 06/06/2012 07:20 PM Aaron Marcuse-Kubitza

sql_gen.py: Added as_Code(). Split SQL code objects into separate sections so unparameterized classes would be separate from general classes.

2658 06/06/2012 07:08 PM Aaron Marcuse-Kubitza

sql_gen.py: Code.to_str(): Fixed bug where needed to raise NotImplementedError, not NotImplemented

2657 06/06/2012 06:58 PM Aaron Marcuse-Kubitza

dicts.py: is_dict(): Fixed bug where lists also have getitem() methods, so keys() was checked for instead

2656 06/06/2012 06:44 PM Aaron Marcuse-Kubitza

sql.py: put_table(): Fixed bug where mapping was still a plain dict because that's what dicts.join() returns, by moving the wrapping of it in a sql_gen.ColDict after dicts.join()

2655 06/06/2012 06:28 PM Aaron Marcuse-Kubitza

sql_gen.py: ColDict: Fixed bug where copy() needed to be implemented

2654 06/06/2012 06:14 PM Aaron Marcuse-Kubitza

sql.py: into_table_name(): Fixed bug where key needed to be passed through str() now that ColDict uses Col objects for everything

2653 06/06/2012 06:11 PM Aaron Marcuse-Kubitza

sql_gen.py: ColDict: Extend UserDict.DictMixin instead of dict because its non-core function implementations route all inner dict accesses to the core functions getitem() and setitem(). sql.py: put(): DuplicateKeyException: Wrap util.dict_subset_right_join() in a sql_gen.ColDict because the dict returned by util.dict_subset_right_join() is just a plain dict. (This change must happen at the same time because the previous functionality relied on a bug in ColDict.)

2652 06/06/2012 06:04 PM Aaron Marcuse-Kubitza

util.py: DefaultDict: Use dicts.DictProxy instead of collections.defaultdict so that it provides a view of the given dict instead of copying it

2651 06/06/2012 06:03 PM Aaron Marcuse-Kubitza

dicts.py: Added DictProxy

2650 06/06/2012 05:37 PM Aaron Marcuse-Kubitza

sql.py: mk_select(): conds: Support dict-like objects other than dict itself (such as sql_gen.ColDict)

2649 06/06/2012 05:16 PM Aaron Marcuse-Kubitza

dicts.py: Added is_dict()

2648 06/06/2012 05:06 PM Aaron Marcuse-Kubitza

sql.py: DbConn.DbCursor.execute(): When setting self.query, provide default values for query, params because some debug printing statements use self.query directly instead of _add_cursor_info()

2647 06/06/2012 05:01 PM Aaron Marcuse-Kubitza

sql.py: insert(): Fixed bug where column remaing needed to be removed and sql_gen.Literal value unwrapped

2646 06/06/2012 03:40 PM Aaron Marcuse-Kubitza

sql.py: mk_insert_select(): cols: Fixed bug where table name needed to be removed from columns with a table

2645 06/06/2012 03:40 PM Aaron Marcuse-Kubitza

sql_gen.py: ColDict: Only allow dict inputs to constructor so update() can later be used. Ensure keys_table is a Table object.

2644 06/06/2012 02:55 PM Aaron Marcuse-Kubitza

sql_gen.py: ColDict: Translate NULL values to the key column's actual default value. This avoids incorrectly comparing against NULL in join/filter conditions when the column's actual default value must be used.

2643 06/06/2012 02:52 PM Aaron Marcuse-Kubitza

sql.py: DbConn: Added col_default()

2642 06/06/2012 02:52 PM Aaron Marcuse-Kubitza

sql_gen.py: ColDict: Take a db param for later use in getting default column values

2641 06/06/2012 02:16 PM Aaron Marcuse-Kubitza

sql_gen.py: ColDict: Take a keys_table param for operations that require the output table. Use this to convert all string keys to sql_gen.Col objects.

2640 06/06/2012 01:55 PM Aaron Marcuse-Kubitza

sql.py: put(): Use a sql_gen.ColDict for row, just like in put_table(), so that put() will benefit from planned enhancements to sql_gen.ColDict, such as translating NULL to the default value of a NOT NULL column

2639 06/06/2012 01:38 PM Aaron Marcuse-Kubitza

schemas/functions.sql: _nullIf: Fixed bug where NOT NULL parameters were not supported, because an input NULL value would not match an existing DEFAULT value in a select query, by temporarily disabling _nullIf until this can be supported. Removed previous workarounds.

2638 06/05/2012 03:21 PM Aaron Marcuse-Kubitza

bin/map: out_is_db, row-based mode: Disabled using DB relational functions instead of XML functions because they were causing problems

2637 06/05/2012 03:18 PM Aaron Marcuse-Kubitza

sql.py: put(): DuplicateKeyException: Fixed bug where select() call needs to be surrounded by value_or_none(), not value(), because sometimes there is no entry

2636 06/05/2012 03:17 PM Aaron Marcuse-Kubitza

schemas/functions.sql: Added indexes on all relational function parameters since the unique index will not be used for lookups

2635 06/05/2012 02:29 PM Aaron Marcuse-Kubitza

schemas/py_functions.sql: Added _namePart relational function

2634 06/05/2012 01:06 PM Aaron Marcuse-Kubitza

schemas/py_functions.sql: Added _dateRangeEnd relational function

2633 06/05/2012 12:59 PM Aaron Marcuse-Kubitza

main Makefile: schemas/%/uninstall: Removed delete confirmation message because it's repetitive to keep being asked to confirm deletion when running schemas/reinstall. schemas/%/uninstall is not intended to be run by itself, so the public schema's delete confirmation message will protect the entire schemas/uninstall sequence.

2632 06/05/2012 12:55 PM Aaron Marcuse-Kubitza

schemas/py_functions.sql: _dateRangeStart(): Fixed bug where needed to get the first element of the array returned by parse_date_range()

2631 06/05/2012 12:32 PM Aaron Marcuse-Kubitza

main Makefile: VegBIEN DB: Schemas: Changed to only allow reinstalling all schemas at once (using the usual `make schemas/reinstall` command), because reinstalling just one schema would silently remove anything in other schemas that depends on that schema

2630 06/05/2012 11:52 AM Aaron Marcuse-Kubitza

schemas/py_functions.sql: Added _dateRangeStart relational function

2629 06/05/2012 10:53 AM Aaron Marcuse-Kubitza

vegbien_dest: $schemas: Added py_functions

2628 06/05/2012 10:49 AM Aaron Marcuse-Kubitza

pg_dump_vegbien: Fixed bug where needed space before $noOwners options

2627 06/05/2012 10:37 AM Aaron Marcuse-Kubitza

main Makefile: VegBIEN DB: DB and bien user: mk_db: Also `createlang plpythonu`

2626 06/05/2012 10:26 AM Aaron Marcuse-Kubitza

pg_dump_vegbien: Log the pg_dump command being run

2625 06/05/2012 10:23 AM Aaron Marcuse-Kubitza

main Makefile: VegBIEN DB: DB and bien user: Added schemas/py_functions/reset. db: Create py_functions schema.

2624 06/05/2012 10:22 AM Aaron Marcuse-Kubitza

main Makefile: VegBIEN DB: DB and bien user: Added schemas/py_functions/reset. db: Create py_functions schema.

2623 06/05/2012 10:16 AM Aaron Marcuse-Kubitza

schemas/py_functions.sql.make: Fixed bug where owners needed to be included because schema is imported as superuser so that untrusted PL/Python functions can be created

2622 06/05/2012 10:15 AM Aaron Marcuse-Kubitza

pg_dump_vegbien: Support optionally including owners

2621 06/05/2012 09:59 AM Aaron Marcuse-Kubitza

main Makefile: VegBIEN DB: DB and bien user: Factored $(confirmRm<schema>) functions message text out into $(confirmRmSchema) function

2620 06/05/2012 09:52 AM Aaron Marcuse-Kubitza

schemas/Makefile, py_functions.sql.make: Generate py_functions.sql from vegbien's py_functions schema

2619 06/05/2012 09:32 AM Aaron Marcuse-Kubitza

main Makefile: postgres-Linux: Install postgresql-plpython

2618 06/05/2012 09:27 AM Aaron Marcuse-Kubitza

main Makefile: python-Linux, postgres-Linux: Fixed bug where apt-get installs needed to each be run in a separate command, so that if any package was not found, the other packages would still install. (apt-get aborts on the first invalid package name.)

2617 06/05/2012 09:18 AM Aaron Marcuse-Kubitza

db_dump_localize: Use new pg_version

2616 06/05/2012 09:18 AM Aaron Marcuse-Kubitza

Added pg_version

2615 06/05/2012 08:05 AM Aaron Marcuse-Kubitza

sql.py: into_table_name(): If relational function has a value argument, don't include other arguments, to save space

2614 06/05/2012 08:03 AM Aaron Marcuse-Kubitza

sql.py: add_pkey(): Version the index name just in case add_suffix() doesn't correctly preserve a needed version #

2613 06/05/2012 08:01 AM Aaron Marcuse-Kubitza

sql_gen.py: add_suffix(): Fixed bug where only strings already at the max length had the version preserved, even though appending the suffix could bring it past the max length and still cause the version to be overwritten. Fixed bug where last # in str, not first, should be considered to precede the version.

2612 06/05/2012 07:46 AM Aaron Marcuse-Kubitza

sql.py: put_table(): mapping param: Fixed documentation of supported key/value types

2611 06/05/2012 07:09 AM Aaron Marcuse-Kubitza

db_xml.py: put_table(): Removed no longer accurate comment about handling _simplifyPath

2610 06/05/2012 07:01 AM Aaron Marcuse-Kubitza

schemas/functions.sql: Added _nullIf relational function

2609 06/05/2012 06:39 AM Aaron Marcuse-Kubitza

sql_gen.py: add_suffix(): Preserve version so that it won't be truncated off the string, leading to collisions

2608 06/04/2012 03:35 PM Aaron Marcuse-Kubitza

sql_gen.py: identifier_max_len: Fixed bug where PostgreSQL's max length was actually 63, not 64

2607 06/04/2012 03:18 PM Aaron Marcuse-Kubitza

schemas/functions.sql: _label(): Fixed bug where some Python syntax had not been translated to PostgreSQL

2606 06/04/2012 03:07 PM Aaron Marcuse-Kubitza

schemas/functions.sql: Added _label relational function

2605 06/04/2012 03:06 PM Aaron Marcuse-Kubitza

db_xml.py: put_table(): Subsetting in_table: Fixed bug where in_table was not being ordered by the row_num, because order_by was set to None when it should have been omitted so it would default to the pkey

2604 06/04/2012 02:51 PM Aaron Marcuse-Kubitza

csv2db: Increased frequency of "Processed .. row(s)" messages to match slower, more common INSERT case instead of faster, less used COPY FROM case

2603 06/04/2012 02:40 PM Aaron Marcuse-Kubitza

schemas/functions.sql: _merge(): Fixed bug where values were ordered by value instead of by sort order (column name)

2602 06/04/2012 02:17 PM Aaron Marcuse-Kubitza

xml_func.py: process(): Refactored to emphasize special handling for row-based and column-based modes. In row-based mode, always use a DB relational function over a local XML function when possible, to faciliate testing of DB relational functions in row-based mode. (The shadowed local XML version will still be tested in non-DB modes, such as outputting to intermediate XML files.)

2601 06/04/2012 01:01 PM Aaron Marcuse-Kubitza

bin/map: Move retrieval of out_db's relational functions outside of process_input() so they can also be used by the non-by_col case

2600 06/04/2012 12:52 PM Aaron Marcuse-Kubitza

bin/map: out_is_db: Don't evaluate relational functions in xml_func.process() because these will be evaluated by db_xml.put()

2599 06/04/2012 12:41 PM Aaron Marcuse-Kubitza

xml_func.py: Removed no longer used strip()

2598 06/04/2012 12:40 PM Aaron Marcuse-Kubitza

bin/map: Use xml_func.process(..., strip=True) instead of xml_func.strip()

2597 06/04/2012 12:39 PM Aaron Marcuse-Kubitza

xml_func.py: process(): Added strip()'s functionality via strip option

2596 06/04/2012 12:10 PM Aaron Marcuse-Kubitza

schemas/functions.sql: Added _merge relational function

2595 06/04/2012 11:48 AM Aaron Marcuse-Kubitza

schemas/functions.sql: Added join_strs() aggregate

2594 06/04/2012 10:21 AM Aaron Marcuse-Kubitza

sql.py: Renamed index_pkey() to add_pkey() to be consistent with add_index()

2593 06/04/2012 10:07 AM Aaron Marcuse-Kubitza

sql.py: into_table_name(): In function args, omit column name for function result columns

2592 06/04/2012 09:57 AM Aaron Marcuse-Kubitza

sql.py: into_table_name(): In function args, keep the input table name for input columns to identify where they came from, except for the main input table name because it makes the string too long

2591 06/04/2012 09:22 AM Aaron Marcuse-Kubitza

sql_gen.py: esc_name(): Don't return plain name if is_safe_name(), because this makes the SQL inconsistent when some names have "_"s and some don't

2590 06/04/2012 09:17 AM Aaron Marcuse-Kubitza

sql.py: index_pkey(): Use sql_gen.add_suffix() to ensure index name isn't too long

2589 06/04/2012 09:15 AM Aaron Marcuse-Kubitza

sql.py: put_table(): insert_out_pkeys, insert_in_pkeys: Use sql_gen.add_suffix() to ensure name isn't too long

2588 06/04/2012 09:07 AM Aaron Marcuse-Kubitza

sql.py: next_version(): Use new sql_gen.add_suffix(). Removed identifier_max_len because it is now in sql_gen.

2587 06/04/2012 09:07 AM Aaron Marcuse-Kubitza

sql_gen.py: Added identifier_max_len and add_suffix()

2586 06/04/2012 09:04 AM Aaron Marcuse-Kubitza

next_version(): Append the version # so it looks more natural. Take into account the max identifier length.

2585 06/04/2012 09:03 AM Aaron Marcuse-Kubitza

strings.py: Added add_suffix()

2584 06/04/2012 08:51 AM Aaron Marcuse-Kubitza

sql.py: put_table(): Name the in_table just "in" plus the version #, and the insert_in_pkeys/insert_out_pkeys based on in_table, so that they don't take up so much space in the SQL

2583 06/04/2012 08:50 AM Aaron Marcuse-Kubitza

sql_gen.py: is_safe_name(): Fixed bug where keywords were incorrectly considered safe

2582 06/04/2012 08:40 AM Aaron Marcuse-Kubitza

strings.py: repr_no_u(): Fixed bug where "u" prefix was removed even in reprs of non-strings

2581 06/04/2012 08:32 AM Aaron Marcuse-Kubitza

db_xml.py: into_table_name(): Removed no longer necessary handling of simple functions, which is now done by sql.into_table_name(). Ensure that rank params in functions (not tables) are not treated specially as hierarchical.

2580 06/04/2012 08:21 AM Aaron Marcuse-Kubitza

sql.py: put_table(): If into == None: For function calls, include the arguments in the into table name

2579 06/04/2012 08:17 AM Aaron Marcuse-Kubitza

sql_gen.py: to_name_only_col(): Support non-Col Code inputs

2578 06/04/2012 07:42 AM Aaron Marcuse-Kubitza

sql_gen.py CompareCond.to_str(), callers of combine_conds(): Removed unnecessary grouping () to make SQL clearer

2577 06/04/2012 07:31 AM Aaron Marcuse-Kubitza

sql_gen.py: Added combine_conds() and use it in Join.to_str() and sql.py mk_select()

2576 06/04/2012 07:18 AM Aaron Marcuse-Kubitza

sql_gen.py Join.to_str(), sql.py mk_select(): Combining conditions: Don't add newlines where not needed, so that output is less vertically spread out

2575 06/04/2012 07:10 AM Aaron Marcuse-Kubitza

sql_gen.py: is_safe_name(): Fixed bug where names starting with a digit were incorrectly considered safe

2574 06/04/2012 07:06 AM Aaron Marcuse-Kubitza

sql.py: put_table(): Separate temp table names from into table name with "_" instead of "-" so that quoting the table name will usually be unnecessary

2573 06/04/2012 07:03 AM Aaron Marcuse-Kubitza

sql.py: esc_name_by_module(): Remove unused param ignore_case

2572 06/04/2012 06:59 AM Aaron Marcuse-Kubitza

sql_gen.py: esc_name(): If is_safe_name(), just return name, to avoid escessive escaping in debug output for Redmine

2571 06/04/2012 06:55 AM Aaron Marcuse-Kubitza

sql_gen.py: is_safe_name(): Don't consider uppercase letters safe because they would cause inconsistent behavior in PostgreSQL if quoted vs. not quoted (only unquoted identifiers are case-insensitive)

2570 06/04/2012 06:51 AM Aaron Marcuse-Kubitza

sql.py: Removed no longer needed check_name()

2569 06/04/2012 06:50 AM Aaron Marcuse-Kubitza

sql.py: esc_name_by_module(): psycopg2: If ignore_case is set but name is unsafe, just escape it instead of raising an exception

2568 06/04/2012 06:49 AM Aaron Marcuse-Kubitza

sql_gen.py: Added is_safe_name()

2567 06/04/2012 06:39 AM Aaron Marcuse-Kubitza

sql.py: put_table(): col_ustr(): Removed no longer needed sql_gen.as_Col() because mapping and join_cols now ensure that their contents are sql_gen.Col objects

2566 06/01/2012 08:29 PM Aaron Marcuse-Kubitza

schemas/functions.sql: Added _alt relational function

2565 06/01/2012 08:28 PM Aaron Marcuse-Kubitza

sql.py: put_table(): Make mapping and join_cols a sql_gen.ColDict so that literal values will always be turned into sql_gen.Col objects. DuplicateKeyException: Use dict_subset_right_join() instead of dict_subset() so that all columns in a constraint are included in joins on out_table (such as for a relational function with omitted arguments).