Documentation Source Text

Check-in [bc46aa4246]
Login

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

Overview
Comment:Further enhancements to the in-memory shared-cache documentation.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: bc46aa4246e75cb50ee9395b7f37d6a751548577
User & Date: drh 2012-05-28 17:30:48.464
Context
2012-05-28
17:52
Improvements to shared cache hyperlinking and fixes to the URI parameter documentation. (check-in: 918202f13d user: drh tags: trunk)
17:30
Further enhancements to the in-memory shared-cache documentation. (check-in: bc46aa4246 user: drh tags: trunk)
17:05
Documentation on the unicode61 tokenizer and the ability to use shared-cache with in-memory databases. (check-in: 2ed85cc08c user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to pages/changes.in.
41
42
43
44
45
46
47
48

49
50
51
52
53
54
55
    hd_enable_main 1
  }
}

chng {date unknown (3.7.13)} {
<li>Add support for the [unicode61] tokenizer in [FTS3].
<li>[in-memory database | In-memory databases] that are specified using
    [URI filenames] are allowed to use [shared cache], so that the same

    in-memory database can be accessed from multiple database connections.
<li>Recognize and use the [coreqp | mode=memory] query parameter in
    [URI filenames].
}

chng {2012 May 22 (3.7.12.1)} {
<li>Fix a bug 







|
>







41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
    hd_enable_main 1
  }
}

chng {date unknown (3.7.13)} {
<li>Add support for the [unicode61] tokenizer in [FTS3].
<li>[in-memory database | In-memory databases] that are specified using
    [URI filenames] are allowed to use [in-memory shared-cache | shared cache],
    so that the same
    in-memory database can be accessed from multiple database connections.
<li>Recognize and use the [coreqp | mode=memory] query parameter in
    [URI filenames].
}

chng {2012 May 22 (3.7.12.1)} {
<li>Fix a bug 
Changes to pages/index.in.
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100

</td>
<td width="20"></td><td bgcolor="#044a64" width="1"></td><td width="20"></td>
<td valign="top">
<h3>Current Status</h3>

<p><ul>
<li><a href="releaselog/3_7_12_1.html">Version 3.7.12.1</a>
of SQLite is recommended for all new development.
Upgrading from version 3.7.6.3, 3.7.7, 3.7.7.1, 3.7.8, 3.7.9, 3.7.11,
or 3.7.12 is optional.
Upgrading from all other SQLite versions is recommended.</li>
</ul></p>

<h3>Common Links</h3>

<p><ul>
<li> <a href="features.html">Features</a> </li>







|


|







83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100

</td>
<td width="20"></td><td bgcolor="#044a64" width="1"></td><td width="20"></td>
<td valign="top">
<h3>Current Status</h3>

<p><ul>
<li><a href="releaselog/3_7_13.html">Version 3.7.13</a>
of SQLite is recommended for all new development.
Upgrading from version 3.7.6.3, 3.7.7, 3.7.7.1, 3.7.8, 3.7.9, 3.7.11,
3.7.12, or 3.7.12.1 is optional.
Upgrading from all other SQLite versions is recommended.</li>
</ul></p>

<h3>Common Links</h3>

<p><ul>
<li> <a href="features.html">Features</a> </li>
Changes to pages/sharedcache.in.
215
216
217
218
219
220
221


































choose to participate or not participate in shared cache mode by using
the [SQLITE_OPEN_SHAREDCACHE] or [SQLITE_OPEN_PRIVATECACHE] flags the
third parameter.  The use of either of these flags overrides the
global shared cache mode setting established by [sqlite3_enable_shared_cache()].
No more than one of the flags should be used; if both SQLITE_OPEN_SHAREDCACHE
and SQLITE_OPEN_PRIVATECACHE flags are used in the third argument to
[sqlite3_open_v2()] then the behavior is undefined.</p>









































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
choose to participate or not participate in shared cache mode by using
the [SQLITE_OPEN_SHAREDCACHE] or [SQLITE_OPEN_PRIVATECACHE] flags the
third parameter.  The use of either of these flags overrides the
global shared cache mode setting established by [sqlite3_enable_shared_cache()].
No more than one of the flags should be used; if both SQLITE_OPEN_SHAREDCACHE
and SQLITE_OPEN_PRIVATECACHE flags are used in the third argument to
[sqlite3_open_v2()] then the behavior is undefined.</p>

<p>When [URI filenames] are used, the "cache" query parameter can be used
to specify whether or not the database will use shared cache.  Use
"cache=shared" to enable shared cache and "cache=private" to disable
shared cache.   The ability to use URI query parameters to specify the
cache sharing behavior of a database connection allows cache sharing to
be controlled in [ATTACH] statements.  For example:</p>

<blockquote><pre>
ATTACH 'file:aux.db?cache=shared' AS aux;
</pre></blockquote>

<tcl>
hd_fragment inmemsharedcache {in-memory shared-cache}
HEADING 1 {Shared Cache And In-Memory Databases}</tcl>

<p>
Beginning with SQLite [version 3.7.13], shared cache can be used on
[in-memory databases], provided that the database is created using
a [URI filename].  For backwards compatibility, shared cache is always
disable for in-memory
databases if the unadorned name ":memory:" is used to open the database.
Prior to version 3.7.13, shared cache was always
disabled for in-memory databases regardless of the database name used,
current system shared cache setting, or query parameters or flags.
</p>

<p>
Enabling shared-cache for an in-mmeory database allows two or more
database connections in the same process to have access to the same
in-memory database.  An in-memory database in shared cache is automatically
deleted and memory is reclaimed when the last connection to that database
closes.
</p>
Changes to pages/uri.in.
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
^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<br>mode=memory</b></dt>
<dd><p>^The mode query parameter determines if the new database is opened
read-only, read-write, read-write and created if it does not exist, or
if the databaes is a pure in-memory database that never interacts with
disk, respectively.  The <b>mode=memory</b> option was added in 
[version 3.7.13].
</dd>

<dt><b>cache=shared<br>cache=private</b></dt>
<dd><p>^The cache query parameter determines if the new database is opened
using [shared cache mode] or with a private cache.







|







179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
^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<br>mode=memory</b></dt>
<dd><p>^The mode query parameter determines if the new database is opened
read-only, read-write, read-write and created if it does not exist, or
that the database is a pure in-memory database that never interacts with
disk, respectively.  The <b>mode=memory</b> option was added in 
[version 3.7.13].
</dd>

<dt><b>cache=shared<br>cache=private</b></dt>
<dd><p>^The cache query parameter determines if the new database is opened
using [shared cache mode] or with a private cache.