------------------------------------------------------------------------------
-- BUSH Database Package Parser (MySQL support)                             --
--                                                                          --
-- Part of BUSH                                                             --
------------------------------------------------------------------------------
--                                                                          --
--              Copyright (C) 2001-2005 Ken O. Burtch & FSF                 --
--                                                                          --
-- This is free software;  you can  redistribute it  and/or modify it under --
-- terms of the  GNU General Public License as published  by the Free Soft- --
-- ware  Foundation;  either version 2,  or (at your option) any later ver- --
-- sion.  This is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
-- for  more details.  You should have  received  a copy of the GNU General --
-- Public License  distributed with this;  see file COPYING.  If not, write --
-- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
-- MA 02111-1307, USA.                                                      --
--                                                                          --
-- This is maintained at http://www.pegasoft.ca                             --
--                                                                          --
------------------------------------------------------------------------------
-- CVS: $Id: parser_mysql.ads,v 1.2 2005/08/17 23:46:30 ken Exp $

with ada.strings.unbounded, world;
use  ada.strings.unbounded, world;

package parser_mysql is

------------------------------------------------------------------------------
-- Database package identifiers
--
-- These will eventually be moved to the Database parser
------------------------------------------------------------------------------

mysql_column_index_type_t : identifier;
mysql_tuple_index_type_t : identifier;
mysql_tuple_count_type_t : identifier;

-- mysql_trace_mode_type_t : identifier;
-- mysql_trace_none_t      : identifier;
-- mysql_trace_db_t        : identifier;
-- mysql_trace_apq_t       : identifier;
-- mysql_trace_full_t      : identifier;

mysql_mode_type_t       : identifier;
mysql_read_t            : identifier;
mysql_write_t           : identifier;
mysql_read_write_t      : identifier;

-- mysql_fetch_mode_type_t  : identifier;
-- mysql_sequential_fetch_t : identifier;
-- mysql_random_fetch_t     : identifier;

-- mysql_database_type_t     : identifier;
-- mysql_engine_postgresql_t : identifier;
-- mysql_engine_mysql_t      : identifier;
-- mysql_engine_oracle_t     : identifier;
-- mysql_engine_sybase_t     : identifier;
-- mysql_engine_db2_t        : identifier;

mysql_connect_t      : identifier;
mysql_disconnect_t   : identifier;
mysql_is_connected_t : identifier;
mysql_reset_t        : identifier;
mysql_error_message_t: identifier;
mysql_notice_message_t: identifier;
mysql_in_abort_state_t: identifier;
mysql_options_t      : identifier;
mysql_will_rollback_on_finalize_t : identifier;
mysql_set_rollback_on_finalize_t : identifier;
mysql_open_db_trace_t: identifier;
mysql_close_db_trace_t: identifier;
mysql_set_trace_t    : identifier;
mysql_is_trace_t     : identifier;
mysql_clear_t        : identifier;
mysql_prepare_t      : identifier;
mysql_append_t       : identifier;
mysql_append_line_t  : identifier;
mysql_append_quoted_t: identifier;
mysql_execute_t      : identifier;
mysql_execute_checked_t : identifier;
mysql_raise_exceptions_t : identifier;
mysql_report_errors_t : identifier;
mysql_begin_work_t   : identifier;
mysql_commit_work_t  : identifier;
mysql_rollback_work_t : identifier;
mysql_rewind_t : identifier;
mysql_fetch_t : identifier;
mysql_end_of_query_t : identifier;
mysql_tuple_t        : identifier;
mysql_tuples_t       : identifier;
mysql_columns_t      : identifier;
mysql_column_name_t  : identifier;
mysql_column_index_t : identifier;
mysql_column_type_t  : identifier;
mysql_is_null_t      : identifier;
mysql_value_t        : identifier;
mysql_engine_of_t    : identifier;
mysql_show_t         : identifier;
mysql_list_t         : identifier;
mysql_schema_t       : identifier;
mysql_users_t        : identifier;
mysql_databases_t    : identifier;

------------------------------------------------------------------------------
-- HOUSEKEEPING
------------------------------------------------------------------------------

procedure StartupMySQL;
procedure ShutdownMySQL;

------------------------------------------------------------------------------
-- PARSE THE DATABASE PACKAGE
------------------------------------------------------------------------------

procedure ParseMySQLConnect;
procedure ParseMySQLPrepare;
procedure ParseMySQLAppend;
procedure ParseMySQLAppendLine;
procedure ParseMySQLAppendQuoted;
procedure ParseMySQLExecute;
procedure ParseMySQLExecuteChecked;
procedure ParseMySQLDisconnect;
procedure ParseMySQLIsConnected( result : out unbounded_string );
procedure ParseMySQLReset;
procedure ParseMySQLErrorMessage( result : out unbounded_string );
-- procedure ParseMySQLNoticeMessage( result : out unbounded_string );
procedure ParseMySQLInAbortState( result : out unbounded_string );
procedure ParseMySQLOptions( result : out unbounded_string );
procedure ParseMySQLSetRollbackOnFinalize;
procedure ParseMySQLWillRollbackOnFinalize( result : out unbounded_string );
procedure ParseMySQLOpenDBTrace;
procedure ParseMySQLCloseDBTrace;
procedure ParseMySQLSetTrace;
procedure ParseMySQLIsTrace( result : out unbounded_string );
procedure ParseMySQLClear;
procedure ParseMySQLRaiseExceptions;
procedure ParseMySQLReportErrors;
procedure ParseMySQLBeginWork;
procedure ParseMySQLRollbackWork;
procedure ParseMySQLCommitWork;
procedure ParseMySQLRewind;
procedure ParseMySQLFetch;
procedure ParseMySQLEndOfQuery( result : out unbounded_string );
procedure ParseMySQLTuple( result : out unbounded_string );
procedure ParseMySQLTuples( result : out unbounded_string );
procedure ParseMySQLColumns( result : out unbounded_string );
procedure ParseMySQLColumnName( result : out unbounded_string );
procedure ParseMySQLColumnIndex( result : out unbounded_string );
--procedure ParseDBColumnType( result : out unbounded_string );
procedure ParseMySQLIsNull( result : out unbounded_string );
procedure ParseMySQLValue( result : out unbounded_string );
procedure ParseMySQLEngineOf( result : out unbounded_string );
procedure ParseMySQLShow;
procedure ParseMySQLList;
procedure ParseMySQLSchema;
procedure ParseMySQLUsers;
procedure ParseMySQLDatabases;

-- for embedded SQL

procedure DoMySQLSQLSelect( sqlcmd : unbounded_string );
procedure DoMySQLSQLStatement( sqlcmd : unbounded_string );

--procedure ParseDBIPrepare( result : out unbounded_string );
--procedure ParseDBDo( result : out unbounded_string );
--procedure ParseDBFetchrow( result : out unbounded_string );

end parser_mysql;
