.TH SqlManager Onyx
.SH NAME
SqlManager.ppg \- Base-Grammar for SQL's
.SH SYNOPSYIS
.nf
class SqlManager : public SqlParser {
	SqlParser *sql_actor;
	int      (*sql_backend)(SqlParser *sql);
	int	   uid,gid;
	char      *sql_user;
	
	SqlManager();
	virtual ~SqlManager();
	
	virtual int		sql();
	virtual int		statement();
	virtual int		user();
	
	virtual int		sql_open();
	virtual int		sql_close();
	
	virtual Text   	 	*sql_getresult();
	virtual char   	 	*sql_getrow();
	virtual LineStream   	*sql_getstream();
	virtual int		sql_getnum();
	}
.fi
.SH DESCRIPTION
SqlManager is the class Y normaly use in Yr clients. And its also
used in \fBgsqld\fR Sql-Server.

SqlManager is using sql_actor for doing the real job, so sql_actor
is normaly a SqlEngine.
If Y need a new Engine take a close look to the implementation of
sql_open().

If sql_backend is not null, it's called anytime after a statement
was executed.

The diagnostig methods sql_getresult() are overloaded to be
executed from the backend.
.SH IMPLEMENTATION
.PP
sql : 
.br
.in +0.8i
.ad l
.nh
( eof  | "by" | "quit" | eof  | statement  ";" ) 
.br
;
.br
.hy

This is the main parser loop, it's a bit tricky to check eof 
twice, but its nessesary. If it's not eof, nor "by" or "quit"
it checkes if its a valid statement ending with ";".
.PP
statement : 
.br
.in +0.8i
.ad l
.nh
database  | user  | matchexp  
.br
;
.br
.hy

Only database and user\-statements are valid here. All other
statements are forwardet to the sql_actor, if it exists or
a message "No Database connection" is given. After execution
of the sql_actor, sql_backend is called if it's not null.
.PP
user : 
.br
.in +0.8i
.ad l
.nh
"user" matchexp  
.br
;
.br
.hy

This is a BIG securrety hole. It should be rewritten in Onyx\-3.
.SH AUTHOR
Michael Koehne <kraehe@bakunin.north.de>
