head	1.3;
access;
symbols;
locks
	hroberts:1.3; strict;
comment	@# @;


1.3
date	98.03.24.05.47.01;	author hroberts;	state Exp;
branches;
next	1.2;

1.2
date	98.03.22.06.56.26;	author hroberts;	state Exp;
branches;
next	1.1;

1.1
date	98.03.19.07.29.45;	author hroberts;	state Exp;
branches;
next	;


desc
@@


1.3
log
@.
@
text
@Squile 1.0-

INSTALLATION

See the INSTALL file.

USAGE

Squile is a module for guile that allows guile to interact with
sql databases.  The guile interface is very simple, but (I hope)
also powerful.  There are only three commands: sql-create,
sql-query, and sql-destroy.

At this point, squile supports the MySQL and mSQL engines.

If you actually use this thing and need other functionality, including 
more functions or support for other database, either let me know, and
I'll see what I can do, or add it yourself and send me the changes !

**
syntax:  (sql-create <db-name> [<host-name>] [<user-name>] [<pass>])
example: (sql-create "addresses")
example: (sql-create "addresses" "address-server" "joe" "bonzo")

sql-create creates a connection to the sql engine and selects the
given database.  The last three arguments are optional.  sql-create
returns a number that is the id of the newly created database.  

I know that creating new connections is relatively expensive in
comparison to just selecting different databases, but I really don't
think that people often switch between different databases with great
frequency.  For my use, at least, the small sacrifice in time is
easily worth the increased simplicity of a single function to connect
to the sql engine and select the db.

**
syntax:  (sql-destroy <db-id>)
example: (sql-destroy 0)
example: (sql-destroy db)

sql-destroy destroys a database created with sql-create.  In
addition to freeing up a small amount of memory, sql-destroy closes
the connection to the database, so you really should be sure to call
this where appropriate.

If people actually use this package or if I get the gumption, I might
look into make the sql database object collectable, so this destroy
call would not be necessary anymore.

**
syntax:  (sql-query <db-id> <query>)
example: (sql-query 0 "select number from people where name = 'Sarah'")
example: (sql-query db "show tables")
example: (sql-query db 
		"update people set number = '555-1234' where name = 'Sarah'")

sql-query queries a database create with sql-create.  db-id is an
database id created by sql-create.  query is the text of the query.
sql-query either returns a vector matrix (a vector of vectors) that
contains a vector of the field names followed by a vector for each
row (for select queries and its ilk), or it returns the number of rows
affected (for update and insert queries and their ilk).

One of the things that makes guile a nice interface to sql is that
it translates the fields into their appropriate types, so numbers of
all sorts become scheme numbers, blobs and *chars become strings, and
dates become lists of numbers in the form of (<year> <month> <day>
<hour> <minute> <second>).

To get a better feel for what queries look like, just try a few
queries and look at the results.

**

That's it !  Just three little functions and you've got 95% of the
functionality needed to connect to a SQL engine.

Please send me some email if you install this and use it or even just
play around with it and think it's nifty.

-Hal Roberts
hroberts@@alumni.princeton.edu
@


1.2
log
@.
@
text
@d3 4
d11 1
a11 1
also really powerful.  There are only three commands: sql-create,
d14 6
d37 1
a37 1
syntac:  (sql-destroy <db-id>)
d75 2
a76 2
That's it !  Just three little functions and you've got 99% of the
functionality provided by MySQL.
@


1.1
log
@.
@
text
@d5 4
a8 3
Squile a module for guile that allows guile to interact with
mysql databases.  The guile interface is very simple, but (I hope)
also really pwoerful.  There are only three commands --
d11 3
a13 3
syntax:  (mysql-create <db-name> [<host-name>] [<user-name>] [<pass>])
example: (mysql-create "addresses")
example: (mysql-create "addresses" "address-server" "joe" "bonzo")
d15 2
a16 2
mysql-create creates a connection to the mysql engine and selects the
given database.  The last three arguments are optional.  mysql-create
d27 3
a29 3
syntac:  (mysql-destroy <db-id>)
example: (mysql-destroy 0)
example: (mysql-destroy db)
d31 2
a32 2
mysql-destroy destroys a database created with mysql-create.  In
addition to freeing up a small amount of memory, mysql-destroy closes
d37 1
a37 1
look into make the mysql database object collectable, so this destroy
d41 4
a44 4
syntax:  (mysql-query <db-id> <query>)
example: (mysql-query 0 "select number from people where name = 'Sarah'")
example: (mysql-query db "show tables")
example: (mysql-query db 
d47 3
a49 3
mysql-query queries a database create with mysql-create.  db-id is an
database id created by mysql-create.  query is the text of the query.
mysql-query either returns a vector matrix (a vector of vectors) that
d54 1
a54 1
One of the things that makes guile a nice interface to mysql is that
@
