ChangeLog GREAT-ER-DB "usf"-Branch: Special API Development for USF installation of GREAT-ER. 2005-08-16 Frank Koormann Update of USF GREAT-ER-DB Interface to HEAD branch progress * dagreater/apispec.py: Added DBInsertFunctions for da_insert_disch and da_insert_stretch * impl/postgresql/gdagreater_pg.pgc: Code cleanup: File covered a bunch of "unused" variables. Commented out where possible, v_module references wrapped with pre-processor clauses. (gda_insert_disch, gda_insert_stretch): Explicit host variables in INSERT statements. The former implicit statement (e.g. " VALUES (:h_stretch)") caused an error 201: Too many parameters (returned by the server). * impl/postgresql/dagreater_pg.pgc: Code cleanup: File covered a bunch of "unused" variables. Commented out where possible, v_module references wrapped with pre-processor clauses. * README: Fixed option: --wrapper-with-debug-output 2004-10-28 Frank Koormann Added two new parameters to the stretch_tab for stretch volume: vol_val and vol_dist: ALTER TABLE stretch_tab ADD COLUMN vol_val VARCHAR(255); ALTER TABLE stretch_tab ADD COLUMN vol_dist VARCHAR(11); INSERT INTO para_tree_def_tab VALUES ('VOL_VAL', 'STRETCH_TAB', 'STRETCH_TAB', 'STRETCH_TAB', 'DISTRIB', -1, 85, 0, 0, 'Stretch volume', '', '', 'm^3', '', '', 'Stretch volume'); INSERT INTO para_tree_def_tab VALUES ('VOL_DIST', 'STRETCH_TAB', 'STRETCH_TAB', 'STRETCH_TAB', 'INT', -1, 90, 0, 0, 'Stretch volume distribution', '', '', '', '', '', 'Stretch volume distribution'); The actual column definition must include a NOT NULL contraint! The new fields also is requires updates of numerous API sections: * dagreater/apispec.py: Added vol_val and vol_dist to DA_S_strech ListStruct * impl/postgresql/dagreater_pg.h: Added vol_val and vol_dist to DA_T_stretch_pg_h and DA_T_stretch_pg_i * impl/postgresql/datypes_pg.h: Added vol_val and vol_dist to DA_T_stretch * impl/postgresql/gdagreater_pg.pgc (gda_get_stretch, gda_insert_stretch, gda_update_stretch, gda_delete_stretch): Added vol_val and vol_dist (gda_get_version): Upated copyright statement. * impl/postgresql/test/PostgreSQL/create_db_objects.sql: Added vol_val and vol_dist to create table stretch_tab. * README: Added --wrapper_with_debug_output to the documented options of setup.py 2004-07-14 Harjo Korte * impl/postgresql/gdagreater_pg.pgc (gda_load_bin_obj): Fix Bug in if/else condition opening binary file 2003-01-07 Frank Koormann * GreaterDB/dssfiledb.py: added da_insert_bin_obj() 2003-12-09 Harjo Korte * impl/postgresql/install_doc.tex: new 2003-12-08 Frank Koormann * impl/postgresql/gdagreater_pg.pgc (lgda_set_connection_values): Fix Bug in if/else condition grouping 2003-12-08 Frank Koormann * README: Updated formatting * impl/postgresql/gdagreater_pg.pgc (lgda_set_connection_values): Use of string pointers without initialization caused segfault. 2003-12-08 Harjo Korte * README: added PostgreSQL options for setup.py 2003-12-01 Harjo Korte * impl/postgres/gdagreater_pg.pgc: added password to connect-stmt 2003-11-26 Harjo Korte * PostgreSQL/update_temp_sess.sql : New (added to impl/postgresql/test/) 2003-11-19 Harjo Korte * test_pg_a_res.py, test_pg_b_subst.py, test_pg_c_catch.py, test_pg_d_connect.py, test_pg_e_para_tree_def.py, test_pg_f_stretch.py, test_pg_g_disch.py, test_pg_h_market.py, test_pg_i_env.py, test_pg_j_sess.py, test_pg_k_mod.py, test_pg_l_user.py, test_pg_m_group.py, test_pg_n_message.py, test_pg_o_phrase.py, test_pg_p_bin_obj.py, test_pg_q_temp_sess.py, README, postgressupport.py, runtests.py, support.py, PostgreSQK/create_db_objects.sql, PostgreSQL/create_system.sql, PostgreSQL/drop_db_objects.sql, PostgreSQL/inserts.sql, PostgreSQL/update_objects.sql : New (added to impl/postgresql/test/) 2003-11-19 Harjo Korte * gdagreater_pg.pgc : cleaned up some mess 2003-11-19 Harjo Korte * daexlib.h, gdaexlib.h, dagreater_pg.h, datypes_pg.h, dagreater_pg.pgc, gdagreater_pg.pgc : New, ported API from ORACLE to PostgreSQL. 2003-11-19 Harjo Korte * setup.py : Modification to consider pgsql api modules structure 2003-09-23 Frank Koormann * test/mock_db.py (MockDB.da_insert_stretch_class, MockDB.da_insert_market, MockDB.da_insert_sess_disch): Bugfixes (MockDB.da_update_mod_de): new. 2003-07-21 Bernhard Herzog * README: Fix Typo. 2003-07-14 Frank Koormann * test/mock_db.py (MockDB.da_update_subst_det): New, implement API method da_update_subst_det(). 2003-06-06 Frank Koormann Update Err_Format to "GreaterAPIError:%d:%ld:%s", err.err_type, err.err_no, err.err_param * dagreater/apispec.py: SpecialFunction('da_create_temp_sess'): Updated Err_Format * generator/GreaterAPIGenerator/dbfunctions.py (DBGetFunction.c_method_impl, DBInsertFunction.c_method_impl DBBulkInsertFunction.c_method_impl, DBUpdateFunction.c_method_impl, DBDeleteFunction.c_method_impl): Updated Err_Format * generator/WrapperGenerator/functions.py (WrappedFunction.c_method_impl): Updated Err_Format * generator/test/test_db_functions.py (TestDBGetFunction.test_get_function_c_method_impl, TestInsertFunction.test_insert_function_c_method_impl, TestParamInsertFunction.test_insert_function_c_method_impl, TestInsertLoadFunction.test_insert_function_c_method_impl, TestBulkInsertFunction.test_bulk_insert_function_c_method_impl, TestUpdateFunction.test_update_function_c_method_impl, TestDeleteFunction.test_delete_function_c_method_impl): Updated Err_Format * generator/test/test_format.py (TestListStruct.test_format_api_module): Updated Err_Format * generator/test/test_wrapped_function.py (TestWrappedFunction.test_wrapped_function_c_method_impl): Updated Err_Format 2003-06-06 Silke Reimer * GreaterDB/dssfiledb.py: improvement of performance for writing results by using dictionaries instead of lists for temporary result storage 2003-05-21 Bernhard Herzog Provide a way to specify pointers that can be NULL and use it for the file_obj in DA_S_bin_obj. * generator/WrapperGenerator/typesystem.py (Pointer.__init__): New parameter and instance variable allow_null to indicate that the pointer may be NULL in C which is mapped to None in Python. (Pointer.__repr__): Put the allow_null value into the repr (Pointer.py_from_c): Remove the special case for the 's->file_obj' variable name. Handle the allow_null flag (Array.parse_tuple_char): The only supported case is char* with allow_null false * generator/GreaterAPIGenerator/greatertypes.py (ListStruct.to_dict_impl): handle file_obj case special here. The special casing used to be (ListStruct.from_dict_impl): Honor the allow_null flag in the char* special case * generator/test/test_types.py (TestPointer.test_pointer_to_char_or_null): New. Tests for char pointers that can be NULL. * generator/test/test_list_struct.py (TestListStructWithPointer.test_from_dict_impl): New. tests for a struct with various char pointers including one for the very special case of a field member called file_obj * generator/test/test_db_functions.py (TestInsertFunction) (TestInsertLoadFunction): TestInsertLoadFunction used to be called TestInsertFunction which hid the real TestInsertFunction * dagreater/apispec.py (DA_S_bin_obj): Allow file_obj to be NULL 2003-05-19 Frank Koormann * test/mock_db.py (da_create_temp_sess): Update to API v3.4: new parameter temp_type. In case, build session from scratch. 2003-05-09 Frank Koormann * test/mock_db.py (da_insert_bin_obj, da_get_bin_obj): New 2003-05-06 Bernhard Herzog * generator/WrapperGenerator/typesystem.py (SimpleType.py_to_c): Make the generated code check for errors in the conversion of unsigned ints * generator/test/test_types.py (TestUnsignedInt.test_unsigned_int): Update the test case for the py_to_c conversion of unsigned ints. 2003-05-06 Bernhard Herzog * generator/GreaterAPIGenerator/dbfunctions.py (DBInsertFunction.c_method_impl): Insert the PyArg_ParseTuple parameters (the format character and the pointer) for the record at the correct position. This fixes a problem with the new DBInsertLoadFunction wrappers where the record was last in the python interface of the C-level wrapper. The same bug was in the code generated for DBParamInsertFunction which luckily was only used for da_insert_user which isn't used by our code in GREAT-ER. The only places where that function is called are in tests using the MockDB. * generator/test/test_db_functions.py (TestParamInsertFunction.test_insert_function_c_method_impl) (TestInsertFunction.test_insert_function_c_method_impl): Update the tests to match the bug fixed version. 2003-05-05 Bernhard Herzog * dagreater/apispec.py (da_load_bin_obj): Added. * generator/GreaterAPIGenerator/dbfunctions.py (DBInsertLoadFunction): New class for the new kind of insert function that uploads binary files. * generator/test/test_db_functions.py (TestParamInsertFunction): New. test cases for DBInsertLoadFunction. 2003-04-29 Bernhard Herzog * dagreater/apispec.py (da_create_temp_sess): Add new temp_type parameter (DA_S_group_priv, da_get_group_priv, da_free_group_priv): Commented out because the functions are not in the header file anymore in the db-api version 3.3. * generator/WrapperGenerator/functions.py (WrappedFunction.c_method_impl): Use %ld in the error message formatting because the code is actually a long in the DA_T_errinfo struct. * generator/GreaterAPIGenerator/dbfunctions.py (DBGetFunction.c_method_impl) (DBInsertFunction.c_method_impl) (DBBulkInsertFunction.c_method_impl) (DBUpdateFunction.c_method_impl, DBDeleteFunction.c_method_impl): Use %ld in the error message formatting because the code is actually a long in the DA_T_errinfo struct. * generator/test/test_db_functions.py (TestDBGetFunction.test_get_function_c_method_impl) (TestInsertFunction.test_insert_function_c_method_impl) (TestParamInsertFunction.test_insert_function_c_method_impl) (TestBulkInsertFunction.test_bulk_insert_function_c_method_impl) (TestUpdateFunction.test_update_function_c_method_impl) (TestDeleteFunction.test_delete_function_c_method_impl): Update the tests for the %ld change * generator/test/test_format.py (TestListStruct.test_format_api_module) (TestListStruct.test_format_api_module): Update the tests for the %ld change * generator/test/test_wrapped_function.py (TestWrappedFunction.test_wrapped_function_c_method_impl): Update the tests for the %ld change 2003-04-02 Bernhard Herzog * setup.py (GenerateWrapper.finalize_options, GenerateWrapper.run): Allow the case where neither of the oracle interface parameters is given in which case no C-level wrapper is built. * test/support.py: New module with support code for the tests * test/test_dssfiledb.py: Use our own new support module. (Test_da_db_connect.test_db_not_exists): Use assertRaises to test whether the correct exception is being raised. 2003-04-01 Frank Koormann * GreaterDB/dssfiledb.py: Fixes for coupling with GREAT-ERModel (da_db_disconnect): Just unset the user_id. (da_get_mod_det): Model details have no distibution, set to 0. (da_insert_bulk_res_stretch): Added verbosity on error messages, changed CSIMINTERNAL field name to CSIMINTERN. (da_get_stretch): Added diff_catch and diff_frac. (da_get_market): Ignore market_id. (da_get_sess_disch): Ignore sess_disch_id. (da_get_diffuse_det): Explicitely connect to the database, since da_get_diffuse_det is not part of the GREAT-ER API framework. * test/test_dssfiledb.py (Test_da_get_diffuse_det.test_can_get_diff_details): Test adapted to modified da_get_diffuse_det parameters. 2003-03-28 Jan-Oliver Wagner * test/README: New. * test/test_dssfiledb.py (Create_simulini): Extended to have all filename flexible. (Create_disch, Create_dischclass, Create_emission, Create_river, Create_rivclass): Fixes according to changes in specification. (Create_localdisch, Test_da_get_diffuse_det, Test_da_get_disch_class, Test_da_get_stretch, Test_da_get_stretch_class, Test_da_get_market, Test_da_get_sess_disch, Test_da_get_sess, Test_da_update_sess, Test_da_delete_res, Test_da_insert_res, Test_da_update_res, Test_da_insert_res_disch, Test_da_insert_bulk_res_stretch): New. * GreaterDB/dssfiledb.py: Intensive work: Basically added all missing implementations. 2003-03-26 Jan-Oliver Wagner * test/mock_db.py (MockDB.da_insert_res, MockDB.da_update_res): Added specification as doc-string for several methods. * test/test_dssfiledb.py (Create_model, Create_disch, Create_dischclass, Create_emission, Create_input_diff, Create_river, Create_rivclass): New. (Test_da_db_connect.test_db_exists): Now tests for other variables since the ones before are not specificied anymore. (Test_da_get_mod_det): Adapted to new specification (model params now have a separate file). (Test_da_get_disch): New. * GreaterDB/dssfiledb.py (DSSFileDB.da_get_mod_det): Adapted to new specification. (DSSFileDB.da_get_mod): Removed. (DSSFileDB.da_insert_res, DSSFileDB.da_update_res): Added specification as doc string. (DSSFileDB.da_get_disch): Implemented. 2003-03-24 Jan-Oliver Wagner * GreaterDB/dssfiledb.py (DSSFileDB.da_get_subst_det, DSSFileDB.da_get_env_det): Added implementation. * test/test_dssfiledb.py (Create_simulini, Create_environmental, Create_substance): New. (Test_da_db_connect.setUp): Moved some code to Create_simulini. (Test_da_get_env_det, Test_da_get_subst_det, Test_da_get_mod_det): New. 2003-03-20 Jan-Oliver Wagner * GreaterDB/dssfiledb.py: New. A specific API implementation for GREAT-ER DSS Elbe. * test/runtests.py: New. Main entry point for the GREAT-ER-ÐB test. Just run this file as a python script to execute all tests. * test/test_dssfiledb.py: New. Test dssfiledb class. * test/mock_db.py: Added specification as doc-string for several methods. (MockDB.da_get_version): New. * GreaterDB/interface.py: fixed a comment typo. 2003-02-18 Bernhard Herzog * setup.py (GenerateWrapper.oracle_extension_from_lib): Assume that the header files are in the same directory as the DLL 2003-02-07 Bernhard Herzog * test/mock_db.py (MockDB.da_update_res): New. 2003-02-06 Bernhard Herzog * test/mock_db.py (MockDB.da_insert_bulk_res_stretch): New. 2003-01-24 Jan-Oliver Wagner * test/mock_db.py (MockDB.da_insert_para_tree): New. 2003-01-23 Bernhard Herzog * test/mock_db.py (MockDB.__init__): Add res_tab, res_stretch_tab, res_disch_tab and corresponding id counters. (MockDB.da_get_res, MockDB.da_insert_res, MockDB.da_delete_res): New. Methods to handle DA_S_res (MockDB.da_get_res_stretch, MockDB.da_insert_res_stretch): New. Methods to handle DA_S_res_stretch (MockDB.da_get_res_disch, MockDB.da_insert_res_disch): New. Methods to handle DA_S_res_disch 2003-01-16 Bernhard Herzog * dagreater/apispec.py (DA_S_res): The stp_factor field has actually 41 chars. 2003-01-16 Jan-Oliver Wagner * test/mock_db.py (MockDB.da_cleanup_temp_sess): new. But a dummy so far. 2003-01-16 Jan-Oliver Wagner * test/mock_db.py (MockDB.authorized_to_write): Now at least checks for the user (though not the group). (MockDB.da_get_subst): now considers the is_templ flag. 2003-01-15 Jan-Oliver Wagner * test/mock_db.py (NULL_ID, NULL_NUMERIC): new (MockDB.__init__): initialize user_id. (MockDB.authorized_to_write): new, but still a dummy. (MockDB.da_db_connect): now stores the user_id. (MockDB.da_get_sess): now returns copied records instead of the original. (MockDB.da_insert_sess): now copies the record correctly. (MockDB.da_update_sess): now copies the record correctly. (MockDB.da_get_subst): now returns copied records instead of the original. (MockDB.da_insert_subst): now works almost according to API Spec. (MockDB.da_update_subst, MockDB.da_delete_subst): new. 2003-01-13 Bernhard Herzog * test/mock_db.py (MockDB.da_db_disconnect): Added. 2003-01-07 Bernhard Herzog * GreaterDB/interface.py (set_api_interface): Allow dotted names in the modulename and provide a way to refer to an object in the module. See the doc-string for how this works. 2003-01-03 Frank Koormann * test/mock_db.py (da_get_stretch, da_insert_stretch, da_get_stretch_class, da_insert_stretch_class, da_get_disch, da_insert_disch, da_get_disch_class, da_insert_disch_class, da_get_market, da_insert_market, da_get_sess_disch, da_insert_sess_disch, da_insert_subst_det, da_get_subst_det, da_get_env, da_insert_env_det, da_get_env_det): New 2003-01-02 Bernhard Herzog * generator/test/test_types.py (TestArray.test_array_of_char), generator/test/test_list_struct.py (TestListStruct.test_from_dict_impl), generator/test/test_format.py (TestListStruct.test_format_api_module): Update the tests because of the additional checks in Array.py_to_c (TestPointer.test_pointer_to_char): Add doc-string * generator/WrapperGenerator/typesystem.py (Array.py_to_c): For an array of char, make the generated C-code raise an exception if the object is not in fact a string. 2002-12-20 Frank Koormann * test/mock_db.py: New, moved to here from GREAT-ER/test 2002-12-18 Jan-Oliver Wagner * generator/test/test_db_functions.py (TestParamInsertFunction): new * generator/GreaterAPIGenerator/dbfunctions.py (DBInsertFunction): introduced self.dbrecord_pos which specifies the position of the actual record for the insert action in the list of parameters. Constantly set to -2 for this class. (DBParamInsertFunction): new * dagreater/apispec.py: DBParamInsertFunction() definition of da_insert_user added. 2002-12-04 Bernhard Herzog * setup.py (GenerateWrapper.run), GreaterDB/interface.py (set_api_interface): The automatically generated python wrapper is now named pydagreater. On windows, dagreater.py would be overridden by the dagreater.dll so they couldn't be both in the GreaterDB directory. 2002-11-27 Bernhard Herzog Started new separate CVS repository for the DB API wrapper.