Project

General

Profile

Statistics
| Revision:

# Date Author Comment
2409 05/24/2012 06:49 PM Aaron Marcuse-Kubitza

sql.py: put_table(): Add index on columns with invalid values to enable fast filtering

2408 05/24/2012 06:47 PM Aaron Marcuse-Kubitza

sql.py: Added index_col()

2407 05/24/2012 06:18 PM Aaron Marcuse-Kubitza

sql.py: put_table(): Add pkey on returned pkeys table to enable fast joins

2406 05/24/2012 06:17 PM Aaron Marcuse-Kubitza

sql.py: Added index_pkey()

2405 05/24/2012 05:41 PM Aaron Marcuse-Kubitza

sql.py: mk_update(): When running sql_gen.to_name_only_col(), check that the col's table is table

2404 05/24/2012 05:38 PM Aaron Marcuse-Kubitza

sql.py: put_table(): Renamed pkeys to insert_pkeys to distinguish them from the full set of pkeys on the input table

2403 05/24/2012 05:27 PM Aaron Marcuse-Kubitza

sql.py: put_table(): FunctionValueException: Change invalid values to NULL using UPDATE instead of filtering them out using WHERE, to avoid adding lots of conditions to the SELECT statement

2402 05/24/2012 05:11 PM Aaron Marcuse-Kubitza

sql.py: Added mk_update() and update()

2401 05/24/2012 05:10 PM Aaron Marcuse-Kubitza

sql_gen.py: Added to_name_only_col()

2400 05/24/2012 04:56 PM Aaron Marcuse-Kubitza

sql_gen.py: Added as_Value()

2399 05/24/2012 04:29 PM Aaron Marcuse-Kubitza

sql.py: mk_select(): conds: Use new sql_gen.ColValueCond instead of sql_gen.as_ValueCond(). Documented that Code and ValueCond are sql_gen objects.

2398 05/24/2012 04:28 PM Aaron Marcuse-Kubitza

sql_gen.py: Added ColValueCond

2397 05/24/2012 03:59 PM Aaron Marcuse-Kubitza

sql.py: mk_flatten_mapping(): Filter str(col) through clean_name() to remove quotes, etc.

2396 05/24/2012 03:58 PM Aaron Marcuse-Kubitza

sql.py: Added clean_name()

2395 05/24/2012 03:43 PM Aaron Marcuse-Kubitza

sql.py: put_table(): Join together input tables into new table for speed and so don't modify input if values edited

2394 05/24/2012 03:37 PM Aaron Marcuse-Kubitza

sql.py: mk_flatten_mapping(): Take as_items param to return a list of dict items instead of a dict. Sort preserve cols before other cols. flatten(): Turn on as_items so that cols list is sorted in input order, with preserve cols first. This ensures that if a pkey is provided in preserve, it will be the first col in the generated table.

2393 05/24/2012 03:24 PM Aaron Marcuse-Kubitza

sql.py: mk_flatten_mapping(), flatten(): Take list of cols to select instead of using all cols in all tables to join

2392 05/24/2012 02:58 PM Aaron Marcuse-Kubitza

sql.py: mk_flatten_mapping(), flatten(): Renamed flat_table param to into to be consistent with run_query_into() and put it first because it is the output param

2391 05/24/2012 02:55 PM Aaron Marcuse-Kubitza

sql.py: Added flatten()

2390 05/24/2012 02:38 PM Aaron Marcuse-Kubitza

sql.py: mk_flatten_mapping(): preserve Col objects will have tables changed to flat_table to work with flattened table

2389 05/24/2012 02:29 PM Aaron Marcuse-Kubitza

sql.py: mk_flatten_mapping(): Added preserve param for list of columns not to rename

2388 05/24/2012 02:18 PM Aaron Marcuse-Kubitza

sql.py: esc_name_by_module(): Support module value None, and use default module psycopg2 for it

2387 05/23/2012 09:58 PM Aaron Marcuse-Kubitza

sql.py: put_table(): Renamed *pkeys_ref to *pkeys to reflect that they are now objects rather than an array-based references

2386 05/23/2012 09:54 PM Aaron Marcuse-Kubitza

sql.py: run_query_into(): Renamed into_ref param to into to reflect that it's now an object rather than an array-based reference

2385 05/23/2012 09:51 PM Aaron Marcuse-Kubitza

sql.py: run_query_into(): Made into_ref a sql_gen.Table instead of an array containing a table name to improve flexibility and clarity

2384 05/23/2012 09:34 PM Aaron Marcuse-Kubitza

dicts.py: Added join()

2383 05/23/2012 09:20 PM Aaron Marcuse-Kubitza

sql.py: Added mk_flatten_mapping()

2382 05/23/2012 08:28 PM Aaron Marcuse-Kubitza

sql.py: put_table(): Renamed the copy of in_tables that gets modified to in_tables_, so that the original list can eventually be reused in joining together the input tables into a temp table

2381 05/23/2012 07:10 PM Aaron Marcuse-Kubitza

sql.py: run_query(): FunctionValueException: Also match "date/time field value out of range" errors

2380 05/23/2012 07:04 PM Aaron Marcuse-Kubitza

sql.py: put_table(): conds: Use a set instead of a list for faster checking of the "cond not in conds" assertion

2379 05/23/2012 06:55 PM Aaron Marcuse-Kubitza

sql.py: mk_select(): conds: Support containers of any iterable type

2378 05/23/2012 06:52 PM Aaron Marcuse-Kubitza

sql.py: put_table(): Made conds a list so that there can be multiple conditions on the same column

2377 05/23/2012 06:36 PM Aaron Marcuse-Kubitza

sql.py: mk_select(): conds is list of (key, value) tuples instead of dict (dict still supported for compatibility), so that there can be multiple conditions on the same column

2376 05/23/2012 06:35 PM Aaron Marcuse-Kubitza

sql.py: mk_select(): conds is list of (key, value) tuples instead of dict (dict still supported for compatibility), so that there can be multiple conditions on the same column

2375 05/23/2012 06:28 PM Aaron Marcuse-Kubitza

util.py: NamedTuple inherits from objects.BasicObject so that it's comparable and hashable. This fixes a bug in dicts.make_hashable() where the NamedTuple created for a dict would appear to be hashable but would always compare as unequal.

2374 05/23/2012 06:15 PM Aaron Marcuse-Kubitza

sql.py: DbConn.esc_value(): Run strings.to_unicode() on the generated string so that if it contains unescaped non-ASCII characters, these will not cause problems when concatenated with plain strings

2373 05/23/2012 05:58 PM Aaron Marcuse-Kubitza

sql.py: run_query(): FunctionValueException: Unpack match.groups() into vars to make code clearer

2372 05/23/2012 05:56 PM Aaron Marcuse-Kubitza

exc.py: str_(): Avoid traceback exception-formatting functions when possible because they escape non-ASCII characters

2371 05/23/2012 05:11 PM Aaron Marcuse-Kubitza

sql.py: get_cur_query(): If no raw query: Use strings.ustr() instead of repr() to ensure that if the exception is parsed, embedded quotes will not be double-escaped. Prefix the query by [input] to show that it's not the raw query.

2370 05/23/2012 04:59 PM Aaron Marcuse-Kubitza

sql_gen.py: Non-Code objects: str() passes informative placeholder string to self.to_str() instead of empty string

2369 05/23/2012 04:41 PM Aaron Marcuse-Kubitza

sql.py: ExceptionWithNameValue: Use repr() instead of strings.ustr() on the value

2368 05/23/2012 04:38 PM Aaron Marcuse-Kubitza

sql.py: run_query(): Exception parsing: Use non-greedy qualifier "?" in regexps wherever possible to avoid matching closing quotes later in the error message

2367 05/23/2012 04:32 PM Aaron Marcuse-Kubitza

sql_gen.py: MockDb.esc_value(): Use repr() instead of strings.ustr() so the quotes around the value are included

2366 05/23/2012 04:30 PM Aaron Marcuse-Kubitza

sql_gen.py: ValueCond and Join class hierarchies inherit from objects.BasicObject like Code does

2365 05/23/2012 04:24 PM Aaron Marcuse-Kubitza

sql.py: put_table(): ignore(): Fixed bug where value needed to be filtered through repr(). NullValueException: Fixed bug where value passed to ignore() was the string 'NULL' instead of the value None.

2364 05/23/2012 04:14 PM Aaron Marcuse-Kubitza

mappings/DwC2-VegBIEN.specimens.csv: plantname.rank: Filter through _toTaxonrank

2363 05/23/2012 04:03 PM Aaron Marcuse-Kubitza

sql.py: put_table(): ignore(): Avoid infinite loops by asserting that in_col is not in conds

2362 05/23/2012 03:58 PM Aaron Marcuse-Kubitza

objects.py: BasicObject: Fixed bug where util needed to be imported. Added eq() and hash().

2361 05/23/2012 03:47 PM Aaron Marcuse-Kubitza

strings.py: Removed no longer used DebugPrintable (that functionality is now in objects.BasicObject)

2360 05/23/2012 03:46 PM Aaron Marcuse-Kubitza

sql_gen.py: Code: Inherit from new objects.BasicObject

2359 05/23/2012 03:46 PM Aaron Marcuse-Kubitza

Added objects.py

2358 05/23/2012 03:37 PM Aaron Marcuse-Kubitza

sql.py: put_table(): Renamed log_ignore() to ignore() and factored common conds-modifying code into it

2357 05/23/2012 03:29 PM Aaron Marcuse-Kubitza

sql.py: put_table(): Moved post-insert code outside while loop because it will now always be run (there are no longer special cases where the postprocessing doesn't happen)

2356 05/23/2012 03:25 PM Aaron Marcuse-Kubitza

sql.py: put_table(): Missing mapping for NOT NULL column: Just create an empty pkeys table, since the missing rows' pkeys will be set to NULL later

2355 05/23/2012 03:17 PM Aaron Marcuse-Kubitza

sql.py: put_table(): Joining together output and input pkeys: Use new sql_gen.join_same_not_null

2354 05/23/2012 03:14 PM Aaron Marcuse-Kubitza

sql.py: put_table(): Setting missing rows' pkeys to NULL: Use new sql_gen.join_same_not_null

2353 05/23/2012 03:14 PM Aaron Marcuse-Kubitza

sql_gen.py: Join: Added join_same_not_null. to_str(): Refactored to switch order of left and right tables and cols because left_table is on the right in the comparison, and using the sides of the comparison instead of the sides of the join makes the code clearer.

2352 05/23/2012 02:51 PM Aaron Marcuse-Kubitza

sql_gen.py: Renamed join_using to join_same to reflect that it can also be used without USING

2351 05/23/2012 02:48 PM Aaron Marcuse-Kubitza

sql.py: put_table(): Set missing rows' pkeys to NULL

2350 05/23/2012 02:10 PM Aaron Marcuse-Kubitza

sql.py: put_table(): NullValueException: no mapping for missing col: Fixed bug where run_query_into_pkeys() was still using insert_joins instead of input_joins

2349 05/23/2012 02:06 PM Aaron Marcuse-Kubitza

sql_gen.py: Added MockDb. All str() methods: Use self.to_str() with mockDb.

2348 05/23/2012 01:59 PM Aaron Marcuse-Kubitza

sql_gen.py: Use db.esc_name() instead of sql.esc_name(db, ...) so passed-in db can be a mock object

2347 05/23/2012 01:58 PM Aaron Marcuse-Kubitza

sql.py: DbConn: Added esc_name()

2346 05/23/2012 01:51 PM Aaron Marcuse-Kubitza

db_xml.py: put_table(): Debug-print which columns are being put

2345 05/23/2012 01:50 PM Aaron Marcuse-Kubitza

sql.py: ConstraintException, NullValueException: Improved error messages

2344 05/23/2012 01:31 PM Aaron Marcuse-Kubitza

sql.py: put_table(): FunctionValueException: Fixed bug where out_table was still assumed to be an escaped string, but is now a Table object

2343 05/23/2012 01:29 PM Aaron Marcuse-Kubitza

sql.py: mk_select(): joins: Use new table_not_null_col() instead of pkey() to get a non-NULL column to filter out on

2342 05/22/2012 10:00 PM Aaron Marcuse-Kubitza

exc.py: add_msg(): Fixed bug where msg needed to be converted to a unicode object before appending it to another unicode object

2341 05/22/2012 09:54 PM Aaron Marcuse-Kubitza

mappings/VegX-VegBIEN.stems.csv: Fixed bug where taxonfit was named taxonFit. (This was only recently discovered because column names are now escaped, causing them not to be case-insensitive.)

2340 05/22/2012 09:51 PM Aaron Marcuse-Kubitza

sql.py: Added table_not_null_col()

2339 05/22/2012 09:50 PM Aaron Marcuse-Kubitza

sql.py: Added table_cols() and use it in pkey()

2338 05/22/2012 09:36 PM Aaron Marcuse-Kubitza

schemas/vegbien.sql, schemas/functions.sql: Relational functions: Added dummy not_null column to provide a column to use in LEFT JOIN filter-out filters

2337 05/22/2012 09:24 PM Aaron Marcuse-Kubitza

sql.py: mk_insert_select(): embeddable: Use new sql_gen.NamedTable

2336 05/22/2012 09:23 PM Aaron Marcuse-Kubitza

sql_gen.py: Added NamedTable. Table: Added to_Table().

2335 05/22/2012 09:06 PM Aaron Marcuse-Kubitza

sql_gen.py: Added section labels for each type of SQL code object

2334 05/22/2012 08:25 PM Aaron Marcuse-Kubitza

sql.py: put_table(): DuplicateKeyException: Fixed bug where dict_subset_right_join() was used instead of dict_subset(), adding spurious None values for columns in the constraint which are not in the input tables

2333 05/22/2012 08:23 PM Aaron Marcuse-Kubitza

sql_gen.py: as_Col(): Don't allow None cols

2332 05/22/2012 08:06 PM Aaron Marcuse-Kubitza

schemas/vegbien.ERD.mwb: Synced with schemas/vegbien.sql

2331 05/22/2012 07:39 PM Aaron Marcuse-Kubitza

sql.py: Removed no longer used clean_name()

2330 05/22/2012 07:38 PM Aaron Marcuse-Kubitza

sql.py: mk_insert_select(): embeddable: Removed clean_name() because the function name is now escaped where it's used

2329 05/22/2012 07:36 PM Aaron Marcuse-Kubitza

sql.py: put_table(): Added support for out_table values that are Table objects

2328 05/22/2012 07:31 PM Aaron Marcuse-Kubitza

sql.py: mk_insert_select(): Fixed bug where table for creating the returning column Col object was the already-escaped string, instead of the Table object

2327 05/22/2012 07:24 PM Aaron Marcuse-Kubitza

sql.py: mk_insert_select(): Fixed bug where function name and returning col were not being escaped

2326 05/22/2012 07:08 PM Aaron Marcuse-Kubitza

sql.py: put_table(): log_ignore(): Fixed bug where in_col needed to be passed through str() because it's a column object

2325 05/22/2012 07:03 PM Aaron Marcuse-Kubitza

sql.py: put_table(): Fixed bug where the filter_out join should only be used in the insert, not in the select of existing/inserted rows. insert_select() call: Fixed compatibility bug where old versions of Python did not support mixing keyword args and ** args.

2324 05/22/2012 06:32 PM Aaron Marcuse-Kubitza

sql.py: put_table(): Fixed bug where "add_row_num(db, out_pkeys_ref0)" was mistakenly put under the "if row_ct_ref != None" if statement

2323 05/22/2012 06:26 PM Aaron Marcuse-Kubitza

sql_gen.py: Renamed NamedCode to NamedCol to better reflect its specific use

2322 05/22/2012 06:23 PM Aaron Marcuse-Kubitza

sql.py: Removed unnecessary calls to check_name()

2321 05/22/2012 06:22 PM Aaron Marcuse-Kubitza

sql.py: mk_insert_select(): Fixed bug where returning col was not being escaped

2320 05/22/2012 06:20 PM Aaron Marcuse-Kubitza

sql.py: add_row_num(): Fixed bug where table name was not being escaped

2319 05/22/2012 06:13 PM Aaron Marcuse-Kubitza

sql.py: run_query_into(): Fixed bug where into table name was not being escaped

2318 05/22/2012 06:07 PM Aaron Marcuse-Kubitza

sql.py: mk_insert_select(): Fixed bug where utput column names were not being escaped

2317 05/22/2012 05:57 PM Aaron Marcuse-Kubitza

sql.py: put_table(): Fixed bug where only string columns were being included in the distinct_on, but columns are now always sql_gen.Col instances

2316 05/22/2012 05:53 PM Aaron Marcuse-Kubitza

sql.py: put_table(): Put together varying insert_select() args using dict instead of individual vars

2315 05/22/2012 05:51 PM Aaron Marcuse-Kubitza

sql.py: mk_select(): Fixed bug where order_by needed to default to None if distinct_on was used. Fixed bug where cond values were being treated as %s params in addition to being parsed by sql_gen.as_ValueCond().to_str().

2314 05/22/2012 05:40 PM Aaron Marcuse-Kubitza

sql_gen.py: Col: Added to_Col()

2313 05/22/2012 05:31 PM Aaron Marcuse-Kubitza

db_xml.py: put_table(): Accept sql_gen.Table objects or strings instead of separate table and schema names

2312 05/22/2012 05:10 PM Aaron Marcuse-Kubitza

sql.py: put_table(): Require all in_table_cols to be sql_gen.Col objects

2311 05/22/2012 05:03 PM Aaron Marcuse-Kubitza

sql_gen.py: ValueCond: Unwrap NamedCode objects

2310 05/22/2012 04:55 PM Aaron Marcuse-Kubitza

sql_gen.py: NamedCode: Inherit from Col so that its name can be retrieved using the same attribute as Col's