Documentation Source Text

Check-in [fcac2a0e45]
Login

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

Overview
Comment:Initial work on improving the CLI documentation. Much more needed here.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: fcac2a0e45790eb78c5a575ee180fbd8bb96f1e9
User & Date: drh 2017-03-09 13:36:26
Context
2017-03-10
16:37
Add documentation for the SQLITE_MAX_MEMORY compile-time option. check-in: 268f62bc5a user: drh tags: trunk
2017-03-09
13:36
Initial work on improving the CLI documentation. Much more needed here. check-in: fcac2a0e45 user: drh tags: trunk
2017-03-07
22:25
Fix a typo in the file format document. check-in: 01b45f38af user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to pages/cli.in.

679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
...
790
791
792
793
794
795
796





















database into a single ASCII text file.  This file can be converted
back into a database by piping it back into <b>sqlite3</b>.</p>

<p>A good way to make an archival copy of a database is this:</p>


<tclscript>DisplayCode {
$ (((echo '.dump' | sqlite3 ex1 | gzip -c >ex1.dump.gz)))
}</tclscript>


<p>This generates a file named <b>ex1.dump.gz</b> that contains everything
you need to reconstruct the database at a later time, or on another
machine.  To reconstruct the database, just type:</p>

................................................................................
[how to compile|Compile] this file (together
with the [amalgamation | sqlite3 library source code]) to generate
the executable.  For example:</p>

<tclscript>DisplayCode {
gcc -o sqlite3 shell.c sqlite3.c -ldl -lpthread
} </tclscript>




























|







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
...
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
database into a single ASCII text file.  This file can be converted
back into a database by piping it back into <b>sqlite3</b>.</p>

<p>A good way to make an archival copy of a database is this:</p>


<tclscript>DisplayCode {
$ (((sqlite3 ex1 .dump | gzip -c >ex1.dump.gz)))
}</tclscript>


<p>This generates a file named <b>ex1.dump.gz</b> that contains everything
you need to reconstruct the database at a later time, or on another
machine.  To reconstruct the database, just type:</p>

................................................................................
[how to compile|Compile] this file (together
with the [amalgamation | sqlite3 library source code]) to generate
the executable.  For example:</p>

<tclscript>DisplayCode {
gcc -o sqlite3 shell.c sqlite3.c -ldl -lpthread
} </tclscript>

<p>
You might want to provide additional compile-time options:
<ul>
<li><p>[-DSQLITE_THREADSAFE=0]:
The command-line shell does no use threads, so you might as well turn
thread-safety off, for improved performance and a reduced code footprint.
This also eliminates the need for the "-lpthread" switch on the
compiler command line.

<li><p>-DSQLITE_ENABLE_EXPLAIN_COMMENT:
This option adds comment text to the end of each opcode in the
output of [EXPLAIN].  The EXPLAIN output is much easier to read
with this option enabled.

<li><p>[-DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION]:
This option allows [EXPLAIN] statements to succeed even if the contain
references to unknown SQL functions.  This makes the shell useful for
looking at EXPLAIN or EXPLAIN QUERY PLAN output for queries pasted out
of applications that define and use custom SQL functions.
</ul>