Re: [gnome-db] Gnome-DB SQL Window syntax hi-lighting of keywordsRo


Yes, we can do that.  However, for gnome_db_sql_editor_get_all_commands,
can we return a linked list of strings where each string contains a SQL

This way, we could have something like a gnome_db_foreach_command(). 
For each SQL Command, run this function.

       sql_command_list = gnome_db_sql_editor_get_all_commands(
                                sql_editor_widget, run_pref);
       gnome_db_foreach_command ( sql_command_list, 
                                (GFunc) gnomedb_run_command );

This way, if a SQL Command fails when executing, we can stop executing
any commands, display the error to the user somehow (does not have to be
an error message box, this can be a preference) position the cursor
(whatever the terminology for the insertion point where a user types) to
the end of the SQL Command that caused the error.  Once the user has
corrected the error, they can continue where they left off starting with
the current command.

Notice the enumerated parameter named run_pref in the
gnome_db_sql_editor_get_all_commands function above.  If run_pref =
RUN_PREF_FromBeginning, then get the first command starting at the
beginning of the SQL editor.  Otherwise, if run_pref =
RUN_PREF_CurrentCommand, then get the first command starting at the
current command in the SQL editor.

Anybody willing to help or provide comments on this?

- Daniel

On Sat, 2002-03-16 at 18:47, Rodrigo Moya wrote:
> On Sat, 2002-03-16 at 17:19, Daniel Morgan wrote:
> > I just realized working on the syntax hi-lighting of SQL keywords in the
> > Gnome-DB SQL Window also provides the basis for the multiple
> > query/single execution feature.
> As I told you on IRC, it is a good idea to have a separated
> GnomeDbSqlEditor widget which manages all this, and which contains,
> let's say:
> const gchar *gnome_db_sql_editor_get_current_command (...);
> const gchar *gnome_db_sql_editor_get_all_commands (...);
> so that we can easily, from the parts using this widget, access the
> different strings (current command, all commands, etc) from the widget.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]