dbutil - A Dynamic SQL Generation Library
Be the first to post a text review of dbutil - Dynamic SQL Generation Library. Rate and review a project by clicking thumbs up or thumbs down in the right column.
Libdbutil is a C library used to allow user-interfaces to more easily generate SQL for a database backend. The library can generate standard SELECT, INSERT , UPDATE and DELETE statements for use by most RDBMS systems including; mySQL, postgreSQL and Informix. The library includes support for several GTK+ widgets, but can be used for SQL generation from other user interfaces also. The library has full support for table joins and foreign keys within SELECT statements, which allows the library to generate SQL for very complex UIs.
(05-12-2001) v0.7.0Todd Shadburn tshadb@attglobal.net * Use GString throughout. This now allows the strings to dynamically grow as the SQL statements are built. * Convert all variables to basic datatypes provided by glib. * dbutil_table_add_field() returns gint instead of void. Returns -2 if the field is already in the table specified. * Created 'basictest' test application. * Cleanup a couple of pieces of code. * Create gtkexample program. * Added Theory/Usage/API documentation. * Added GtkExtra checks for autoconf (04-14-2001) v0.6.3Todd Shadburn tshadb@attglobal.net * Package name changed from tutil to dbutil to match it's purpose. * Package is now an automake/autoconf/libtool package. (05-28-2000) v0.6.3Todd Shadburn tshadb@ibm.net * dbutil_relationset_update(): Fields will appear in the SET part of the SQL statement even if the field_d->data value is not set. This is done this way so that if a field is blanked, the database row will be updated correctly(column value blanked). * field_get_sql_value(): If the field is blank and is of type DBF_INT pass a 0 as the field value to blank the database column. * Fixed some sections of code that called field_get_sql_value() but didn't free the returned string when finished with it. (04-25-2000) v0.6.2Todd Shadburn tshadb@ibm.net * Added support for Toggle/Check/Radio buttons. (04-24-2000) v0.6.1Todd Shadburn tshadb@ibm.net * Fixed problem in dbutil_relationset_insert(): if field is a GTK_OPTION_MENU and DBF_INT and no selection was made, no value was put in the SQL. Now if no selection was made the SQL value will be 0. * dbutil_gtk_table_sync_with_gui(): Added support for GTK_OPTION_MENU widgets with a field specified to be of type DBF_CHAR. * dbutil_relationset_update(): Fields marked as DBF_PRIMARYKEY or DBF_UNIQUEPART will not appear in the 'SET' portion of the SQL statement. * dbutil_gtk_field_fill: If field is of type DBF_PRIMARYKEY or DBF_UNIQUEPART then the widget(if any) will have it's sensitivity set to FALSE. When calling dbutil_gtk_field_clear() the widget's sensitivity will be set to TRUE. * Predeclare the dbtable_t structure for use in the dbfield_t struct. This prevents us from having to cast to (dbtable_t *) everytime we get the table reference from the dbfield_t structure. * Added dbutil_gtk_table_set_fields_sensitive() which allows all GTK widget's sensitivity to be changed for the whole table. Fields which are of type DBF_PRIMARYKEY or DBF_UNIQUEPART are not affected. (03-22-2000) v0.6.0Todd Shadburn tshadb@ibm.net * Now using GLIB's GSLists for all linked lists. Removed the t_list stuff. * Deleted some of the older header and source files from the distribution directory. TODO: * Create Documentation; API, Theory & Usage, examples * setup auto* configuration(configure/make/make install) (03-20-2000) v0.5.9Todd Shadburn tshadb@ibm.net * Browser code bugfixes have been completed and tested. * Cleanup done on some of the code. dbutil_relationset_select() - uses dbutil_tableset_get_table() instead of the hand coded stuff. TODO: * Convert to using GSList instead of my own linked-list. (03-13-2000) v0.5.8Todd Shadburn tshadb@ibm.net * Finished coding dbbrowser functions. Add test in tests/testdbutil2. Basic tests in the test program seemed to work correctly. * Removed the unused variables in gtk_option_menu_get_active_text() to remove compiler warnings. TODO: * Cleanup some of the code. dbutil_relationset_select() - use dbutil_tableset_get_table() instead of the hand coded stuff. * Maybe separate the GTK functions into a new header. All functions should remain in one library, but separating the GTK functions will make the library more flexible and simplify use with non-GTK apps. (03-11-2000) * Begin Adding support for dbbrowser. Added structure and function prototypes to dbutil.h. Began coding functions in dbutil.c (02-22-2000) v0.5.7Todd Shadburn tshadb@ibm.net * Added gtk_option_menu_get_active_text() (01-29-2000) v0.5.6Todd Shadburn tshadb@ibm.net * Added functions: dbutil_table_get_field() - get a table field by name. (01-19-2000) v0.5.5Todd Shadburn tshadb@ibm.net * Now uses GtkDbSheet instead of GtkSheet widgets. * Added functions: dbutil_relationset_full_free() - free relationset and all children objects. (01-17-2000) v0.5.4Todd Shadburn tshadb@ibm.net * Added functions: dbutil_table_set_flags() dbutil_table_clear_flags() dbutil_table_set_widget() dbutil_gtk_relationset_multirow_start() dbutil_gtk_relationset_multirow_next() dbutil_gtk_relationset_multirow_free() * Changed functions: dbutil_relationset_select() - returns char*, not relselect* dbutil_relationset_update() - added section to deal with a unique key in the table, if no primary key is found. * Added typdefs: sqlhandle_t * Added defines: DBF_NOGUIWIDGET DBT_MULTIROW SQLH_SELECT SQLH_INSERT SQLH_UPDATE SQLH_DELETE * Changed structures: relselect_t - added flags element relselect_t - added multirownumber relselect_t - renamed PrimaryTableIndex to primarytable relselect_t - changed primarytable from int to dbtable_t* dbtable_t - added widget element (01-09-2000) v0.5.3Todd Shadburn tshadb@ibm.net * Added functions: dbutil_gtk_relationset_sync_with_gui() dbutil_gtk_table_required_fields_filled() dbutil_relationset_insert() dbutil_relationset_update() dbutil_relationset_delete() * Some small changes to several functions to easy the inclusion of the functions above. * Added defines: DBF_REQUIRED, DBF_OPTIONLIST (01-07-2000) v0.5.2Todd Shadburn tshadb@ibm.net * dbutil_relationset_select(): Increment 'andind' after every call from field_get_where() or table_get_where_fields() that returns a non NULL string. This fixes a problem where the function is called with userelations = 1 and no relation joins are created, but a foreign key existed. The foreign key part of the statement was missing the 'and' keyword. * Changed all 'malloc()' calls to 'g_malloc()' and 'free()' to g_free()'. I was getting alot of SEGVs that happened in free(). After this change was made the problem seems to have disappeared. (01-05-2000) V0.5.1Todd Shadburn tshadb@ibm.net * Added the 'str' variable to the dbutil_table_sync_with_gui() function. gtk_entry_get_text() returns an empty string ("") and not a NULL when the entry field is blank...so we have to check for this. Also made the following change to dbutil_field_clear_data(): field->flags -= (field->flags & DBF_HASDATA); instead of, field->flags -= DBF_HASDATA; (01-04-2000) v0.5Todd Shadburn tshadb@ibm.net * Some cleanup work was done and the GTK functions were added back into the API. First working version fully supporting relationships and foreign keys. Added functions: table_get_where_fields() field_get_where() relation_get_foreign_where() (01-03-2000) v0.4Todd Shadburn tshadb@ibm.net * dbutil2.h & dbutil2.c added: This is a more flexible revision of the dbutil API... support for relationships. (12-06-1999) v0.3Todd Shadburn tshadb@.ibm.net * dbutil.c: Fixed a problem where a program could SEGV because the dbset->tableset pointer was not set to NULL in dbutil_set_new(). Add the line to set the pointer to NULL.
Copyright © 2009 Geeknet, Inc. All rights reserved. Terms of Use
Thanks for your rating!
Would you also like to write a review?