Documentation Source Text

Check-in [f80207b028]
Login

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

Overview
Comment:Add documentation on the dbhash.exe utility and an entry in the change-log.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f80207b028e899fa211559661e740fc8056bf5de
User & Date: drh 2016-07-13 13:57:06.766
Context
2016-07-13
14:17
Convert the RTree documentation to fancy-format. (check-in: cb9d13f931 user: drh tags: trunk)
13:57
Add documentation on the dbhash.exe utility and an entry in the change-log. (check-in: f80207b028 user: drh tags: trunk)
11:59
Add a link to vfsstat.c in the change log. (check-in: 234e53bfcb user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to pages/changes.in.
47
48
49
50
51
52
53

54
55
56
57
58
59
60
<li>Enhance [PRAGMA table_info] so that it provides information about
    [eponymous virtual tables].
<li>Added the "win32-none" VFS, analogous to the "unix-none" VFS, that works like
    the default "win32" VFS except that it ignores all file locks.
<li>The query planner uses a full scan of a [partial index] instead of a 
    full scan of the main table, in cases where that makes sense.
<li>Allow [table-valued functions] to appear on the right-hand side of an [IN operator].

}

chng {2016-05-18 (3.13.0)} {
<li>Postpone I/O associated with TEMP files for as long as possible, with the hope
    that the I/O can ultimately be avoided completely.
<li>Merged the [session] extension into trunk.
<li>Added the ".auth ON|OFF" command to the [command-line shell].







>







47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<li>Enhance [PRAGMA table_info] so that it provides information about
    [eponymous virtual tables].
<li>Added the "win32-none" VFS, analogous to the "unix-none" VFS, that works like
    the default "win32" VFS except that it ignores all file locks.
<li>The query planner uses a full scan of a [partial index] instead of a 
    full scan of the main table, in cases where that makes sense.
<li>Allow [table-valued functions] to appear on the right-hand side of an [IN operator].
<li>Created the [dbhash.exe] command-line utility.
}

chng {2016-05-18 (3.13.0)} {
<li>Postpone I/O associated with TEMP files for as long as possible, with the hope
    that the I/O can ultimately be avoided completely.
<li>Merged the [session] extension into trunk.
<li>Added the ".auth ON|OFF" command to the [command-line shell].
Added pages/dbhash.in.














































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
<title>The dbhash.exe Utility Program</title>
<tcl>hd_keywords dbhash dbhash.exe</tcl>
<fancy_format>

<h1>Overview</h1>

<p>The <b>dbhash</b> (or <b>dbhash.exe</b> on Windows) utility is a
command-line program that computes the SHA1 hash of the schema and content 
for an SQLite database.

<p>Dbhash ignores extraneous formatting details and hashes only the database
schema and content.  Hence the hash is constant even if the database file
is modified by:

<ul>
<li> [VACUUM]
<li> [PRAGMA page_size]
<li> [PRAGMA journal_mode]
<li> [REINDEX]
<li> [ANALYZE]
<li> copied via the [backup API]
<li> ... and so forth
</ul>

<p>The operations above can potentially cause vast changes the raw database file,
and hence cause very different SHA1 hashes at the file level.
But since the content represented in the database file is unchanged by these
operations, the hash computed by dbhash is also unchanged.

<p>Dbhash can be used to compare two databases to confirm that they
are equivalent, even though their representation on disk is quite different.
Dbhash might also be used to verify the content of a remote database without having
to transmit the entire content of the remote database over a slow link.

<h1>Usage</h1>

<p>Dbhash is a command-line utility.
To run it, type "dbhash" on a command-line prompt followed by the names of
one or more SQLite database files that are to be hashed.
The database hashes will be displayed on standard output.
For example:

<codeblock>
drh@bella:~/sqlite/bld$ dbhash ~/Fossils/sqlite.fossil
8d3da9ff87196312aaa33076627ccb7943ef79e3 /home/drh/Fossils/sqlite.fossil
</codeblock>

<p>Dbhash supports command-line options that can restrict the tables of the
database file that are hashed, or restrict the hash to only content or only
the schema.  Run "dbhash --help" for further information.

<h1>Building</h1>

<p>To build a copy of the dbhash utility program on unix, get a copy of the
canonical SQLite source code and enter:

<codeblock>
./configure
make dbhash
</codeblock>

<p>On Windows, enter:

<codeblock>
nmake /f makefile.msc dbhash.exe
</codeblock>

<p>The dbhash program is implemented by a single file of C-code
called [https://www.sqlite.org/src/artifact?ci=trunk&filename=tool/dbhash.c|dbhash.c].
To build the dbhash program manually, simply compile the dbhash.c source file
and link it against the SQLite library.