Project

General

Profile

Statistics
| Revision:

# Date Author Comment
2540 05/31/2012 03:17 PM Aaron Marcuse-Kubitza

sql_gen.py: Added Expr

2539 05/31/2012 03:13 PM Aaron Marcuse-Kubitza

sql.py: add_index(): Fixed bug where expressions needed to be enclosed in () to distinguish them from plain columns

2538 05/31/2012 03:06 PM Aaron Marcuse-Kubitza

sql.py: add_index(): Support simple expressions as well as columns

2537 05/31/2012 02:37 PM Aaron Marcuse-Kubitza

sql.py: Renamed index_col() to add_index() so its name isn't similar to index_cols()

2536 05/31/2012 02:33 PM Aaron Marcuse-Kubitza

sql_gen.py: FunctionCall: Removed repr() because it's a Code object and its to_str() does not take extra arguments

2535 05/31/2012 02:12 PM Aaron Marcuse-Kubitza

sql.py: run_query(): FunctionValueException: Expanded parsing to include regular function calls, not just relational functions' trigger functions. put_table(): Disabled FunctionValueException handling because this expands FunctionValueException beyond what put_table() could handle.

2534 05/31/2012 01:38 PM Aaron Marcuse-Kubitza

sql.py: put_table(): MissingCastException: Fixed bug where renaming of cast literal value was not properly propagated to the returned value of the function call, causing the query to assume that a DISTINCT ON column referred to column in one of the joined tables instead of a named column in the SELECT columns list. This logic error would have been very difficult to catch without inspecting the code!

2533 05/31/2012 01:33 PM Aaron Marcuse-Kubitza

sql_gen.py: Added wrap_in_func()

2532 05/31/2012 01:25 PM Aaron Marcuse-Kubitza

sql_gen.py: FunctionCall: Filter args through remove_col_rename() to remove any renamings from the function args

2531 05/31/2012 01:20 PM Aaron Marcuse-Kubitza

sql.py: put_table(): No handler for exception: Print full exception instead of just first line to assist in debugging

2530 05/31/2012 01:06 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql, functions.sql: Removed _to* relational functions because type casting for those types is now automatic

2529 05/31/2012 01:02 PM Aaron Marcuse-Kubitza

mappings/DwC2-VegBIEN.specimens.csv: Removed _to* relational functions because type casting for those types is now automatic

2528 05/31/2012 12:59 PM Aaron Marcuse-Kubitza

schemas/functions.sql: Added cast functions for _to* relational functions

2527 05/31/2012 12:58 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql: Changed cast functions' input types to text because type must match exactly, not just be implicitly castable

2526 05/31/2012 12:47 PM Aaron Marcuse-Kubitza

sql.py: run_query(): MissingCastException parsing: Support multiple-word types

2525 05/31/2012 12:38 PM Aaron Marcuse-Kubitza

sql.py: put_table(): Handle MissingCastExceptions by attempting to call a function with the name of the type on the column

2524 05/31/2012 12:33 PM Aaron Marcuse-Kubitza

sql_gen.py: Added Functions section with Function and FunctionCall

2523 05/31/2012 11:56 AM Aaron Marcuse-Kubitza

sql.py: Added MissingCastException and parse it in run_query()

2522 05/31/2012 11:36 AM Aaron Marcuse-Kubitza

schemas/vegbien.sql: Added cast functions for enum types which map invalid values to NULL

2521 05/31/2012 10:57 AM Aaron Marcuse-Kubitza

sql.py: put_table(): Fixed bug where some exceptions with no handler would not even allow insertion of no rows into the out_table (due to type mismatch issues), by creating an empty pkeys table as a special case

2520 05/31/2012 10:49 AM Aaron Marcuse-Kubitza

sql.py: put_table(): Preparing to insert new rows: Fixed bug where main_select needed to be generated after distinct_on was set in the if statement

2519 05/31/2012 10:48 AM Aaron Marcuse-Kubitza

sql.py: put_table(): log_exc(): Fixed bug where the exception strings rather than the exceptions themselves needed to be put in the set, because exceptions are not comparable with ==

2518 05/31/2012 10:25 AM Aaron Marcuse-Kubitza

sql.py: put_table(): Moved mk_main_select() call out of try block since it is not related to the exceptions that may be thrown

2517 05/31/2012 10:17 AM Aaron Marcuse-Kubitza

sql.py: put_table(): log_exc(): Check if exception already caught before to avoid infinite loops

2516 05/31/2012 09:35 AM Aaron Marcuse-Kubitza

Added debug2redmine and helper file debug2redmine.csv

2515 05/31/2012 09:20 AM Aaron Marcuse-Kubitza

sql.py, db_xml.py: Removed unnecessary calls to sql_gen.clean_name() now that str() handles this automatically

2514 05/31/2012 09:14 AM Aaron Marcuse-Kubitza

sql_gen.py: sql_gen classes inherit from new base class BasicObject, whose str() calls clean_name() on the object's repr(). Changed the main debug-repr producing method to be repr() instead of str().

2513 05/31/2012 08:45 AM Aaron Marcuse-Kubitza

Moved clean_name() from sql.py to sql_gen.py because it's DB-general and so that it can be used by sql_gen.py without circular dependencies

2512 05/31/2012 08:41 AM Aaron Marcuse-Kubitza

db_xml.py: into_table_name(): Handle hierarchical tables specially by including their rank in the into table. Interpret any table with a value column as a function, regardless of out_table name.

2511 05/30/2012 11:07 PM Aaron Marcuse-Kubitza

sql.py: put_table(): Log "Default value column does not exist in mapping" error with level 2.1 so that it doesn't appear in Redmine output

2510 05/30/2012 11:05 PM Aaron Marcuse-Kubitza

db_xml.py: put_table(): Pass next as sql.put_table()'s default param now that it is supported

2509 05/30/2012 11:04 PM Aaron Marcuse-Kubitza

sql.py: put_table(): Changed default param to be an output column because that is what would be passed in by db_xml.put_table(), and because there is already a mapping that resolves that to a flattened input column

2508 05/30/2012 10:37 PM Aaron Marcuse-Kubitza

sql.py: put_table(): Added default param for the value or input column to use as the pkey for missing rows

2507 05/30/2012 10:20 PM Aaron Marcuse-Kubitza

sql.py: put_table(): Use single quotes rather than double quotes around strings where possible

2506 05/30/2012 10:18 PM Aaron Marcuse-Kubitza

db_xml.py: Added internal next param used by simplifyPath. put_table(): Refactored to use outer parent_ids_loc var and modify that as needed rather than having to pass parent_ids_loc as a param to put_table_().

2505 05/30/2012 09:55 PM Aaron Marcuse-Kubitza

sql.py: put_table(): When calling strings.as_*table(), pass custom ustr that removes col renames and adds double quotes on plain strings

2504 05/30/2012 09:53 PM Aaron Marcuse-Kubitza

strings.py: as_*table(): Added ustr param to override the method (by default ustr()) used to convert each value to a string

2503 05/30/2012 09:15 PM Aaron Marcuse-Kubitza

sql_gen.py: MockDb.esc_value(): Use new strings.repr_no_u()

2502 05/30/2012 09:14 PM Aaron Marcuse-Kubitza

strings.py: Added repr_no_u()

2501 05/30/2012 09:09 PM Aaron Marcuse-Kubitza

sql.py: clean_name(): Also remove '`' (which is used by MySQL)

2500 05/30/2012 09:06 PM Aaron Marcuse-Kubitza

sql.py: esc_name_by_module(): Use new sql_gen.esc_name()

2499 05/30/2012 09:03 PM Aaron Marcuse-Kubitza

sql_gen.py: Added esc_name() and use it in MockDb.esc_name()

2498 05/30/2012 09:00 PM Aaron Marcuse-Kubitza

sql.py: next_version(): Use special chars in version part of name string for clarity

2497 05/30/2012 08:53 PM Aaron Marcuse-Kubitza

sql.py: mk_insert_select(): embeddable: function_name is first line of query for clarity, and to reduce length from including the column names. This also fixes the problem of double quotes around column names in the previous function_name.

2496 05/30/2012 08:47 PM Aaron Marcuse-Kubitza

sql.py: esc_name_by_module(): Double embedded quotes to escape them instead of removing them

2495 05/30/2012 08:35 PM Aaron Marcuse-Kubitza

sql.py: put_table(): Use "-" to separate temp table suffixes from into table name

2494 05/30/2012 08:26 PM Aaron Marcuse-Kubitza

db_xml.py: into_table_name(): Format relational functions' into table names as a function call on the value column, using special chars for readability

2493 05/30/2012 08:19 PM Aaron Marcuse-Kubitza

sql.py: run_query(): Exception parsing: Use "(.+?)" wherever possible to match names containing special chars

2492 05/30/2012 07:52 PM Aaron Marcuse-Kubitza

sql.py: clean_name(): For clarity, just remove '"'s, so that "."s are preserved and show the path structure of the input name

2491 05/30/2012 07:38 PM Aaron Marcuse-Kubitza

db_xml.py: put_table(): sql.put_table(): Name the into table ...literal instead of ...value if the value column is a literal value

2490 05/30/2012 07:08 PM Aaron Marcuse-Kubitza

bin/map: Logging: log(): Remove extra debug info from DB query messages and format level 1.5 (summary) messages as Redmine list items

2489 05/30/2012 06:50 PM Aaron Marcuse-Kubitza

sql.py: put_table(): Renamed temp_prefix param to into and allow it to be a sql_gen.Table object. Use into directly as the pkeys table, and make its default value be `out_table.name+'_pkeys'`.

2488 05/30/2012 06:31 PM Aaron Marcuse-Kubitza

db_xml.py: put_table(): Pass custom temp_prefix to sql.put_table() for relational funcs, so that their value param's input column name is included in the temp table name

2487 05/30/2012 06:19 PM Aaron Marcuse-Kubitza

sql.py: put_table(): Added optional param temp_prefix for the prefix of generated temp tables

2486 05/30/2012 06:13 PM Aaron Marcuse-Kubitza

sql.py: put_table(): Made debug messages more self-documenting

2485 05/30/2012 05:44 PM Aaron Marcuse-Kubitza

sql.py: put_table(): Changed "Setting missing rows' pkeys to NULL" to "Setting pkeys of missing rows to NULL" to avoid having single quote in debug output, which messes up text editor SQL syntax highlighting

2484 05/30/2012 05:40 PM Aaron Marcuse-Kubitza

sql.py: Parsed exceptions: Use strings.as_tt() to format Python values

2483 05/30/2012 05:37 PM Aaron Marcuse-Kubitza

strings.py: Split as_table() into as_table() and as_inline_table() depending on whether the table needs to be inlined in an ordered list item or not

2482 05/30/2012 05:36 PM Aaron Marcuse-Kubitza

strings.py: Split as_table() into as_table() and as_inline_table() depending on whether the table needs to be inlined in an ordered list item or not

2481 05/30/2012 05:03 PM Aaron Marcuse-Kubitza

strings.py: as_table(): Changed to use

 formatting because Redmine tables can't be embedded in ordered lists without restarting the numbering

2480 05/30/2012 03:58 PM Aaron Marcuse-Kubitza

strings.py: as_table(): Fixed bug where table was not ended properly, by adding a space after the last \n and having rstrip() string only newlines

2479 05/29/2012 09:19 PM Aaron Marcuse-Kubitza

sql.py: mk_select(): Columns: Separate columns with newlines

2478 05/29/2012 09:10 PM Aaron Marcuse-Kubitza

sql.py: put_table(): Use new strings.as_table() to format mappings as tables

2477 05/29/2012 09:09 PM Aaron Marcuse-Kubitza

strings.py: Added as_tt() and as_table()

2476 05/29/2012 09:09 PM Aaron Marcuse-Kubitza

bin/map: Logging: log(): Strip trailing newlines from msg

2475 05/29/2012 08:40 PM Aaron Marcuse-Kubitza

strings.py: as_code(): Added multiline param to disable multiline formatted output

2474 05/29/2012 08:33 PM Aaron Marcuse-Kubitza

sql.py: put_table(): "Ignoring existing rows, comparing on" debug message: Wrap the mapping in strings.as_code() so it will have Redmine syntax-highlighting

2473 05/29/2012 08:26 PM Aaron Marcuse-Kubitza

sql.py: put_table(): "Putting columns" debug message: Wrap the mapping in strings.as_code() so it will have Redmine syntax-highlighting

2472 05/29/2012 08:22 PM Aaron Marcuse-Kubitza

sql.py: DbConn.run_query(): Query debug message: Wrap the query in strings.as_code() so it will have Redmine syntax-highlighting

2471 05/29/2012 08:20 PM Aaron Marcuse-Kubitza

strings.py: Added as_code()

2470 05/29/2012 08:04 PM Aaron Marcuse-Kubitza

sql.py: DbConn.run_query(): Prepend "DB query" before the query debug message so it can be identified as a DB query

2469 05/29/2012 07:43 PM Aaron Marcuse-Kubitza

db_xml.py: put_table(): Subset in_table: Document that in_table will be shadowed (hidden) by the created temp table, rather than versioned, now that the table is (almost) always created as a temp table

2468 05/29/2012 07:40 PM Aaron Marcuse-Kubitza

sql.py: Create temp items as permanent in autocommit mode rather than in debug mode so that temp items are only permanent if actually committing result. This ensures that the generated SQL in test mode matches what would actually get run in regular commit mode, and the SQL is only altered to make the temp items visible if actually debugging (autocommit mode).

2467 05/29/2012 07:30 PM Aaron Marcuse-Kubitza

sql.py, sql_gen.py: Reformatted generated SQL for presentability by adding newlines

2466 05/29/2012 07:14 PM Aaron Marcuse-Kubitza

sql.py: DbConn.run_query(): Put a newline before the query in the debug message so that multiline queries have all rows at the left edge rather than the first row prefixed by other text

2465 05/29/2012 07:09 PM Aaron Marcuse-Kubitza

sql.py: DbConn.run_query(): Don't put generated query debug message all on one line, so that embedded newlines are preserved

2464 05/29/2012 06:59 PM Aaron Marcuse-Kubitza

sql.py: Fixed bug where queries with versioned identifiers which threw an exception (not related to name collisions) were being output with a too-high log_level, because all exceptions were output with the higher exc_log_level, by making the following changes: DbConn.run_query(): Changed exc_log_level param to log_ignore_excs param so that only certain exceptions would cause the query to be output with a higher log_level. Moved the code that actual emits the query debug message from DbConn.run_query() to module-level run_query() so it would apply the log_ignore_excs filter after the exception had already been parsed into specific types.

2463 05/29/2012 03:16 PM Aaron Marcuse-Kubitza

Moved "Putting columns" debug message from db_xml.py put_table() to sql.py put_table() to put it in the same place as the other debug messages

2462 05/29/2012 03:12 PM Aaron Marcuse-Kubitza

sql_gen.py: Added remove_col_rename() and use it where `if isinstance(value, NamedCol): value = value.code` was used

2461 05/29/2012 03:10 PM Aaron Marcuse-Kubitza

sql_gen.py: CompareCond.to_str(): If left_value has been renamed as a NamedCol, unwrap it

2460 05/29/2012 02:53 PM Aaron Marcuse-Kubitza

sql_gen.py: Join.to_str(): Fixed bug where USING should be used if all columns are join_same_not_null, rather than join_same, because USING uses plain = for comparison. sql.py: put_table(): input_joins now can use sql_gen.join_same_not_null in order to use USING syntax.

2459 05/25/2012 07:14 PM Aaron Marcuse-Kubitza

db_xml.py: put_table(): Output debug messages with a level of 1.5 to match sql.put_table()'s level for summary messages

2458 05/25/2012 07:01 PM Aaron Marcuse-Kubitza

bin/map: Fixed bug where verbosity needed to be 1 outside of test mode so that profiling and errors stats would be printed at end of import. Verbosity defaults to 0.5 rather than 1 in test mode so profiling and errors stats do not clutter up the test output when running automated tests.

2457 05/25/2012 06:55 PM Aaron Marcuse-Kubitza

bin/map: Only display verbose_errors in test mode, but with any nonzero verbosity. They should not be displayed outside of test mode because verbose errors make the log files huge.

2456 05/25/2012 06:52 PM Aaron Marcuse-Kubitza

bin/map: Renamed verbose param to verbosity because it's now a number, not a boolean

2455 05/25/2012 06:51 PM Aaron Marcuse-Kubitza

bin/map: Removed no longer used debug param (verbose=2 is used instead)

2454 05/25/2012 06:48 PM Aaron Marcuse-Kubitza

bin/map: Fixed bug where verbose_errors' default value depended on debug var, which was not yet set. Removed verbose_errors param and instead turn verbose_errors on whenever verbosity >= 1. Verbosity defaults to 1 in test mode.

2453 05/25/2012 06:33 PM Aaron Marcuse-Kubitza

bin/map: Logging: Don't set sql.run_raw_query.debug, because it is not used anymore (sql.connect(log_debug=...) is used instead)

2452 05/25/2012 06:29 PM Aaron Marcuse-Kubitza

bin/map: Logging: Print debug messages (level > 1) prefixed with their level, to distinguish higher- and lower-level debug messages

2451 05/25/2012 06:22 PM Aaron Marcuse-Kubitza

sql.py: put_table(): Only display warning for exceptions with no handler (which are unexpected), not missing mappings for NOT NULL columns (which are normal in datasources without those columns)

2450 05/25/2012 06:15 PM Aaron Marcuse-Kubitza

sql.py: put_table(): Log summarizing debug messages with a level of 1.5 so they will be displayed even when the major SQL queries (which have a level of 2) are not shown

2449 05/25/2012 06:08 PM Aaron Marcuse-Kubitza

bin/map: Provide a log_debug() function to sql.connect() if verbosity > 1 rather than >= 2, to support fractional verbosities

2448 05/25/2012 06:04 PM Aaron Marcuse-Kubitza

sql.py: log_debug_none: Fixed bug where needed to take kw arg level to work with verbosity-based logging

2447 05/25/2012 05:57 PM Aaron Marcuse-Kubitza

bin/map: Allow fractional verbosity values

2446 05/25/2012 05:56 PM Aaron Marcuse-Kubitza

sql.py: Functions that version created tables, functions, etc. if they already exist: Use (default) exc_log_level=4 to hide the unsuccessful attempts to create items that already exist and show only the successful attempt

2445 05/25/2012 05:43 PM Aaron Marcuse-Kubitza

sql.py: DbConn.run_query(): Added exc_log_level param to specify a different log_level if the query throws an exception. This will useful for functions that version created tables, functions, etc. if they already exist.

2444 05/25/2012 05:34 PM Aaron Marcuse-Kubitza

sql.py: DbConn.run_query(): Removed no longer accurate doc comment, because that functionality is now in module-level run_query()

2443 05/25/2012 05:31 PM Aaron Marcuse-Kubitza

sql.py: Specify log_levels for minor queries so they can be excluded from the debug output

2442 05/25/2012 05:16 PM Aaron Marcuse-Kubitza

sql.py: select(): Pass log_level to run_query()

2441 05/25/2012 05:13 PM Aaron Marcuse-Kubitza

sql.py: DbConn.run_query(): Added log_level param and pass it to self.log_debug(). run_query(): Pass extra kw_args to DbConn.run_query() (via run_raw_query()) so that caller can specify log_level.