@@ -34,7 +34,9 @@ archives as follows:
34
34
If you do want to use Fossil to check out the source tree,
35
35
first install Fossil version 2.0 or later.
36
36
(Source tarballs and precompiled binaries available
37
- [ here] ( https://www.fossil-scm.org/fossil/uv/download.html ) .)
37
+ [ here] ( https://www.fossil-scm.org/fossil/uv/download.html ) . Fossil is
38
+ a stand-alone program. To install, simply download or build the single
39
+ executable file and put that file someplace on your $PATH.)
38
40
Then run commands like this:
39
41
40
42
mkdir ~/sqlite
@@ -106,19 +108,22 @@ The makefiles also require AWK.
106
108
107
109
## Source Code Tour
108
110
109
- Most of the core source files are in the ** src/** subdirectory. But
110
- src/ also contains files used to build the "testfixture" test harness;
111
- those file all begin with "test". And src/ contains the "shell.c" file
112
- which is the main program for the "sqlite3.exe" command-line shell and
113
- the "tclsqlite.c" file which implements the bindings to SQLite from the
114
- Tcl programming language. (Historical note: SQLite began as a Tcl
111
+ Most of the core source files are in the ** src/** subdirectory. The
112
+ ** src/** folder also contains files used to build the "testfixture" test
113
+ harness. The names of the source files used by "testfixture" all begin
114
+ with "test".
115
+ The ** src/** also contains the "shell.c" file
116
+ which is the main program for the "sqlite3.exe"
117
+ [ command-line shell] ( https://sqlite.org/cli.html ) and
118
+ the "tclsqlite.c" file which implements the
119
+ [ TCL bindings] ( https://sqlite.org/tclsqlite.html ) for SQLite.
120
+ (Historical note: SQLite began as a Tcl
115
121
extension and only later escaped to the wild as an independent library.)
116
122
117
123
Test scripts and programs are found in the ** test/** subdirectory.
118
- There are other test suites for SQLite (see
119
- [ How SQLite Is Tested] ( http://www.sqlite.org/testing.html ) )
120
- but those other test suites are
121
- in separate source repositories.
124
+ Addtional test code is found in other source repositories.
125
+ See [ How SQLite Is Tested] ( http://www.sqlite.org/testing.html ) for
126
+ additional information.
122
127
123
128
The ** ext/** subdirectory contains code for extensions. The
124
129
Full-text search engine is in ** ext/fts3** . The R-Tree engine is in
@@ -142,7 +147,7 @@ manually-edited files and automatically-generated files.
142
147
The SQLite interface is defined by the ** sqlite3.h** header file, which is
143
148
generated from src/sqlite.h.in, ./manifest.uuid, and ./VERSION. The
144
149
[ Tcl script] ( http://www.tcl.tk ) at tool/mksqlite3h.tcl does the conversion.
145
- The manifest.uuid file contains the SHA1 hash of the particular check-in
150
+ The manifest.uuid file contains the SHA3 hash of the particular check-in
146
151
and is used to generate the SQLITE\_ SOURCE\_ ID macro. The VERSION file
147
152
contains the current SQLite version number. The sqlite3.h header is really
148
153
just a copy of src/sqlite.h.in with the source-id and version number inserted
@@ -153,9 +158,8 @@ used to generate that documentation are in a separate source repository.
153
158
The SQL language parser is ** parse.c** which is generate from a grammar in
154
159
the src/parse.y file. The conversion of "parse.y" into "parse.c" is done
155
160
by the [ lemon] ( ./doc/lemon.html ) LALR(1) parser generator. The source code
156
- for lemon is at tool/lemon.c. Lemon uses a
157
- template for generating its parser. A generic template is in tool/lempar.c,
158
- but SQLite uses a slightly modified template found in src/lempar.c.
161
+ for lemon is at tool/lemon.c. Lemon uses the tool/lempar.c file as a
162
+ template for generating its parser.
159
163
160
164
Lemon also generates the ** parse.h** header file, at the same time it
161
165
generates parse.c. But the parse.h header file is
@@ -175,6 +179,13 @@ that maps SQL language keywords (ex: "CREATE", "SELECT", "INDEX", etc.) into
175
179
the numeric codes used by the parse.c parser. The keywordhash.h file is
176
180
generated by a C-language program at tool mkkeywordhash.c.
177
181
182
+ The ** pragma.h** header file contains various definitions used to parse
183
+ and implement the PRAGMA statements. The header is generated by a
184
+ script ** tool/mkpragmatab.tcl** . If you want to add a new PRAGMA, edit
185
+ the ** tool/mkpragmatab.tcl** file to insert the information needed by the
186
+ parser for your new PRAGMA, then run the script to regenerate the
187
+ ** pragma.h** header file.
188
+
178
189
### The Amalgamation
179
190
180
191
All of the individual C source code and header files (both manually-edited
@@ -192,7 +203,7 @@ subdirectory (using the equivalent of "make target_source") then the
192
203
tool/mksqlite3c.tcl script is run to copy them all together in just the
193
204
right order while resolving internal "#include" references.
194
205
195
- The amalgamation source file is more than 100K lines long. Some symbolic
206
+ The amalgamation source file is more than 200K lines long. Some symbolic
196
207
debuggers (most notably MSVC) are unable to deal with files longer than 64K
197
208
lines. To work around this, a separate Tcl script, tool/split-sqlite3c.tcl,
198
209
can be run on the amalgamation to break it up into a single small C file
@@ -209,14 +220,15 @@ See the [architectural description](http://www.sqlite.org/arch.html)
209
220
for details. Other documents that are useful in
210
221
(helping to understand how SQLite works include the
211
222
[ file format] ( http://www.sqlite.org/fileformat2.html ) description,
212
- the [ virtual machine] ( http://www.sqlite.org/vdbe .html ) that runs
223
+ the [ virtual machine] ( http://www.sqlite.org/opcode .html ) that runs
213
224
prepared statements, the description of
214
225
[ how transactions work] ( http://www.sqlite.org/atomiccommit.html ) , and
215
226
the [ overview of the query planner] ( http://www.sqlite.org/optoverview.html ) .
216
227
217
- Unfortunately, years of effort have gone into optimizating SQLite, both
228
+ Years of effort have gone into optimizating SQLite, both
218
229
for small size and high performance. And optimizations tend to result in
219
- complex code. So there is a lot of complexity in the SQLite implementation.
230
+ complex code. So there is a lot of complexity in the current SQLite
231
+ implementation. It will not be the easiest library in the world to hack.
220
232
221
233
Key files:
222
234
@@ -227,7 +239,7 @@ Key files:
227
239
* ** sqliteInt.h** - this header file defines many of the data objects
228
240
used internally by SQLite.
229
241
230
- * ** parse.y** - This file describes the LALR(1) grammer that SQLite uses
242
+ * ** parse.y** - This file describes the LALR(1) grammar that SQLite uses
231
243
to parse SQL statements, and the actions that are taken at each step
232
244
in the parsing process.
233
245
@@ -260,13 +272,13 @@ Key files:
260
272
is not part of the core SQLite library. But as most of the tests in this
261
273
repository are written in Tcl, the Tcl language bindings are important.
262
274
263
- There are many other source files. Each has a suscinct header comment that
275
+ There are many other source files. Each has a succinct header comment that
264
276
describes its purpose and role within the larger system.
265
277
266
278
267
279
## Contacts
268
280
269
281
The main SQLite webpage is [ http://www.sqlite.org/ ] ( http://www.sqlite.org/ )
270
- with geographically distributed backup servers at
282
+ with geographically distributed backups at
271
283
[ http://www2.sqlite.org/ ] ( http://www2.sqlite.org ) and
272
284
[ http://www3.sqlite.org/ ] ( http://www3.sqlite.org ) .
0 commit comments