Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Version 2.0.0 (CVS 272) |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
1df5386a5557c1fc6a5433e9dbd23009 |
User & Date: | drh 2001-09-28 17:47:14.000 |
Context
2001-09-28
| ||
18:10 | Line tclsqlite.so against the stub library. (CVS 273) (check-in: 7e79e91b03 user: drh tags: trunk) | |
17:47 | Version 2.0.0 (CVS 272) (check-in: 1df5386a55 user: drh tags: trunk) | |
01:34 | Put in the new LIBTOOL build system. (CVS 271) (check-in: 00575d167a user: drh tags: trunk) | |
Changes
Changes to Makefile.in.
︙ | ︙ | |||
226 227 228 229 230 231 232 | fulltest: testfixture sqlite ./testfixture $(TOP)/test/all.test test: testfixture sqlite ./testfixture $(TOP)/test/quick.test | < < < | < | 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 | fulltest: testfixture sqlite ./testfixture $(TOP)/test/all.test test: testfixture sqlite ./testfixture $(TOP)/test/quick.test index.html: $(TOP)/www/index.tcl last_change tclsh $(TOP)/www/index.tcl `cat $(TOP)/VERSION` >index.html sqlite.html: $(TOP)/www/sqlite.tcl tclsh $(TOP)/www/sqlite.tcl >sqlite.html c_interface.html: $(TOP)/www/c_interface.tcl tclsh $(TOP)/www/c_interface.tcl >c_interface.html |
︙ | ︙ | |||
269 270 271 272 273 274 275 276 277 278 | tclsqlite.html: $(TOP)/www/tclsqlite.tcl tclsh $(TOP)/www/tclsqlite.tcl >tclsqlite.html speed.html: $(TOP)/www/speed.tcl tclsh $(TOP)/www/speed.tcl >speed.html # Files to be published on the website. # | > > > | < > | | | < < | | 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 | tclsqlite.html: $(TOP)/www/tclsqlite.tcl tclsh $(TOP)/www/tclsqlite.tcl >tclsqlite.html speed.html: $(TOP)/www/speed.tcl tclsh $(TOP)/www/speed.tcl >speed.html download.html: $(TOP)/www/download.tcl tclsh $(TOP)/www/download.tcl >download.html # Files to be published on the website. # DOC = \ index.html \ sqlite.html \ changes.html \ lang.html \ opcode.html \ arch.html \ arch.png \ vdbe.html \ c_interface.html \ crosscompile.html \ mingw.html \ tclsqlite.html \ download.html \ speed.html doc: $(DOC) mkdir -p doc mv $(DOC) doc install: sqlite libsqlite.la sqlite.h $(LIBTOOL) $(INSTALL) libsqlite.la $(prefix)/lib $(LIBTOOL) $(INSTALL) sqlite $(prefix)/bin $(INSTALL) sqlite.h $(prefix)/include clean: rm -f *.lo *.la *.o sqlite libsqlite.la sqlite.h rm -rf .libs .deps rm -f lemon lempar.c parse.* sqlite*.tar.gz rm -f $(PUBLISH) rm -f *.da *.bb *.bbg gmon.out rm -f testfixture test.db |
Changes to Makefile.template.
︙ | ︙ | |||
280 281 282 283 284 285 286 | fulltest: testfixture$(EXE) sqlite$(EXE) ./testfixture$(EXE) $(TOP)/test/all.test test: testfixture$(EXE) sqlite$(EXE) ./testfixture$(EXE) $(TOP)/test/quick.test | < < < | < | 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 | fulltest: testfixture$(EXE) sqlite$(EXE) ./testfixture$(EXE) $(TOP)/test/all.test test: testfixture$(EXE) sqlite$(EXE) ./testfixture$(EXE) $(TOP)/test/quick.test index.html: $(TOP)/www/index.tcl last_change tclsh $(TOP)/www/index.tcl `cat $(TOP)/VERSION` >index.html sqlite.html: $(TOP)/www/sqlite.tcl tclsh $(TOP)/www/sqlite.tcl >sqlite.html c_interface.html: $(TOP)/www/c_interface.tcl tclsh $(TOP)/www/c_interface.tcl >c_interface.html |
︙ | ︙ | |||
323 324 325 326 327 328 329 330 331 332 | tclsqlite.html: $(TOP)/www/tclsqlite.tcl tclsh $(TOP)/www/tclsqlite.tcl >tclsqlite.html speed.html: $(TOP)/www/speed.tcl tclsh $(TOP)/www/speed.tcl >speed.html # Files to be published on the website. # | > > > | < > | | | < < | | 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 | tclsqlite.html: $(TOP)/www/tclsqlite.tcl tclsh $(TOP)/www/tclsqlite.tcl >tclsqlite.html speed.html: $(TOP)/www/speed.tcl tclsh $(TOP)/www/speed.tcl >speed.html download.html: $(TOP)/www/download.tcl tclsh $(TOP)/www/download.tcl >download.html # Files to be published on the website. # DOC = \ index.html \ sqlite.html \ changes.html \ lang.html \ opcode.html \ arch.html \ arch.png \ vdbe.html \ c_interface.html \ crosscompile.html \ mingw.html \ tclsqlite.html \ download.html \ speed.html doc: $(DOC) mkdir -p doc mv $(DOC) doc install: sqlite libsqlite.a sqlite.h mv sqlite /usr/bin mv libsqlite.a /usr/lib mv sqlite.h /usr/include clean: rm -f *.o sqlite libsqlite.a sqlite.h rm -f lemon lempar.c parse.* sqlite*.tar.gz rm -f $(PUBLISH) rm -f *.da *.bb *.bbg gmon.out rm -rf tsrc |
Changes to VERSION.
|
| | | 1 | 2.0.0 |
Added publish.sh.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | #!/bin/sh # # This script is used to compile SQLite and all its documentation and # ship everything up to the SQLite website. This script will only work # on the system "zadok" at the Hwaci offices. But others might find # the script useful as an example. # # Set srcdir to the name of the directory that contains the publish.sh # script. # srcdir=`echo "$0" | sed 's%\(^.*\)/[^/][^/]*$%\1%'` # Get the makefile. # cp $srcdir/Makefile.template ./Makefile # Start building stuff. # make clean make sqlite strip sqlite mv sqlite sqlite.bin gzip sqlite.bin # Build the tclsqlite.so shared library for import into tclsh or wish # under Linux # make target_source cd tsrc rm shell.c TCLDIR=/home/drh/tcltk/8.2linux OPTS='-DUSE_TCL_STUBS=1 -DNDEBUG=1 -DOS_UNIX=1 -DOS_WIN=0' gcc -fPIC $OPTS -O2 -I. -I$TCLDIR -shared *.c -o tclsqlite.so strip tclsqlite.so mv tclsqlite.so .. cd .. gzip tclsqlite.so # Build the tclsqlite.dll shared library that can be imported into tclsh # or wish on windows. # make target_source cd tsrc TCLDIR=/home/drh/tcltk/8.2win TCLSTUBLIB=$TCLDIR/tclstub82.a PATH=$PATH:/opt/mingw/bin OPTS='-DUSE_TCL_STUBS=1 -DNDEBUG=1 -DOS_UNIX=0 -DOS_WIN=1' CC="i386-mingw32-gcc -O2 $OPTS -I. -I$TCLDIR" rm shell.c for i in *.c; do CMD="$CC -c $i" echo $CMD $CMD done echo 'EXPORTS' >tclsqlite.def echo 'Tclsqlite_Init' >>tclsqlite.def echo 'Sqlite_Init' >>tclsqlite.def i386-mingw32-dllwrap \ --def tclsqlite.def -v --export-all \ --driver-name i386-mingw32-gcc \ --dlltool-name i386-mingw32-dlltool \ --as i386-mingw32-as \ --target i386-mingw32 \ -dllname tclsqlite.dll -lmsvcrt *.o $TCLSTUBLIB i386-mingw32-strip tclsqlite.dll mv tclsqlite.dll .. cd .. rm -f tclsqlite.zip zip tclsqlite.zip tclsqlite.dll # Build the sqlite.exe executable for windows. # make target_source cd tsrc rm tclsqlite.c OPTS='-DSTATIC_BUILD=1 -DNDEBUG=1 -DOS_UNIX=0 -DOS_WIN=1' i386-mingw32-gcc -O2 $OPTS -I. -I$TCLDIR *.c -o sqlite.exe mv sqlite.exe .. cd .. rm -f sqlite.zip zip sqlite.zip sqlite.exe # Construct a tarball of the source tree # ORIGIN=`pwd` cd $srcdir cd .. tar czf $ORIGIN/sqlite.tar.gz sqlite cd $ORIGIN vers=`cat $srcdir/VERSION` ln sqlite.tar.gz sqlite-$vers.tar.gz # Build the website # cp $srcdir/../historical/* . make doc ln sqlite.bin.gz sqlite.zip sqlite*.tar.gz tclsqlite.so.gz tclsqlite.zip doc |
Changes to src/tclsqlite.c.
1 2 3 4 5 6 7 8 9 10 11 12 13 | /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** A TCL Interface to SQLite ** | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | /* ** 2001 September 15 ** ** The author disclaims copyright to this source code. In place of ** a legal notice, here is a blessing: ** ** May you do good and not evil. ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** A TCL Interface to SQLite ** ** $Id: tclsqlite.c,v 1.24 2001/09/28 17:47:14 drh Exp $ */ #ifndef NO_TCL /* Omit this whole file if TCL is unavailable */ #include "sqlite.h" #include "tcl.h" #include <stdlib.h> #include <string.h> |
︙ | ︙ | |||
429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 | free(zErrMsg); return TCL_ERROR; } Tcl_CreateObjCommand(interp, argv[1], DbObjCmd, (char*)p, DbDeleteCmd); return TCL_OK; } /* ** Initialize this module. ** ** This Tcl module contains only a single new Tcl command named "sqlite". ** (Hence there is no namespace. There is no point in using a namespace ** if the extension only supplies one new name!) The "sqlite" command is ** used to open a new SQLite database. See the DbMain() routine above ** for additional information. */ int Sqlite_Init(Tcl_Interp *interp){ Tcl_CreateCommand(interp, "sqlite", DbMain, 0, 0); Tcl_PkgProvide(interp, "sqlite", "1.0"); return TCL_OK; } int Sqlite_SafeInit(Tcl_Interp *interp){ return TCL_OK; } #if 0 /* ** If compiled using mktclapp, this routine runs to initialize ** everything. */ | > > > > > > > > > > > > > > > > > > > | 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 | free(zErrMsg); return TCL_ERROR; } Tcl_CreateObjCommand(interp, argv[1], DbObjCmd, (char*)p, DbDeleteCmd); return TCL_OK; } /* ** Provide a dummy Tcl_InitStubs if we are using this as a static ** library. */ #ifndef USE_TCL_STUBS # undef Tcl_InitStubs # define Tcl_InitStubs(a,b,c) #endif /* ** Initialize this module. ** ** This Tcl module contains only a single new Tcl command named "sqlite". ** (Hence there is no namespace. There is no point in using a namespace ** if the extension only supplies one new name!) The "sqlite" command is ** used to open a new SQLite database. See the DbMain() routine above ** for additional information. */ int Sqlite_Init(Tcl_Interp *interp){ Tcl_InitStubs(interp, "8.0", 0); Tcl_CreateCommand(interp, "sqlite", DbMain, 0, 0); Tcl_PkgProvide(interp, "sqlite", "1.0"); return TCL_OK; } int Tclsqlite_Init(Tcl_Interp *interp){ Tcl_InitStubs(interp, "8.0", 0); Tcl_CreateCommand(interp, "sqlite", DbMain, 0, 0); Tcl_PkgProvide(interp, "sqlite", "1.0"); return TCL_OK; } int Sqlite_SafeInit(Tcl_Interp *interp){ return TCL_OK; } int Tclsqlite_SafeInit(Tcl_Interp *interp){ return TCL_OK; } #if 0 /* ** If compiled using mktclapp, this routine runs to initialize ** everything. */ |
︙ | ︙ |
Changes to www/changes.tcl.
︙ | ︙ | |||
12 13 14 15 16 17 18 19 20 21 22 23 24 25 | } proc chng {date desc} { puts "<DT><B>$date</B></DT>" puts "<DD><P><UL>$desc</UL></P></DD>" } chng {2001 Sep 27 (2.0-alpha-3)} { <li>SQLite now honors the UNIQUE keyword in CREATE UNIQUE INDEX. Primary keys are required to be unique.</li> <li>File format changed back to what it was for alpha-1</li> <li>Fixes to the rollback and locking behavior</li> } | > > > > > > > > > | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | } proc chng {date desc} { puts "<DT><B>$date</B></DT>" puts "<DD><P><UL>$desc</UL></P></DD>" } chng {2001 Sep 28 (2.0.0)} { <li>Automatically build binaries for Linux and Windows and put them on the website.</li> } chng {2001 Sep 28 (2.0-alpha-4)} { <li>Incorporate makefile patches form A. Rottmann to use LIBTOOL</li> } chng {2001 Sep 27 (2.0-alpha-3)} { <li>SQLite now honors the UNIQUE keyword in CREATE UNIQUE INDEX. Primary keys are required to be unique.</li> <li>File format changed back to what it was for alpha-1</li> <li>Fixes to the rollback and locking behavior</li> } |
︙ | ︙ |
Changes to www/index.tcl.
1 2 3 | # # Run this TCL script to generate HTML for the index.html file. # | | | 1 2 3 4 5 6 7 8 9 10 11 | # # Run this TCL script to generate HTML for the index.html file. # set rcsid {$Id: index.tcl,v 1.42 2001/09/28 17:47:14 drh Exp $} puts {<html> <head><title>SQLite: An SQL Database Engine In A C Library</title></head> <body bgcolor=white> <h1 align=center>SQLite: An SQL Database Engine In A C Library</h1> <p align=center>} puts "This page was last modified on [lrange $rcsid 3 4] GMT<br>" |
︙ | ︙ | |||
23 24 25 26 27 28 29 | access program (<a href="sqlite.html">sqlite</a>) that can be used to administer an SQLite database and which serves as an example of how to use the SQLite library.</p> <p>SQLite is <b>not</b> a client library used to connect to a big database server. SQLite <b>is</b> the server. The SQLite library reads and writes directly to and from the database files | | > > > > > > > > | > | | < < < < < | < < < | | < < < < | < < < < < < < < | < < < < < < < < < < < < < | 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | access program (<a href="sqlite.html">sqlite</a>) that can be used to administer an SQLite database and which serves as an example of how to use the SQLite library.</p> <p>SQLite is <b>not</b> a client library used to connect to a big database server. SQLite <b>is</b> the server. The SQLite library reads and writes directly to and from the database files on disk.</p>} puts {<table align="right"hspace="10"> <tr><td align="center" bgcolor="#8ee5ee"> <table border="2"><tr><td align="center"> <a href="download.html"><big><b>Download<br>SQLite </td></tr></table> </td></tr> </table>} puts {<h2>Features</h2> <p><ul> <li>Implements a large subset of SQL92.</li> <li>A complete SQL database (with multiple tables and indices) is stored in a single disk file.</li> <li>Atomic commit and rollback protect data integrity.</li> <li>Small memory footprint: about 12000 lines of C code.</li> <li><a href="speed.html">Four times faster</a> than PostgreSQL. Twice as fast as SQLite 1.0.</li> <li>Very simple <a href="c_interface.html">C/C++ interface</a> requires the use of only three functions and one opaque structure.</li> <li>A <a href="tclsqlite.html">TCL interface</a> to the library is included.</li> <li>A TCL-based test suite provides near 100% code coverage.</li> <li>Self-contained: no external dependencies.</li> <li>Built and tested under Linux and Win2K.</li> <li>Sources are uncopyrighted. Use for any purpose.</li> </ul> </p> } puts {<h2>Download</h2> <p> Precompiled binaries for Linux and Windows and the complete source tree are available for <a href="download.html">download</a>. </p> } puts {<h2>Current Status</h2> <p>A <a href="changes.html">change history</a> is available online. There are currently no <em>known</em> memory leaks or debilitating bugs in the library. <a href="http://gcc.gnu.org/onlinedocs/gcov_1.html">Gcov</a> is used to verify test coverage.</p> <h2>Documentation</h2> <p>The following documentation is currently available:</p> <p><ul> <li>Information on the <a href="sqlite.html">sqlite</a> |
︙ | ︙ | |||
146 147 148 149 150 151 152 | $ tar xzf sqlite.tar.gz <i> Unpacks into directory named "sqlite" </i> $ mkdir bld <i> Create a separate build directory </i> $ cd bld $ ../sqlite/configure $ make <i> Builds "sqlite" and "libsqlite.a" </i> $ make test <i> Optional: run regression tests </i> </pre></blockquote> | < < < < < < < < | 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | $ tar xzf sqlite.tar.gz <i> Unpacks into directory named "sqlite" </i> $ mkdir bld <i> Create a separate build directory </i> $ cd bld $ ../sqlite/configure $ make <i> Builds "sqlite" and "libsqlite.a" </i> $ make test <i> Optional: run regression tests </i> </pre></blockquote> } puts {<h2>Command-line Usage Example</h2> <p>Download the source archive and compile the <b>sqlite</b> program as described above. Then type:</p> |
︙ | ︙ |
Changes to www/lang.tcl.
1 2 3 | # # Run this Tcl script to generate the sqlite.html file. # | | | 1 2 3 4 5 6 7 8 9 10 11 | # # Run this Tcl script to generate the sqlite.html file. # set rcsid {$Id: lang.tcl,v 1.10 2001/09/28 17:47:14 drh Exp $} puts {<html> <head> <title>Query Language Understood By SQLite</title> </head> <body bgcolor=white> <h1 align=center> |
︙ | ︙ | |||
115 116 117 118 119 120 121 | Syntax {sql-statement} { ROLLBACK [TRANSACTION [<name>]] } puts { <p>Beginning in version 2.0, SQLite supports transactions with rollback and atomic commit. However, only a single level of | | | 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 | Syntax {sql-statement} { ROLLBACK [TRANSACTION [<name>]] } puts { <p>Beginning in version 2.0, SQLite supports transactions with rollback and atomic commit. However, only a single level of transaction is allowed. In other words, transactions may not be nested. </p> <p> No changes can be made to the database except within a transaction. Any command that changes the database (basically, any SQL command other than SELECT) will automatically starts a transaction if |
︙ | ︙ | |||
169 170 171 172 173 174 175 | <p>When the input data source is STDIN, the input can be terminated by a line that contains only a baskslash and a dot:} puts "\"[Operator \\.]\".</p>" Section {CREATE INDEX} createindex Syntax {sql-statement} { | | > > > > | 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | <p>When the input data source is STDIN, the input can be terminated by a line that contains only a baskslash and a dot:} puts "\"[Operator \\.]\".</p>" Section {CREATE INDEX} createindex Syntax {sql-statement} { CREATE [UNIQUE] INDEX <index-name> ON <table-name> ( <column-name> [, <column-name>]* ) } {column-name} { <name> [ ASC | DESC ] } puts { <p>The CREATE INDEX command consists of the keywords "CREATE INDEX" followed by the name of the new index, the keyword "ON", the name of a previously created table that is to be indexed, and a parenthesized list of names of columns in the table that are used for the index key. Each column name can be followed by one of the "ASC" or "DESC" keywords to indicate sort order, but the sort order is ignored in the current implementation.</p> <p>There are no arbitrary limits on the number of indices that can be attached to a single table, nor on the number of columns in an index.</p> <p>If the UNIQUE keyword appears between CREATE and INDEX then duplicate index entries are not allowed. Any attempt to insert a duplicate entry will result in a rollback and an error message.</p> <p>The exact text of each CREATE INDEX statement is stored in the <b>sqlite_master</b> table. Everytime the database is opened, all CREATE INDEX statements are read from the <b>sqlite_master</b> table and used to regenerate SQLite's internal representation of the index layout.</p> } |
︙ | ︙ | |||
230 231 232 233 234 235 236 | definitions and constraints. The table name can be either an identifier or a string. The only reserved table name is "<b>sqlite_master</b>" which is the name of the table that records the database schema.</p> <p>Each column definition is the name of the column followed by the datatype for that column, then one or more optional column constraints. The datatype for the column is ignored. All information | | > | > | | | 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 | definitions and constraints. The table name can be either an identifier or a string. The only reserved table name is "<b>sqlite_master</b>" which is the name of the table that records the database schema.</p> <p>Each column definition is the name of the column followed by the datatype for that column, then one or more optional column constraints. The datatype for the column is ignored. All information is stored as null-terminated strings. The UNIQUE constraint causes an index to be created on the specified columns. This index must contain unique keys. The PRIMARY KEY constraint is an alias for UNIQUE. The DEFAULT constraint specifies a default value to use when doing an INSERT. </p> <p>There are no arbitrary limits on the number of columns or on the number of constraints in a table. The total amount of data in a single row is limited to 65535 bytes.</p> <p>The exact text |
︙ | ︙ |