SqLay Logo
SqLay Install
  • Home
  • News
  • Screenshots
  • Licence
  • Download
  • Install
  • Doc
  • Bugs
  • TODO
  • ChangeLog
  • RPM's and Debian packages might still be provided but this is not sure due
    to the current lack of security of the code. If they are, find them on:
    
    	http://www.sqlay.org/download/
    
    	or
    
    	http://sourceforge.net/projects/showfiles.php?group_id=69329
    
    Otherwise, simply download the source code from the same locations and
    read further.
    
    From that point, you basically need to decide what you're interested in:
    all, the C-C++ applications only, the PHP framework only or the PHP
    framework with the PHP module (using the C drivers).
    
    If using RPM's or deb's, you may take a look at point 2 which introduces
    the C-C++ applications, then skip to last point which will explain the
    use of the PHP framework.
    
    If not using RPM's nor deb's and wishing to use the C-C++ stream or the 
    PHP module, or PHP code only but with manual installation, you first 
    need to compile and install this way:
    
    
    
    
    1. Manual compilation and installation:
    
    The simplest compilation doesn't need any developpement package and should
    normally compile on any Linux machine. Some other Un*x flavors may work
    partially (i.e. MacOSX, FreeBSD, Solaris). 
    Nevertheless, I'm afraid Cygwin support is now broken.
    
    If you wish to build the ncurses binaries, you will need the ncurses-devel 
    package (I started to develop using 5.2 but maybe older can work as well), 
    and in order to build the Qt binaries, you will need xdvel and qt-devel; 
    the Qt schema viewer builds (and runs with most functionalities) with Qt 
    from 1.x (I tested from 1.45 until 3.3.4) while you will need QT > 2.x if you also
    want the datasheet. If you wish to build the PHP framework, you need the
    msgfmt executable, shipped with gettext.
    
    The C database drivers of course need the client and devel packages for their
    RDBMS. You can check in the man pages, available also in html format in the
    source tree under the doc/ subdirectory, to see with which versions of the
    clients the drivers have been successfully compiled.
    
    Those packages are shipped with most Linux distributions, so the easiest way 
    to install them is probably from your CD's, otherwise you can visit those
    sites: 
    - http://www.gnu.org/software/ncurses 
    - http://www.trolltech.com/  
    - http://www.postgresql.org/ 
    - http://www.mysql.com/ 
    - http://www.freetds.org/
    - http://mdbtools.sf.net/ 
    - http://www.sqlite.org/
    - http://www.unixodbc.org/
    - http://www.iodbc.org/
    
    So, if you have none, some or all of those installed, now run:
    
    	$ ./configure --help
    
    in order to get an idea of the options available, namely --with-php, 
    --with-ncurses and --with-qt for the front-ends, and --with-pgsql, 
    --with-mysql (by default on), --with-freetds, --with-sqlite, --with-mdbtools 
    --with-unixodbc and --with-iodbc (by default off) for the back-ends.
    
    --enable-debug would allow you to run the data sheets with edition enabled
    but be aware that it theoretically could damage you data ( GPL + alpha tag
    + small project = for sure no warranty, you should be conscious of that ).
    
    --enable-build-method (hopefully) allows you to circumvent some problems
    if building on other than Linux (see below --enable-release-notes).
    
    You may need to adapt the xyz-libs and xyz-includes options if you see 
    warnings during the configure phase eventhough it tries to guess as much as 
    it can.
    
    You may also try:
    
    	$ ./configure --enable-release-notes
    	
    for last minute explanations: this just prints some kinda release notes and 
    compilation hints then exit.	
    
    Then type:
    	$ ./configure --with-the-options-that-you-wish
    	$ make
    	# make install
    
    If you need to remember the various standard configure options, its standard
    INSTALL file is located in the build directory. Note that some of the more
    advanced options, automatically added by configure, have not been tested nor
    even understood by me :)
    
    Note also that if you have chosen a custom --prefix, or in the (very unlike)
    situation where /usr/local/lib is not listed in /etc/ld.so.conf, before
    trying to use the software, you must make sure that the directory $prefix/lib
    (or $libdir if you choosed to change --libdir) is either listed in
    /etc/ld.so.conf, then run ldconfig as root, or, easier for a first try, make
    sure that this directory is in the environment variable LD_LIBRARY_PATH.
    
    
    
    
    2. Testing C-C++ applications:
    
    
    Now, give it a try by typing :
    
    	$ sqlsca
    or
    	$ sqlscc
    or
    	$ sqlscq
    	
    or even just
    
    	$ sqlsc
    
    which is normally a symlink to sqlscc (you may change if you wish).
    This should load the dummy (random) driver and show you a schema.
    
    For a real example, you can search for an SQL file on your harddisk or generate 
    one by yourself by typing:
    
    	$ pg_dump -s your_database > pg_dump_file.sql
    	
    if you use Postgres, then try:
    
    	$ sqlsc pg_dump_file.sql
    
    or do online visualisation with:
    	
    	$ pg_dump -s your_database | sqlsc
    or
    	$ sqlsc pgsql:
    or
    	$ sqlsc mysql:
    	
    and so on ... which would try to connect to your default database on localhost
    without password or, i.e.:
    
    	$ sqlsc mysql:yourdb/
    	
    (note the trailing slash) to connect to a specific db.	
    	
    You should then see a schema, including pk's indicated by '+' on the 
    left side of the column name, fk's indicated by '-' and datatypes 
    on the right side.
    
    The data sheets are available with executables called sqlds, so, i.e.
    
    	$ sqldsc mysql:yourdb/histable
    
    should display in ncurses flavour data in read-only mode if you are on a view 
    or if you haven't compiled --with-debug.
    
    So, from here, I suggest you to read the man pages if you want to go further.
    
    
    
    
    3. Configuring the PHP framework:
    
    First, You will need to make sure that a subdirectory called sqlay is accessible from 
    your include_path, (i.e. SqLay has been installed with --prefix=/usr, the PHP 
    framework should be located under /usr/share/sqlay/php/sqlay and /usr/share/sqlay/php 
    is in your include_path, then everything is fine). This can be done in several ways: 
    inside each page, in the site-wide php.ini or, in Apache (others ?), either in the 
    (virtual) server config or in a .htaccess file by using the php_value directive.
    
    Second, you should make SqLay icons accessible in your web server tree, i.e. by
    declaring an Alias in the (virtual) server config pointing towards the icons (located
    under $prefix/share/sqlay/icons/default). Alternatively, you may copy them anywhere
    in your existing web tree.
    
    Then you need to make sure that a file named sqlay_config.php is found by every page 
    calling SqLay library functions. This can be done in the same way as explained above.
    This sqlay_config.php is to be written by setting some global variables for the site:
    you may take inspiration from a sample sqlay_config.php file.
    
    From that point, you should read the man pages (sqlay_php and sqlay_config) to go
    further. Note that some simple sample pages are provided and you can start from
    modifying them.
    
    
    4. Final word:
    
    Please, do not expect too much from those tools. I personnaly use the C/C++ tools for
    developpement myself with some satisfaction, but for nothing else.
    
    As for the PHP framework, it is able to satisfy end-users in small teams on not too
    sensitive data nor complex schemas, but no more. At this stage, it simply doesn't
    provide sufficient functionalities to build production level applications, used 
    full-time, or by larger teams, or handling quantities of data greater than several 
    thousands (or even hundreds, depending of the use) of rows per table.
    
    

    SourceForge.net Logo E. Lurquin
    Dec 2007
    Viewable with any browser