SOFTINNOV
Home
PostgreSQL Driver for REBOL/Core
Download Now!
Size :  15Kb
Level :  Alpha
Version :  0.9.0
Date :  09-Feb-2003

Description

It's a scheme for /Core that will allow you to connect to a PostgreSQL database server, send queries and retrieve resulting recordsets. This driver is 100% written in REBOL and doesn't require any additional library. It works with all REBOL products (/View, /Pro, /Command, /Link,...) and on all platforms supported by REBOL ! You only need one file to make it work and it's size is less 20Kb !

It works by adding a new scheme (pgsql://) that enables any REBOL product to talk to a PostgreSQL server. Here are some code examples :

    db: open pgsql://root@localhost/books                 ; open the connection
    insert db "SELECT * FROM Authors WHERE Country='US'"  ; send a SQL query
    print copy db                                         ; retrieve the resulting recordset
    close db                                              ; close the connection

Here's an even greater example using the REBOL 'read function :

    print read join pgsql://root@localhost/books? "SELECT * FROM Authors WHERE Country='US'"

This driver have been designed and especially optimized for REBOL from the ground ! It takes very little ressources and can work with millions of records using the 'copy/part and 'first functions. This driver is also very fast ! Just try it, you won't believe that it's an interpreted driver !

Download & Install

Download the latest version and save it in a directory. To install the driver, open a REBOL console and do the following steps :

    >> change-dir %path/to/the/archive/
    >> do %pgsql-xxx.rip
The driver files are now installed in a directory called pgsql-rxxx/ and you are free to move it and rename it. The archive is composed of 2 files :
%pgsql-protocol.r The driver
%usage.html Programmer's guide for this PostgreSQL driver

To use the driver, just 'do it ! :) :

    >> cd %pgsql-rxxx/
    >> do %pgsql-protocol.r
    pgSQL protocol loaded

The scheme is now loaded and ready to use !

Please read the documentation to learn the API and what can be achieved with this driver.

History