**** XSQLMENU: An X-windows frontend for the MiniSQL database engine. ****
**** (c) 1996 Kees Lemmens; TU Delft The Netherlands. **** **** Version 2.10 (BETA release with MySQL support) ****
- General
The popular MiniSQL database engine by David Hughes Technologies in Australia is a simple but very robust database engine that supports also remote access through TCP sockets. The only problem is that it lacks a good and friendly user interface.
As we planned to make our student administration a little more sophisticated (up to now we used ASCII files ...) I decided to use the nice Xforms package by T. Zhao and M. Overmars and try to build such a good, flexible and robust interface.
This fits into my opinion that although the Unix OS is a very powerful and reliable OS, it won't be able to hold against the pressure of less reliable systems if it doesn't come up with more user friendly interfaces.
I hope this package can be of help to setup a good looking and easy to use database environment on Unix systems like Linux.
WARNING: This package cannot run without having the msqld (MiniSQL daemon) running on one of your systems (which not necessarily has to be the same system you're runing xsqlmenu on !). The msqld is available on most of the large sites. (try for more info about MiniSQL http://Hughes.com.au/ )
- Install
The source code is available as Xsqlmenu_xxxx.tar.gz and a distribution with binaries for Linux is available as Xsqlmenu_xxxxLinuxBin.tar.gz.
There are 2 versions in the binary Linux package: - a statically linked version that can run on any Linux PC (with ELF) - a dynamic version that will only run if you have somewhere libXforms.so.0.* - in your library search path.
You only need to have the binary somewhere in your searchpath. Currently no other files are needed to run this program.
A few notes:
- Don't forget to select a MSQL database server (if not selected it tries to connect to a server on the local host), a database and a table before starting to make any selections or else you won't be able to open any of the subwindows. ( Message: "Select a table first !")
- The primary key field is shown in red, all others fields in black. The primary key can't be modified with xsqlmenu (although the Mini SQL database can do that without problems): if you want to change the primary key, you'll have to delete the record and insert a new one. However, you can copy fields from one window to another by one using the mouse.
I deciced to keep the primary key field locked to avoid confusion with the users: It's easy to lose important information if you change the primary key by accident as I found out here.
- It is no problem to have browsers and search screens open from different tables or even databases simultaneously. But, if you select a new database it will be impossible to modify or select records from windows that still work with the previous database. If you want to update or modify those records you should simply reselect the old database and the previous connection will be reestablished.
- If you select a record from the browser and modify or delete it, the browser won't be updated with the new information: it works on a static selection that is stored locally. However, every time you select a record for modification it will be reread from the database server to ensure you have the latest version.
- In the SQL Query window you can enter a free SQL query. However, I haven't checked extensively what happens if you use anything else but SELECT queries. Also, because strange things could happen if you select joins from several tables or only select a few fields I decided to block the modify option in the browser. It is simply too difficult to decide what information the user wants to change in what database. I considered to enable the 'modify' option for the SQL Query command (it's only 1 switch in the code !), but I really think this can be too tricky. If you want to modify information: just select the appropriate record on the primary key (with the Modify button in Main Window) or use a Search Form or the normal Browser (Show All).
- In the browser you can change the fontsize. However, if the font actually
changes with every step depends on the setup of your display font
capabilities (scaled fonts, fixed fonts etc.). Also, there is no way to
scroll horizontally yet as the Xforms browser simply doesn't provide that
option. (although there exists a function to "x_offset" a browser !) However,
the browser window is scalable and also the fontsize can be changed, so in
most cases you'll be able to see all information without too many
difficulties.
- Comments
If you have any comments, found any bugs or just want some extra features to be added: write email to lemmens@dv.twi.tudelft.nl and I'll see what I can do.
- MySQL
Because of the popularity of MySQL, and the similarity of its API to the mSQL API, MySQL has been added as an alternative server for Xsqlmenu. The choice of which SQL backend to use is a compile time option.
MySQL Comments:
At present Xsqlmenu does not accept a username and password to use when connecting to a MySQL database server. This may be added in a future release, but if it is needed, a user could hardwire a username and password into the "sql_connect" call in XsqlHelpers.c.
Like the mSQL version of Xsqlmenu, a field is selected to be the "Primary Key". This key gets hightlighted in red and should not be changeable. In the MySQL version, this field is selected by first looking for a field that is both unique and labled as the primary key. If none is found, then the first unique field is used. If no unique key is found, then the MySQL primary key is selected. If none of these are found, then the first key is chosen to be the primary key.
It is a good idea to have a field in each table is that is a Unique Primary key.
