Project

General

Profile

Statistics
| Revision:

# Date Author Comment
2713 06/08/2012 08:17 PM Aaron Marcuse-Kubitza

sql_gen.py: Derived.set_srcs(): Added optional overwrite param so that a default srcs value can be set only if one isn't already set

2712 06/08/2012 08:04 PM Aaron Marcuse-Kubitza

sql_gen.py: Made Table a Derived element so that a row-subset temp table could retain the schema of the table it came from, and any auxiliary tables in that schema could be located properly

2711 06/08/2012 08:01 PM Aaron Marcuse-Kubitza

sql_gen.py: Moved srcs-related functionality from Col to new superclass Derived

2710 06/08/2012 07:53 PM Aaron Marcuse-Kubitza

sql.py: cast(): save_errors: Fixed bug where srcs needed to have their names extracted before being wrapped in sql_gen.Literals. Fixed bug where errors table INSERT needed to prefix the CROSS JOIN-ed VALUES statements with SELECT * FROM because the CROSS JOIN makes it a whole SELECT query, not just a VALUES statement.

2709 06/08/2012 07:40 PM Aaron Marcuse-Kubitza

schemas/vegbien.ERD.mwb: Adjusted lines to make less intersections happen on the first page

2708 06/08/2012 07:27 PM Aaron Marcuse-Kubitza

sql.py: put_table(): MissingCastException: Fixed bug where errors_table needed to have the same schema as in_tables0 as well as part of the same name

2707 06/08/2012 07:23 PM Aaron Marcuse-Kubitza

sql_gen.py: Added suffixed_table()

2706 06/08/2012 07:14 PM Aaron Marcuse-Kubitza

sql.py: MissingCastException: Print log message that it's casting the column, to introduce the SQL function definition that follows

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

sql.py: put_table(): MissingCastException: Use new cast() instead of relying on existing cast functions in the database

2704 06/08/2012 07:04 PM Aaron Marcuse-Kubitza

sql.py: Added cast()

2703 06/08/2012 06:00 PM Aaron Marcuse-Kubitza

sql_gen.py: Added wrap() and use it in wrap_in_func()

2702 06/08/2012 05:36 PM Aaron Marcuse-Kubitza

sql.py: put_table(): Track the input column(s) a column is derived from, so that error messages can be attributes to the proper input column(s)

2701 06/08/2012 05:35 PM Aaron Marcuse-Kubitza

sql_gen.py: Col: Support tracking the column(s) a column is derived from, so that error messages can be attributes to the proper input column(s)

2700 06/08/2012 05:33 PM Aaron Marcuse-Kubitza

objects.py: BasicObject: Allow subclasses to customize which attrs are compared on, by adding _compare_on() method

2699 06/08/2012 04:45 PM Aaron Marcuse-Kubitza

lists.py: uniqify(): Document that it will work on any iterable, not just lists

2698 06/08/2012 04:06 PM Aaron Marcuse-Kubitza

sql.py: mk_insert_select(): embeddable: Use sql_gen.TempFunction and sql_gen.FunctionCall

2697 06/08/2012 04:04 PM Aaron Marcuse-Kubitza

sql_gen.py: Added TempFunction

2696 06/08/2012 03:26 PM Aaron Marcuse-Kubitza

schemas/functions.sql, vegbien.sql: Cast functions: Removed `RETURN new;` at end (artifact of when they were relational functions). Made the EXCEPTION block the main block of the function, to avoid unnecessary nesting.

2695 06/08/2012 02:26 PM Aaron Marcuse-Kubitza

csv2db: Errors table: index_cols: Remove no longer needed sql_gen.Col() (now done by EnsureNotNull)

2694 06/08/2012 02:25 PM Aaron Marcuse-Kubitza

sql_gen.py: EnsureNotNull: Run value through as_Col() so FunctionCall won't default it to a Literal

2693 06/08/2012 02:19 PM Aaron Marcuse-Kubitza

csv2db: Use sql_gen.EnsureNotNull instead of the ensure_not_null() function in the functions schema to avoid a dependency on the functions schema, which would cause the UNIQUE index to be dropped whenever the functions schema is reinstalled

2692 06/08/2012 02:18 PM Aaron Marcuse-Kubitza

sql_gen.py: Added EnsureNotNull

2691 06/08/2012 02:17 PM Aaron Marcuse-Kubitza

sql_gen.py: Added InternalFunction

2690 06/08/2012 02:08 PM Aaron Marcuse-Kubitza

sql_gen.py: FunctionCall: Ensure all args are Code objects using as_Value()

2689 06/08/2012 01:51 PM Aaron Marcuse-Kubitza

csv2db: Errors table: Add UNIQUE index on all columns

2688 06/08/2012 01:50 PM Aaron Marcuse-Kubitza

sql.py: add_index(): Support multiple column(s) or expression(s). Support separate table (not extracted from cols). Support UNIQUE indexes.

2687 06/07/2012 09:41 PM Aaron Marcuse-Kubitza

sql.py: add_index(): Fixed bug where expr needed to be deep copied so that any column nested in it (e.g. inside a FunctionCall) wouldn't be modified when col.table is set to None

2686 06/07/2012 09:35 PM Aaron Marcuse-Kubitza

sql.py: add_pkey(): Support multiple, custom columns

2685 06/07/2012 09:24 PM Aaron Marcuse-Kubitza

csv2db: Vacuum the created table

2684 06/07/2012 09:23 PM Aaron Marcuse-Kubitza

sql.py: Added vacuum()

2683 06/07/2012 09:23 PM Aaron Marcuse-Kubitza

sql.py: DbConn: Added with_autocommit()

2682 06/07/2012 08:58 PM Aaron Marcuse-Kubitza

csv2db: Create errors table for use by column-based import

2681 06/07/2012 08:57 PM Aaron Marcuse-Kubitza

sql.py: create_table(): Added has_pkey param to disable making the first column the primary key

2680 06/07/2012 08:21 PM Aaron Marcuse-Kubitza

csv2db: Use verbosity-based logging like bin/map. Use sql.create_table(). Add indexes on the columns to speed up column-based import and to speed up searching the table for particular values.

2679 06/07/2012 08:00 PM Aaron Marcuse-Kubitza

sql.py: create_table(): Don't add indexes on columns, because that shouldn't happen until after the table's rows have been inserted

2678 06/07/2012 07:55 PM Aaron Marcuse-Kubitza

sql.py: DbConn._db(): Output 'SET TRANSACTION ISOLATION LEVEL SERIALIZABLE' with log_level=4 because that should not be shown when the search_path is shown, which has log_level=3

2677 06/07/2012 07:43 PM Aaron Marcuse-Kubitza

sql.py: cleanup_table(): Use update(), which also fixes some formatting bugs

2676 06/07/2012 07:24 PM Aaron Marcuse-Kubitza

sql.py: DbConn._db(): Output connection configuration statements with log_level=3

2675 06/07/2012 07:15 PM Aaron Marcuse-Kubitza

sql.py: Added create_table()

2674 06/07/2012 07:14 PM Aaron Marcuse-Kubitza

sql_gen.py: Added TypedCol

2673 06/07/2012 06:59 PM Aaron Marcuse-Kubitza

sql.py: insert_select(): Pass log_level to run_query_into()

2672 06/07/2012 05:15 PM Aaron Marcuse-Kubitza

streams.py: LineCountInputStream: Fixed bug where EOF was incorrectly considered a line, causing the final line count (used by ProgressInputStream) to be off by one

2671 06/07/2012 04:25 PM Aaron Marcuse-Kubitza

sql.py: DbConn: Added print_notices() and call it after running a query

2670 06/07/2012 04:12 PM Aaron Marcuse-Kubitza

dicts.py: Added IdCompared

2669 06/07/2012 03:50 PM Aaron Marcuse-Kubitza

lists.py: Added clear()

2668 06/07/2012 03:24 PM Aaron Marcuse-Kubitza

sql.py: DbConn.do_autocommit(): Fixed typo in 'Autocommiting' debug message

2667 06/07/2012 03:20 PM Aaron Marcuse-Kubitza

sql_gen.py: ColDict: Extend dicts.DictProxy instead of UserDict.DictMixin because that already provides some of the functionality needed by ColDict

2666 06/06/2012 09:46 PM Aaron Marcuse-Kubitza

sql.py: run_query(): Only pass non-None debug_msg_ref to DbConn.run_query() if filtering with log_ignore_excs or can't mogrify() (and therefore can't print queries before they're run)

2665 06/06/2012 09:36 PM Aaron Marcuse-Kubitza

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

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 #