Documentation Source Text

Check-in [f6062d7175]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix typos found and reported by aku.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f6062d717598b5085ba1dc65551f7e256191ad57
User & Date: drh 2011-06-15 17:17:49.285
Context
2011-06-20
19:49
Fix the ON CONFLICT documentation to avoid the erroneous implication that you can put an ON CONFLICT clause on a CHECK constraint. (check-in: 11f4999021 user: drh tags: trunk)
2011-06-15
17:17
Fix typos found and reported by aku. (check-in: f6062d7175 user: drh tags: trunk)
12:23
Update the limits.html document for the new upper bound on SQLITE_MAX_ATTACHED and to describe the maximum database size and the maximum number of rows in a table. (check-in: b91558ccbf user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to pages/shortnames.in.
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
[database corruption caused by inconsistent use of 8+3 filenames].
</p>

<h2>Adjusting SQLite To Use 8+3 Filenames</h2>

<p>
Some devices are compelled to use an older filesystem with 8+3
filename restructions in order to be compatible with legacy, or due
to other non-technical factors.  In such situations, SQLite can be
coerced into using auxiliary files that fit the 8+3 pattern as follows:
</p>

<ol>
<li><p>Compile the SQLite library with the [SQLITE_ENABLE_8_3_NAMES]
       compile-time option.
       Support for 8+3 filenames is not included in SQLite by default
       because it does introduce some overhead.  The overhead is tiny,
       but even so, we do not want to burden the billions of SQLite
       applications that do not need 8+3 filename support.</p>

<li><p>Use [URI filenames] when [sqlite3_open | opening] or
       [ATTACH | ATTACH-ing] database files and include the
       "<tt>8_3_names=1</tt>" query parameter in the URI.</p>

<li><p>Make sure that database filenames follow the 8+3 filename
       format and that they do not have an empty name or extension.
       In other words, the database filename must not contain between
       1 and 8 characters in the base name and between 1 and 3 characters
       in the extension.  Blank extensions are not allows.</p>
</ol>

<p>
When the steps above are used, SQLite will shorten filename extensions
by only using the last 3 characters of
the extension.  Thus, for example, a file that would normally be called
"<tt>app.db-journal</tt>" is shortened to just "<tt>app.nal</tt>".







|


















|

|







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
[database corruption caused by inconsistent use of 8+3 filenames].
</p>

<h2>Adjusting SQLite To Use 8+3 Filenames</h2>

<p>
Some devices are compelled to use an older filesystem with 8+3
filename restrictions for backwards compatibility, or due
to other non-technical factors.  In such situations, SQLite can be
coerced into using auxiliary files that fit the 8+3 pattern as follows:
</p>

<ol>
<li><p>Compile the SQLite library with the [SQLITE_ENABLE_8_3_NAMES]
       compile-time option.
       Support for 8+3 filenames is not included in SQLite by default
       because it does introduce some overhead.  The overhead is tiny,
       but even so, we do not want to burden the billions of SQLite
       applications that do not need 8+3 filename support.</p>

<li><p>Use [URI filenames] when [sqlite3_open | opening] or
       [ATTACH | ATTACH-ing] database files and include the
       "<tt>8_3_names=1</tt>" query parameter in the URI.</p>

<li><p>Make sure that database filenames follow the 8+3 filename
       format and that they do not have an empty name or extension.
       In other words, the database filename must contain between
       1 and 8 characters in the base name and between 1 and 3 characters
       in the extension.  Blank extensions are not allowed.</p>
</ol>

<p>
When the steps above are used, SQLite will shorten filename extensions
by only using the last 3 characters of
the extension.  Thus, for example, a file that would normally be called
"<tt>app.db-journal</tt>" is shortened to just "<tt>app.nal</tt>".
Changes to pages/uri.in.
8
9
10
11
12
13
14
15

16
17
18
19
20
21
22
<p>
Beginning with [version 3.7.7], the SQLite database file argument to the
[sqlite3_open()], [sqlite3_open16()], and [sqlite3_open_v2()] interfaces
and to the [ATTACH] command can be specified
either as an ordinary filename or as a Uniform Resource Identifier or URI.
The advantage of using a URI filename is that query parameters on the URI can
be used to control details of the newly created database connection.
For example, an alternative [VFS] can be specified using "vfs=" query parameter.

Or the database can be opened read-only by using "mode=ro" as a query
parameter.
</p>

<h1>2.0 Backwards Compatibility</h1>

<p>







|
>







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<p>
Beginning with [version 3.7.7], the SQLite database file argument to the
[sqlite3_open()], [sqlite3_open16()], and [sqlite3_open_v2()] interfaces
and to the [ATTACH] command can be specified
either as an ordinary filename or as a Uniform Resource Identifier or URI.
The advantage of using a URI filename is that query parameters on the URI can
be used to control details of the newly created database connection.
For example, an alternative [VFS] can be specified using a 
"vfs=" query parameter.
Or the database can be opened read-only by using "mode=ro" as a query
parameter.
</p>

<h1>2.0 Backwards Compatibility</h1>

<p>
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
^If URI filenames are recognized when the database connection is originally
opened, then URI filenames will also be recognized on [ATTACH] statemenets.
^Similarly, if URI filenames are not recognized when the database connection
is first opened, they will not be recognized by [ATTACH].
</p>

<p>
Since SQLite always interprets any filename that does not begin 
with "<tt>file:</tt>" is interpreted
as an ordinary filename regardless of the URI setting, and because it is
very unusual to have an actual file that beings with "<tt>file:</tt>", for
most applications it is safe to enable URI processing even if URI filenames
are not currently being used.
</p>

<h1>3.0 URI Format</h1>

<p>







|
|

|







40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
^If URI filenames are recognized when the database connection is originally
opened, then URI filenames will also be recognized on [ATTACH] statemenets.
^Similarly, if URI filenames are not recognized when the database connection
is first opened, they will not be recognized by [ATTACH].
</p>

<p>
Since SQLite always interprets any filename that does not begins 
with "<tt>file:</tt>"
as an ordinary filename regardless of the URI setting, and because it is
very unusual to have an actual file to begin with "<tt>file:</tt>", for
most applications it is safe to enable URI processing even if URI filenames
are not currently being used.
</p>

<h1>3.0 URI Format</h1>

<p>
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
^The filename argument sqlite3_open16() is converted from UTF16 
native byte order into UTF8 prior to processing.

<h2>3.1 The URI Path</h2>

<p>^The path component of the URI specifies the disk file that is the
SQLite database to be opened.  ^(If the path component is omitted, then
a temporary files is opened as a new database that will be automatically
deleted when the database connection closes.)^  ^If the authority section
is present, then the path is alway an absolute pathname.  ^If the 
authority section is omitted, then the path is an absolute pathname if it
begins with the "/" character (ASCII code 0x2f) and is a relative
pathname otherwise.  ^(On windows, if the absolute path begins with
"<b>/<i>X</i>:/</b>" where <b><i>X</i></b> is any single ASCII alphabetic
character ("a" through "z" or "A" through "Z") then the "<b><i>X:</i></b>"
is understood to be the drive letter of the the volume containing the file,
not the toplevel directory.)^

<p>An ordinary filename can usually be converted into an equivalent URI 
by the step shown below.  The one exception is that a relative windows
pathname with a drive letter cannot be converted directly into a URI; it must
be changed into an absolute pathname first.</p>

<ol>
<li>Convert all "<tt>?</tt>" characters into "<tt>%3f</tt>".
<li>Convert all "<tt>#</tt>" characters into "<tt>%23</tt>".
<li>On windows only, convert all "<tt>\</tt>" characters into "<tt>/</tt>".







|

|









|







100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
^The filename argument sqlite3_open16() is converted from UTF16 
native byte order into UTF8 prior to processing.

<h2>3.1 The URI Path</h2>

<p>^The path component of the URI specifies the disk file that is the
SQLite database to be opened.  ^(If the path component is omitted, then
the database is stored in a temporary file that will be automatically
deleted when the database connection closes.)^  ^If the authority section
is present, then the path is always an absolute pathname.  ^If the 
authority section is omitted, then the path is an absolute pathname if it
begins with the "/" character (ASCII code 0x2f) and is a relative
pathname otherwise.  ^(On windows, if the absolute path begins with
"<b>/<i>X</i>:/</b>" where <b><i>X</i></b> is any single ASCII alphabetic
character ("a" through "z" or "A" through "Z") then the "<b><i>X:</i></b>"
is understood to be the drive letter of the the volume containing the file,
not the toplevel directory.)^

<p>An ordinary filename can usually be converted into an equivalent URI 
by the steps shown below.  The one exception is that a relative windows
pathname with a drive letter cannot be converted directly into a URI; it must
be changed into an absolute pathname first.</p>

<ol>
<li>Convert all "<tt>?</tt>" characters into "<tt>%3f</tt>".
<li>Convert all "<tt>#</tt>" characters into "<tt>%23</tt>".
<li>On windows only, convert all "<tt>\</tt>" characters into "<tt>/</tt>".
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
We usually refer to these key/value pairs as "query parameters".
^Key/value pairs are separated by a single "<tt>&amp;</tt>" character.
^The key comes first and is separated from the value by a single
"<tt>=</tt>" character.
^Both key and value may contain <b>%HH</b> escape sequences.</p>

<p>
^The text of query parameters is appended to the filename argument to
the xOpen method of the [VFS].
^Any %HH escape sequences in the query parameters are resolved prior to
being appended ot the xOpen filename.
^A single zero-byte separates the xOpen filename argument from the key of
the first query parameters, each key and value, and each subsequent key
from the prior value.
^The list query parameters parameters appended to the xOpen filename
is terminated by a single zero-length key.
Note that the value of a query parameter can be an empty string.
</p>

<tcl>hd_fragment coreqp {query parameters with special meaning to SQLite}</tcl>
<h2>3.3 Recognized Query Parameters</h2>








|


|



|







140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
We usually refer to these key/value pairs as "query parameters".
^Key/value pairs are separated by a single "<tt>&amp;</tt>" character.
^The key comes first and is separated from the value by a single
"<tt>=</tt>" character.
^Both key and value may contain <b>%HH</b> escape sequences.</p>

<p>
^The text of query parameters is appended to the filename argument of
the xOpen method of the [VFS].
^Any %HH escape sequences in the query parameters are resolved prior to
being appended to the xOpen filename.
^A single zero-byte separates the xOpen filename argument from the key of
the first query parameters, each key and value, and each subsequent key
from the prior value.
^The list of query parameters parameters appended to the xOpen filename
is terminated by a single zero-length key.
Note that the value of a query parameter can be an empty string.
</p>

<tcl>hd_fragment coreqp {query parameters with special meaning to SQLite}</tcl>
<h2>3.3 Recognized Query Parameters</h2>

168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<p>
The following query parameters are recognized by SQLite as of version 3.7.7.
Other query parameters might be added to this set in future releases.
</p>

<dl>
<dt><b>vfs=</b><i>NAME</i></dt>
<dd><p>^This query parameter cases the database connection to be opened
using the [VFS] called <i>NAME</i>.
^The open attempt fails if <i>NAME</i> is not the name of a [VFS] that
is built into SQLite or that has been previously registered using
[sqlite3_vfs_register()].</dd>

<dt><b>mode=ro<br>mode=rw<br>mode=rwc</b></dt>
<dd><p>^These query parameters determine if the new database is opened







|







169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
<p>
The following query parameters are recognized by SQLite as of version 3.7.7.
Other query parameters might be added to this set in future releases.
</p>

<dl>
<dt><b>vfs=</b><i>NAME</i></dt>
<dd><p>^This query parameter causes the database connection to be opened
using the [VFS] called <i>NAME</i>.
^The open attempt fails if <i>NAME</i> is not the name of a [VFS] that
is built into SQLite or that has been previously registered using
[sqlite3_vfs_register()].</dd>

<dt><b>mode=ro<br>mode=rw<br>mode=rwc</b></dt>
<dd><p>^These query parameters determine if the new database is opened