BrowseX
SourceForge Logo
BrowseX
 Home
 News
 Download
 Features
 Demos
 
 API
 SQLite
 TML
 Dballoc
 Javascript
 Mailer
 Address
 Mimetypes
 Portal
 DynDNS
 Talk
 ZipView
 TDB
 Packaging
 Passman
 Thin
 
 Press
 Docs
 Bugs
 FAQ
 Pros
 Why
 License
 Contacts

Search
Links
 Scriptics
 Tkhtml
 Postgres
 OpenSSL
 Img
 Baremetal

Contact
peter@browsex.com

SQLite

Sqlite is a simple database like interface that uses the GDBM library to manage storage on the local disk. Sqlite comes builtin to BrowseX , and you can get complete details from the SQLite Home.

Sqlite can be used as a standalone program from the command line, but it is the Tcl interface that is most of interest in the context of BrowseX . Here is an example excerpted from the Tclsqlite web page.

  sqlite db1 ./testdb
  db1 eval {CREATE TABLE t1(a int, b text)} 
  db1 eval {INSERT INTO t1 VALUES(1,'hello')}
  db1 eval {INSERT INTO t1 VALUES(2,'goodbye')}
  db1 eval {INSERT INTO t1 VALUES(3,'howdy!')}
  set x [db1 eval {SELECT * FROM t1 ORDER BY a}] 
  db1 close


SQLite commands can be used anywhere in BrowseX , including in your browsex.ini file. With it, you can easily create database applications that integrate with a web client. No need to for the complexity or overhead of managing a database engine. Moreover, later porting the application to a real DB should be relatively simple. Just replace the first line above with:
  proc db1 {cmd arg args} {
    switch $cmd {
      eval {
	return [SubmitToRealDB $arg]
      }
      close {
	CloseRealDB ...
      }
    }
  }