Forum OpenACS Q&A: nstcl package: some common ns_* functions for tclsh

I've created a package I've whimsically decided to call "nstcl" that implements some of the more common ns_* API functions in 100% Tcl so that they can be used in tclsh, expect, etc.

It's currently at version 0.2, and can be downloaded at: http://michael.cleverly.com/aolserver/nstcl. Currently it supports ns_db for Postgres and Solid (provided pgtclsh/libpgtcl.so or soltcl/soltcl.so is used/available). I'm interested in feedback, suggestions, etc.

Anyway, I don't know if this will be useful to anyone else or not, but since I write far and away more Tcl code for AOLserver than I do for standard tclsh/expect scripts, I enjoy being able to be lazy and not have to use database specific routines. 😊

nstcl is a really cool package that Michael is bringing to us. With nstcl you can use different DBs with the same Tcl code (as long as your SQL is standard, of course).

This is something that I've always wanted in Tcl and was very surprised that it wasn't available. The coolest thing is that I can use the good old ns_* calls that everyone is used to in their plain Tcl programs.

I've looked at Michael's code and it is pretty easy to add "drivers" to other DBs.

nstcl will fit like a glove in a free point-of-sale application that I intend to write using OpenACS' ecommerce datamodel and Tcl/Tk. Thanks Michael.

Version 0.3 is now available which adds Oracle 8 support by wrapping Oratcl 3.0. ns_urlencode and ns_urldecode have also been added, and database pool configuration has been simplified.