File
sqlite3.1
— part of check-in
[67f0d469da]
at
2014-10-31 14:46:51
on branch trunk
— Change the command-line shell man-page to use the ".tr" troff directive
instead of ".cc" for escaping the initial "." characters in the ".help"
output.
(user:
drh
size: 8928)
[more...]
0000: 2e 5c 22 20 20 20 20 20 20 20 20 20 20 20 20 20 .\"
0010: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0020: 20 20 20 20 20 20 20 20 20 48 65 79 2c 20 45 4d Hey, EM
0030: 41 43 53 3a 20 2d 2a 2d 20 6e 72 6f 66 66 20 2d ACS: -*- nroff -
0040: 2a 2d 0a 2e 5c 22 20 46 69 72 73 74 20 70 61 72 *-..\" First par
0050: 61 6d 65 74 65 72 2c 20 4e 41 4d 45 2c 20 73 68 ameter, NAME, sh
0060: 6f 75 6c 64 20 62 65 20 61 6c 6c 20 63 61 70 73 ould be all caps
0070: 0a 2e 5c 22 20 53 65 63 6f 6e 64 20 70 61 72 61 ..\" Second para
0080: 6d 65 74 65 72 2c 20 53 45 43 54 49 4f 4e 2c 20 meter, SECTION,
0090: 73 68 6f 75 6c 64 20 62 65 20 31 2d 38 2c 20 6d should be 1-8, m
00a0: 61 79 62 65 20 77 2f 20 73 75 62 73 65 63 74 69 aybe w/ subsecti
00b0: 6f 6e 0a 2e 5c 22 20 6f 74 68 65 72 20 70 61 72 on..\" other par
00c0: 61 6d 65 74 65 72 73 20 61 72 65 20 61 6c 6c 6f ameters are allo
00d0: 77 65 64 3a 20 73 65 65 20 6d 61 6e 28 37 29 2c wed: see man(7),
00e0: 20 6d 61 6e 28 31 29 0a 2e 54 48 20 53 51 4c 49 man(1)..TH SQLI
00f0: 54 45 33 20 31 20 22 46 72 69 20 4f 63 74 20 33 TE3 1 "Fri Oct 3
0100: 31 20 31 30 3a 34 31 3a 33 31 20 45 44 54 20 32 1 10:41:31 EDT 2
0110: 30 31 34 22 0a 2e 5c 22 20 50 6c 65 61 73 65 20 014"..\" Please
0120: 61 64 6a 75 73 74 20 74 68 69 73 20 64 61 74 65 adjust this date
0130: 20 77 68 65 6e 65 76 65 72 20 72 65 76 69 73 69 whenever revisi
0140: 6e 67 20 74 68 65 20 6d 61 6e 70 61 67 65 2e 0a ng the manpage..
0150: 2e 5c 22 0a 2e 5c 22 20 53 6f 6d 65 20 72 6f 66 .\"..\" Some rof
0160: 66 20 6d 61 63 72 6f 73 2c 20 66 6f 72 20 72 65 f macros, for re
0170: 66 65 72 65 6e 63 65 3a 0a 2e 5c 22 20 2e 6e 68 ference:..\" .nh
0180: 20 20 20 20 20 20 20 20 64 69 73 61 62 6c 65 20 disable
0190: 68 79 70 68 65 6e 61 74 69 6f 6e 0a 2e 5c 22 20 hyphenation..\"
01a0: 2e 68 79 20 20 20 20 20 20 20 20 65 6e 61 62 6c .hy enabl
01b0: 65 20 68 79 70 68 65 6e 61 74 69 6f 6e 0a 2e 5c e hyphenation..\
01c0: 22 20 2e 61 64 20 6c 20 20 20 20 20 20 6c 65 66 " .ad l lef
01d0: 74 20 6a 75 73 74 69 66 79 0a 2e 5c 22 20 2e 61 t justify..\" .a
01e0: 64 20 62 20 20 20 20 20 20 6a 75 73 74 69 66 79 d b justify
01f0: 20 74 6f 20 62 6f 74 68 20 6c 65 66 74 20 61 6e to both left an
0200: 64 20 72 69 67 68 74 20 6d 61 72 67 69 6e 73 0a d right margins.
0210: 2e 5c 22 20 2e 6e 66 20 20 20 20 20 20 20 20 64 .\" .nf d
0220: 69 73 61 62 6c 65 20 66 69 6c 6c 69 6e 67 0a 2e isable filling..
0230: 5c 22 20 2e 66 69 20 20 20 20 20 20 20 20 65 6e \" .fi en
0240: 61 62 6c 65 20 66 69 6c 6c 69 6e 67 0a 2e 5c 22 able filling..\"
0250: 20 2e 62 72 20 20 20 20 20 20 20 20 69 6e 73 65 .br inse
0260: 72 74 20 6c 69 6e 65 20 62 72 65 61 6b 0a 2e 5c rt line break..\
0270: 22 20 2e 73 70 20 3c 6e 3e 20 20 20 20 69 6e 73 " .sp <n> ins
0280: 65 72 74 20 6e 2b 31 20 65 6d 70 74 79 20 6c 69 ert n+1 empty li
0290: 6e 65 73 0a 2e 5c 22 20 66 6f 72 20 6d 61 6e 70 nes..\" for manp
02a0: 61 67 65 2d 73 70 65 63 69 66 69 63 20 6d 61 63 age-specific mac
02b0: 72 6f 73 2c 20 73 65 65 20 6d 61 6e 28 37 29 0a ros, see man(7).
02c0: 2e 53 48 20 4e 41 4d 45 0a 2e 42 20 73 71 6c 69 .SH NAME..B sqli
02d0: 74 65 33 20 0a 5c 2d 20 41 20 63 6f 6d 6d 61 6e te3 .\- A comman
02e0: 64 20 6c 69 6e 65 20 69 6e 74 65 72 66 61 63 65 d line interface
02f0: 20 66 6f 72 20 53 51 4c 69 74 65 20 76 65 72 73 for SQLite vers
0300: 69 6f 6e 20 33 0a 0a 2e 53 48 20 53 59 4e 4f 50 ion 3...SH SYNOP
0310: 53 49 53 0a 2e 42 20 73 71 6c 69 74 65 33 0a 2e SIS..B sqlite3..
0320: 52 49 20 5b 20 6f 70 74 69 6f 6e 73 20 5d 0a 2e RI [ options ]..
0330: 52 49 20 5b 20 64 61 74 61 62 61 73 65 66 69 6c RI [ databasefil
0340: 65 20 5d 0a 2e 52 49 20 5b 20 53 51 4c 20 5d 0a e ]..RI [ SQL ].
0350: 0a 2e 53 48 20 53 55 4d 4d 41 52 59 0a 2e 50 50 ..SH SUMMARY..PP
0360: 0a 2e 42 20 73 71 6c 69 74 65 33 0a 69 73 20 61 ..B sqlite3.is a
0370: 20 74 65 72 6d 69 6e 61 6c 2d 62 61 73 65 64 20 terminal-based
0380: 66 72 6f 6e 74 2d 65 6e 64 20 74 6f 20 74 68 65 front-end to the
0390: 20 53 51 4c 69 74 65 20 6c 69 62 72 61 72 79 20 SQLite library
03a0: 74 68 61 74 20 63 61 6e 20 65 76 61 6c 75 61 74 that can evaluat
03b0: 65 0a 71 75 65 72 69 65 73 20 69 6e 74 65 72 61 e.queries intera
03c0: 63 74 69 76 65 6c 79 20 61 6e 64 20 64 69 73 70 ctively and disp
03d0: 6c 61 79 20 74 68 65 20 72 65 73 75 6c 74 73 20 lay the results
03e0: 69 6e 20 6d 75 6c 74 69 70 6c 65 20 66 6f 72 6d in multiple form
03f0: 61 74 73 2e 0a 2e 42 20 73 71 6c 69 74 65 33 0a ats...B sqlite3.
0400: 63 61 6e 20 61 6c 73 6f 20 62 65 20 75 73 65 64 can also be used
0410: 20 77 69 74 68 69 6e 20 73 68 65 6c 6c 20 73 63 within shell sc
0420: 72 69 70 74 73 20 61 6e 64 20 6f 74 68 65 72 20 ripts and other
0430: 61 70 70 6c 69 63 61 74 69 6f 6e 73 20 74 6f 20 applications to
0440: 70 72 6f 76 69 64 65 0a 62 61 74 63 68 20 70 72 provide.batch pr
0450: 6f 63 65 73 73 69 6e 67 20 66 65 61 74 75 72 65 ocessing feature
0460: 73 2e 0a 0a 2e 53 48 20 44 45 53 43 52 49 50 54 s....SH DESCRIPT
0470: 49 4f 4e 0a 54 6f 20 73 74 61 72 74 20 61 0a 2e ION.To start a..
0480: 42 20 73 71 6c 69 74 65 33 0a 69 6e 74 65 72 61 B sqlite3.intera
0490: 63 74 69 76 65 20 73 65 73 73 69 6f 6e 2c 20 69 ctive session, i
04a0: 6e 76 6f 6b 65 20 74 68 65 0a 2e 42 20 73 71 6c nvoke the..B sql
04b0: 69 74 65 33 0a 63 6f 6d 6d 61 6e 64 20 61 6e 64 ite3.command and
04c0: 20 6f 70 74 69 6f 6e 61 6c 6c 79 20 70 72 6f 76 optionally prov
04d0: 69 64 65 20 74 68 65 20 6e 61 6d 65 20 6f 66 20 ide the name of
04e0: 61 20 64 61 74 61 62 61 73 65 20 66 69 6c 65 2e a database file.
04f0: 20 20 49 66 20 74 68 65 0a 64 61 74 61 62 61 73 If the.databas
0500: 65 20 66 69 6c 65 20 64 6f 65 73 20 6e 6f 74 20 e file does not
0510: 65 78 69 73 74 2c 20 69 74 20 77 69 6c 6c 20 62 exist, it will b
0520: 65 20 63 72 65 61 74 65 64 2e 20 20 49 66 20 74 e created. If t
0530: 68 65 20 64 61 74 61 62 61 73 65 20 66 69 6c 65 he database file
0540: 0a 64 6f 65 73 20 65 78 69 73 74 2c 20 69 74 20 .does exist, it
0550: 77 69 6c 6c 20 62 65 20 6f 70 65 6e 65 64 2e 0a will be opened..
0560: 0a 46 6f 72 20 65 78 61 6d 70 6c 65 2c 20 74 6f .For example, to
0570: 20 63 72 65 61 74 65 20 61 20 6e 65 77 20 64 61 create a new da
0580: 74 61 62 61 73 65 20 66 69 6c 65 20 6e 61 6d 65 tabase file name
0590: 64 20 22 6d 79 64 61 74 61 2e 64 62 22 2c 20 63 d "mydata.db", c
05a0: 72 65 61 74 65 0a 61 20 74 61 62 6c 65 20 6e 61 reate.a table na
05b0: 6d 65 64 20 22 6d 65 6d 6f 73 22 20 61 6e 64 20 med "memos" and
05c0: 69 6e 73 65 72 74 20 61 20 63 6f 75 70 6c 65 20 insert a couple
05d0: 6f 66 20 72 65 63 6f 72 64 73 20 69 6e 74 6f 20 of records into
05e0: 74 68 61 74 20 74 61 62 6c 65 3a 0a 2e 73 70 0a that table:..sp.
05f0: 24 20 0a 2e 42 20 73 71 6c 69 74 65 33 20 6d 79 $ ..B sqlite3 my
0600: 64 61 74 61 2e 64 62 0a 2e 62 72 0a 53 51 4c 69 data.db..br.SQLi
0610: 74 65 20 76 65 72 73 69 6f 6e 20 33 2e 38 2e 38 te version 3.8.8
0620: 0a 2e 62 72 0a 45 6e 74 65 72 20 22 2e 68 65 6c ..br.Enter ".hel
0630: 70 22 20 66 6f 72 20 69 6e 73 74 72 75 63 74 69 p" for instructi
0640: 6f 6e 73 0a 2e 62 72 0a 73 71 6c 69 74 65 3e 0a ons..br.sqlite>.
0650: 2e 42 20 63 72 65 61 74 65 20 74 61 62 6c 65 20 .B create table
0660: 6d 65 6d 6f 73 28 74 65 78 74 2c 20 70 72 69 6f memos(text, prio
0670: 72 69 74 79 20 49 4e 54 45 47 45 52 29 3b 0a 2e rity INTEGER);..
0680: 62 72 0a 73 71 6c 69 74 65 3e 0a 2e 42 20 69 6e br.sqlite>..B in
0690: 73 65 72 74 20 69 6e 74 6f 20 6d 65 6d 6f 73 20 sert into memos
06a0: 76 61 6c 75 65 73 28 27 64 65 6c 69 76 65 72 20 values('deliver
06b0: 70 72 6f 6a 65 63 74 20 64 65 73 63 72 69 70 74 project descript
06c0: 69 6f 6e 27 2c 20 31 30 29 3b 0a 2e 62 72 0a 73 ion', 10);..br.s
06d0: 71 6c 69 74 65 3e 0a 2e 42 20 69 6e 73 65 72 74 qlite>..B insert
06e0: 20 69 6e 74 6f 20 6d 65 6d 6f 73 20 76 61 6c 75 into memos valu
06f0: 65 73 28 27 6c 75 6e 63 68 20 77 69 74 68 20 43 es('lunch with C
0700: 68 72 69 73 74 69 6e 65 27 2c 20 31 30 30 29 3b hristine', 100);
0710: 0a 2e 62 72 0a 73 71 6c 69 74 65 3e 0a 2e 42 20 ..br.sqlite>..B
0720: 73 65 6c 65 63 74 20 2a 20 66 72 6f 6d 20 6d 65 select * from me
0730: 6d 6f 73 3b 0a 2e 62 72 0a 64 65 6c 69 76 65 72 mos;..br.deliver
0740: 20 70 72 6f 6a 65 63 74 20 64 65 73 63 72 69 70 project descrip
0750: 74 69 6f 6e 7c 31 30 0a 2e 62 72 0a 6c 75 6e 63 tion|10..br.lunc
0760: 68 20 77 69 74 68 20 43 68 72 69 73 74 69 6e 65 h with Christine
0770: 7c 31 30 30 0a 2e 62 72 0a 73 71 6c 69 74 65 3e |100..br.sqlite>
0780: 0a 2e 73 70 0a 0a 49 66 20 6e 6f 20 64 61 74 61 ..sp..If no data
0790: 62 61 73 65 20 6e 61 6d 65 20 69 73 20 73 75 70 base name is sup
07a0: 70 6c 69 65 64 2c 20 74 68 65 20 41 54 54 41 43 plied, the ATTAC
07b0: 48 20 73 71 6c 20 63 6f 6d 6d 61 6e 64 20 63 61 H sql command ca
07c0: 6e 20 62 65 20 75 73 65 64 0a 74 6f 20 61 74 74 n be used.to att
07d0: 61 63 68 20 74 6f 20 65 78 69 73 74 69 6e 67 20 ach to existing
07e0: 6f 72 20 63 72 65 61 74 65 20 6e 65 77 20 64 61 or create new da
07f0: 74 61 62 61 73 65 20 66 69 6c 65 73 2e 20 20 41 tabase files. A
0800: 54 54 41 43 48 20 63 61 6e 20 61 6c 73 6f 0a 62 TTACH can also.b
0810: 65 20 75 73 65 64 20 74 6f 20 61 74 74 61 63 68 e used to attach
0820: 20 74 6f 20 6d 75 6c 74 69 70 6c 65 20 64 61 74 to multiple dat
0830: 61 62 61 73 65 73 20 77 69 74 68 69 6e 20 74 68 abases within th
0840: 65 20 73 61 6d 65 20 69 6e 74 65 72 61 63 74 69 e same interacti
0850: 76 65 0a 73 65 73 73 69 6f 6e 2e 20 20 54 68 69 ve.session. Thi
0860: 73 20 69 73 20 75 73 65 66 75 6c 20 66 6f 72 20 s is useful for
0870: 6d 69 67 72 61 74 69 6e 67 20 64 61 74 61 20 62 migrating data b
0880: 65 74 77 65 65 6e 20 64 61 74 61 62 61 73 65 73 etween databases
0890: 2c 0a 70 6f 73 73 69 62 6c 79 20 63 68 61 6e 67 ,.possibly chang
08a0: 69 6e 67 20 74 68 65 20 73 63 68 65 6d 61 20 61 ing the schema a
08b0: 6c 6f 6e 67 20 74 68 65 20 77 61 79 2e 0a 0a 4f long the way...O
08c0: 70 74 69 6f 6e 61 6c 6c 79 2c 20 61 20 53 51 4c ptionally, a SQL
08d0: 20 73 74 61 74 65 6d 65 6e 74 20 6f 72 20 73 65 statement or se
08e0: 74 20 6f 66 20 53 51 4c 20 73 74 61 74 65 6d 65 t of SQL stateme
08f0: 6e 74 73 20 63 61 6e 20 62 65 20 73 75 70 70 6c nts can be suppl
0900: 69 65 64 20 61 73 0a 61 20 73 69 6e 67 6c 65 20 ied as.a single
0910: 61 72 67 75 6d 65 6e 74 2e 20 20 4d 75 6c 74 69 argument. Multi
0920: 70 6c 65 20 73 74 61 74 65 6d 65 6e 74 73 20 73 ple statements s
0930: 68 6f 75 6c 64 20 62 65 20 73 65 70 61 72 61 74 hould be separat
0940: 65 64 20 62 79 0a 73 65 6d 69 2d 63 6f 6c 6f 6e ed by.semi-colon
0950: 73 2e 0a 0a 46 6f 72 20 65 78 61 6d 70 6c 65 3a s...For example:
0960: 0a 2e 73 70 0a 24 20 0a 2e 42 20 73 71 6c 69 74 ..sp.$ ..B sqlit
0970: 65 33 20 2d 6c 69 6e 65 20 6d 79 64 61 74 61 2e e3 -line mydata.
0980: 64 62 20 27 73 65 6c 65 63 74 20 2a 20 66 72 6f db 'select * fro
0990: 6d 20 6d 65 6d 6f 73 20 77 68 65 72 65 20 70 72 m memos where pr
09a0: 69 6f 72 69 74 79 20 3e 20 32 30 3b 27 0a 2e 62 iority > 20;'..b
09b0: 72 0a 20 20 20 20 74 65 78 74 20 3d 20 6c 75 6e r. text = lun
09c0: 63 68 20 77 69 74 68 20 43 68 72 69 73 74 69 6e ch with Christin
09d0: 65 0a 2e 62 72 0a 70 72 69 6f 72 69 74 79 20 3d e..br.priority =
09e0: 20 31 30 30 0a 2e 62 72 0a 2e 73 70 0a 0a 2e 53 100..br..sp...S
09f0: 53 20 53 51 4c 49 54 45 20 4d 45 54 41 2d 43 4f S SQLITE META-CO
0a00: 4d 4d 41 4e 44 53 0a 2e 50 50 0a 54 68 65 20 69 MMANDS..PP.The i
0a10: 6e 74 65 72 61 63 74 69 76 65 20 69 6e 74 65 72 nteractive inter
0a20: 70 72 65 74 65 72 20 6f 66 66 65 72 73 20 61 20 preter offers a
0a30: 73 65 74 20 6f 66 20 6d 65 74 61 2d 63 6f 6d 6d set of meta-comm
0a40: 61 6e 64 73 20 74 68 61 74 20 63 61 6e 20 62 65 ands that can be
0a50: 0a 75 73 65 64 20 74 6f 20 63 6f 6e 74 72 6f 6c .used to control
0a60: 20 74 68 65 20 6f 75 74 70 75 74 20 66 6f 72 6d the output form
0a70: 61 74 2c 20 65 78 61 6d 69 6e 65 20 74 68 65 20 at, examine the
0a80: 63 75 72 72 65 6e 74 6c 79 20 61 74 74 61 63 68 currently attach
0a90: 65 64 0a 64 61 74 61 62 61 73 65 20 66 69 6c 65 ed.database file
0aa0: 73 2c 20 6f 72 20 70 65 72 66 6f 72 6d 20 61 64 s, or perform ad
0ab0: 6d 69 6e 69 73 74 72 61 74 69 76 65 20 6f 70 65 ministrative ope
0ac0: 72 61 74 69 6f 6e 73 20 75 70 6f 6e 20 74 68 65 rations upon the
0ad0: 0a 61 74 74 61 63 68 65 64 20 64 61 74 61 62 61 .attached databa
0ae0: 73 65 73 20 28 73 75 63 68 20 61 73 20 72 65 62 ses (such as reb
0af0: 75 69 6c 64 69 6e 67 20 69 6e 64 69 63 65 73 29 uilding indices)
0b00: 2e 20 20 20 4d 65 74 61 2d 63 6f 6d 6d 61 6e 64 . Meta-command
0b10: 73 20 61 72 65 0a 61 6c 77 61 79 73 20 70 72 65 s are.always pre
0b20: 66 69 78 65 64 20 77 69 74 68 20 61 20 64 6f 74 fixed with a dot
0b30: 20 28 2e 29 2e 0a 0a 41 20 6c 69 73 74 20 6f 66 (.)...A list of
0b40: 20 61 76 61 69 6c 61 62 6c 65 20 6d 65 74 61 2d available meta-
0b50: 63 6f 6d 6d 61 6e 64 73 20 63 61 6e 20 62 65 20 commands can be
0b60: 76 69 65 77 65 64 20 61 74 20 61 6e 79 20 74 69 viewed at any ti
0b70: 6d 65 20 62 79 20 69 73 73 75 69 6e 67 0a 74 68 me by issuing.th
0b80: 65 20 27 2e 68 65 6c 70 27 20 63 6f 6d 6d 61 6e e '.help' comman
0b90: 64 2e 20 20 46 6f 72 20 65 78 61 6d 70 6c 65 3a d. For example:
0ba0: 0a 2e 73 70 0a 73 71 6c 69 74 65 3e 0a 2e 42 20 ..sp.sqlite>..B
0bb0: 2e 68 65 6c 70 0a 2e 6e 66 0a 2e 74 72 20 25 2e .help..nf..tr %.
0bc0: 0a 25 62 61 63 6b 75 70 20 3f 44 42 3f 20 46 49 .%backup ?DB? FI
0bd0: 4c 45 20 20 20 20 20 20 42 61 63 6b 75 70 20 44 LE Backup D
0be0: 42 20 28 64 65 66 61 75 6c 74 20 22 6d 61 69 6e B (default "main
0bf0: 22 29 20 74 6f 20 46 49 4c 45 0a 25 62 61 69 6c ") to FILE.%bail
0c00: 20 6f 6e 7c 6f 66 66 20 20 20 20 20 20 20 20 20 on|off
0c10: 20 20 53 74 6f 70 20 61 66 74 65 72 20 68 69 74 Stop after hit
0c20: 74 69 6e 67 20 61 6e 20 65 72 72 6f 72 2e 20 20 ting an error.
0c30: 44 65 66 61 75 6c 74 20 4f 46 46 0a 25 63 6c 6f Default OFF.%clo
0c40: 6e 65 20 4e 45 57 44 42 20 20 20 20 20 20 20 20 ne NEWDB
0c50: 20 20 20 43 6c 6f 6e 65 20 64 61 74 61 20 69 6e Clone data in
0c60: 74 6f 20 4e 45 57 44 42 20 66 72 6f 6d 20 74 68 to NEWDB from th
0c70: 65 20 65 78 69 73 74 69 6e 67 20 64 61 74 61 62 e existing datab
0c80: 61 73 65 0a 25 64 61 74 61 62 61 73 65 73 20 20 ase.%databases
0c90: 20 20 20 20 20 20 20 20 20 20 20 4c 69 73 74 20 List
0ca0: 6e 61 6d 65 73 20 61 6e 64 20 66 69 6c 65 73 20 names and files
0cb0: 6f 66 20 61 74 74 61 63 68 65 64 20 64 61 74 61 of attached data
0cc0: 62 61 73 65 73 0a 25 64 75 6d 70 20 3f 54 41 42 bases.%dump ?TAB
0cd0: 4c 45 3f 20 2e 2e 2e 20 20 20 20 20 20 44 75 6d LE? ... Dum
0ce0: 70 20 74 68 65 20 64 61 74 61 62 61 73 65 20 69 p the database i
0cf0: 6e 20 61 6e 20 53 51 4c 20 74 65 78 74 20 66 6f n an SQL text fo
0d00: 72 6d 61 74 0a 20 20 20 20 20 20 20 20 20 20 20 rmat.
0d10: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 49 66 If
0d20: 20 54 41 42 4c 45 20 73 70 65 63 69 66 69 65 64 TABLE specified
0d30: 2c 20 6f 6e 6c 79 20 64 75 6d 70 20 74 61 62 6c , only dump tabl
0d40: 65 73 20 6d 61 74 63 68 69 6e 67 0a 20 20 20 20 es matching.
0d50: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0d60: 20 20 20 20 20 4c 49 4b 45 20 70 61 74 74 65 72 LIKE patter
0d70: 6e 20 54 41 42 4c 45 2e 0a 25 65 63 68 6f 20 6f n TABLE..%echo o
0d80: 6e 7c 6f 66 66 20 20 20 20 20 20 20 20 20 20 20 n|off
0d90: 54 75 72 6e 20 63 6f 6d 6d 61 6e 64 20 65 63 68 Turn command ech
0da0: 6f 20 6f 6e 20 6f 72 20 6f 66 66 0a 25 65 71 70 o on or off.%eqp
0db0: 20 6f 6e 7c 6f 66 66 20 20 20 20 20 20 20 20 20 on|off
0dc0: 20 20 20 45 6e 61 62 6c 65 20 6f 72 20 64 69 73 Enable or dis
0dd0: 61 62 6c 65 20 61 75 74 6f 6d 61 74 69 63 20 45 able automatic E
0de0: 58 50 4c 41 49 4e 20 51 55 45 52 59 20 50 4c 41 XPLAIN QUERY PLA
0df0: 4e 0a 25 65 78 69 74 20 20 20 20 20 20 20 20 20 N.%exit
0e00: 20 20 20 20 20 20 20 20 20 45 78 69 74 20 74 68 Exit th
0e10: 69 73 20 70 72 6f 67 72 61 6d 0a 25 65 78 70 6c is program.%expl
0e20: 61 69 6e 20 3f 6f 6e 7c 6f 66 66 3f 20 20 20 20 ain ?on|off?
0e30: 20 20 54 75 72 6e 20 6f 75 74 70 75 74 20 6d 6f Turn output mo
0e40: 64 65 20 73 75 69 74 61 62 6c 65 20 66 6f 72 20 de suitable for
0e50: 45 58 50 4c 41 49 4e 20 6f 6e 20 6f 72 20 6f 66 EXPLAIN on or of
0e60: 66 2e 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 f..
0e70: 20 20 20 20 20 20 20 20 20 20 20 20 57 69 74 68 With
0e80: 20 6e 6f 20 61 72 67 73 2c 20 69 74 20 74 75 72 no args, it tur
0e90: 6e 73 20 45 58 50 4c 41 49 4e 20 6f 6e 2e 0a 25 ns EXPLAIN on..%
0ea0: 66 75 6c 6c 73 63 68 65 6d 61 20 20 20 20 20 20 fullschema
0eb0: 20 20 20 20 20 20 53 68 6f 77 20 73 63 68 65 6d Show schem
0ec0: 61 20 61 6e 64 20 74 68 65 20 63 6f 6e 74 65 6e a and the conten
0ed0: 74 20 6f 66 20 73 71 6c 69 74 65 5f 73 74 61 74 t of sqlite_stat
0ee0: 20 74 61 62 6c 65 73 0a 25 68 65 61 64 65 72 73 tables.%headers
0ef0: 20 6f 6e 7c 6f 66 66 20 20 20 20 20 20 20 20 54 on|off T
0f00: 75 72 6e 20 64 69 73 70 6c 61 79 20 6f 66 20 68 urn display of h
0f10: 65 61 64 65 72 73 20 6f 6e 20 6f 72 20 6f 66 66 eaders on or off
0f20: 0a 25 68 65 6c 70 20 20 20 20 20 20 20 20 20 20 .%help
0f30: 20 20 20 20 20 20 20 20 53 68 6f 77 20 74 68 69 Show thi
0f40: 73 20 6d 65 73 73 61 67 65 0a 25 69 6d 70 6f 72 s message.%impor
0f50: 74 20 46 49 4c 45 20 54 41 42 4c 45 20 20 20 20 t FILE TABLE
0f60: 20 49 6d 70 6f 72 74 20 64 61 74 61 20 66 72 6f Import data fro
0f70: 6d 20 46 49 4c 45 20 69 6e 74 6f 20 54 41 42 4c m FILE into TABL
0f80: 45 0a 25 69 6e 64 69 63 65 73 20 3f 54 41 42 4c E.%indices ?TABL
0f90: 45 3f 20 20 20 20 20 20 20 53 68 6f 77 20 6e 61 E? Show na
0fa0: 6d 65 73 20 6f 66 20 61 6c 6c 20 69 6e 64 69 63 mes of all indic
0fb0: 65 73 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 es.
0fc0: 20 20 20 20 20 20 20 20 20 20 20 20 49 66 20 54 If T
0fd0: 41 42 4c 45 20 73 70 65 63 69 66 69 65 64 2c 20 ABLE specified,
0fe0: 6f 6e 6c 79 20 73 68 6f 77 20 69 6e 64 69 63 65 only show indice
0ff0: 73 20 66 6f 72 20 74 61 62 6c 65 73 0a 20 20 20 s for tables.
1000: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
1010: 20 20 20 20 20 20 6d 61 74 63 68 69 6e 67 20 4c matching L
1020: 49 4b 45 20 70 61 74 74 65 72 6e 20 54 41 42 4c IKE pattern TABL
1030: 45 2e 0a 25 6c 6f 61 64 20 46 49 4c 45 20 3f 45 E..%load FILE ?E
1040: 4e 54 52 59 3f 20 20 20 20 20 4c 6f 61 64 20 61 NTRY? Load a
1050: 6e 20 65 78 74 65 6e 73 69 6f 6e 20 6c 69 62 72 n extension libr
1060: 61 72 79 0a 25 6c 6f 67 20 46 49 4c 45 7c 6f 66 ary.%log FILE|of
1070: 66 20 20 20 20 20 20 20 20 20 20 54 75 72 6e 20 f Turn
1080: 6c 6f 67 67 69 6e 67 20 6f 6e 20 6f 72 20 6f 66 logging on or of
1090: 66 2e 20 20 46 49 4c 45 20 63 61 6e 20 62 65 20 f. FILE can be
10a0: 73 74 64 65 72 72 2f 73 74 64 6f 75 74 0a 25 6d stderr/stdout.%m
10b0: 6f 64 65 20 4d 4f 44 45 20 3f 54 41 42 4c 45 3f ode MODE ?TABLE?
10c0: 20 20 20 20 20 53 65 74 20 6f 75 74 70 75 74 20 Set output
10d0: 6d 6f 64 65 20 77 68 65 72 65 20 4d 4f 44 45 20 mode where MODE
10e0: 69 73 20 6f 6e 65 20 6f 66 3a 0a 20 20 20 20 20 is one of:.
10f0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
1100: 20 20 20 20 63 73 76 20 20 20 20 20 20 43 6f 6d csv Com
1110: 6d 61 2d 73 65 70 61 72 61 74 65 64 20 76 61 6c ma-separated val
1120: 75 65 73 0a 20 20 20 20 20 20 20 20 20 20 20 20 ues.
1130: 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6c col
1140: 75 6d 6e 20 20 20 4c 65 66 74 2d 61 6c 69 67 6e umn Left-align
1150: 65 64 20 63 6f 6c 75 6d 6e 73 2e 20 20 28 53 65 ed columns. (Se
1160: 65 20 2e 77 69 64 74 68 29 0a 20 20 20 20 20 20 e .width).
1170: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
1180: 20 20 20 68 74 6d 6c 20 20 20 20 20 48 54 4d 4c html HTML
1190: 20 3c 74 61 62 6c 65 3e 20 63 6f 64 65 0a 20 20 <table> code.
11a0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
11b0: 20 20 20 20 20 20 20 69 6e 73 65 72 74 20 20 20 insert
11c0: 53 51 4c 20 69 6e 73 65 72 74 20 73 74 61 74 65 SQL insert state
11d0: 6d 65 6e 74 73 20 66 6f 72 20 54 41 42 4c 45 0a ments for TABLE.
11e0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
11f0: 20 20 20 20 20 20 20 20 20 6c 69 6e 65 20 20 20 line
1200: 20 20 4f 6e 65 20 76 61 6c 75 65 20 70 65 72 20 One value per
1210: 6c 69 6e 65 0a 20 20 20 20 20 20 20 20 20 20 20 line.
1220: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6c 69 li
1230: 73 74 20 20 20 20 20 56 61 6c 75 65 73 20 64 65 st Values de
1240: 6c 69 6d 69 74 65 64 20 62 79 20 2e 73 65 70 61 limited by .sepa
1250: 72 61 74 6f 72 20 73 74 72 69 6e 67 0a 20 20 20 rator string.
1260: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
1270: 20 20 20 20 20 20 74 61 62 73 20 20 20 20 20 54 tabs T
1280: 61 62 2d 73 65 70 61 72 61 74 65 64 20 76 61 6c ab-separated val
1290: 75 65 73 0a 20 20 20 20 20 20 20 20 20 20 20 20 ues.
12a0: 20 20 20 20 20 20 20 20 20 20 20 20 20 74 63 6c tcl
12b0: 20 20 20 20 20 20 54 43 4c 20 6c 69 73 74 20 65 TCL list e
12c0: 6c 65 6d 65 6e 74 73 0a 25 6e 75 6c 6c 76 61 6c lements.%nullval
12d0: 75 65 20 53 54 52 49 4e 47 20 20 20 20 20 20 55 ue STRING U
12e0: 73 65 20 53 54 52 49 4e 47 20 69 6e 20 70 6c 61 se STRING in pla
12f0: 63 65 20 6f 66 20 4e 55 4c 4c 20 76 61 6c 75 65 ce of NULL value
1300: 73 0a 25 6f 6e 63 65 20 46 49 4c 45 4e 41 4d 45 s.%once FILENAME
1310: 20 20 20 20 20 20 20 20 20 4f 75 74 70 75 74 20 Output
1320: 66 6f 72 20 74 68 65 20 6e 65 78 74 20 53 51 4c for the next SQL
1330: 20 63 6f 6d 6d 61 6e 64 20 6f 6e 6c 79 20 74 6f command only to
1340: 20 46 49 4c 45 4e 41 4d 45 0a 25 6f 70 65 6e 20 FILENAME.%open
1350: 3f 46 49 4c 45 4e 41 4d 45 3f 20 20 20 20 20 20 ?FILENAME?
1360: 20 43 6c 6f 73 65 20 65 78 69 73 74 69 6e 67 20 Close existing
1370: 64 61 74 61 62 61 73 65 20 61 6e 64 20 72 65 6f database and reo
1380: 70 65 6e 20 46 49 4c 45 4e 41 4d 45 0a 25 6f 75 pen FILENAME.%ou
1390: 74 70 75 74 20 3f 46 49 4c 45 4e 41 4d 45 3f 20 tput ?FILENAME?
13a0: 20 20 20 20 53 65 6e 64 20 6f 75 74 70 75 74 20 Send output
13b0: 74 6f 20 46 49 4c 45 4e 41 4d 45 20 6f 72 20 73 to FILENAME or s
13c0: 74 64 6f 75 74 0a 25 70 72 69 6e 74 20 53 54 52 tdout.%print STR
13d0: 49 4e 47 2e 2e 2e 20 20 20 20 20 20 20 50 72 69 ING... Pri
13e0: 6e 74 20 6c 69 74 65 72 61 6c 20 53 54 52 49 4e nt literal STRIN
13f0: 47 0a 25 70 72 6f 6d 70 74 20 4d 41 49 4e 20 43 G.%prompt MAIN C
1400: 4f 4e 54 49 4e 55 45 20 20 52 65 70 6c 61 63 65 ONTINUE Replace
1410: 20 74 68 65 20 73 74 61 6e 64 61 72 64 20 70 72 the standard pr
1420: 6f 6d 70 74 73 0a 25 71 75 69 74 20 20 20 20 20 ompts.%quit
1430: 20 20 20 20 20 20 20 20 20 20 20 20 20 45 78 69 Exi
1440: 74 20 74 68 69 73 20 70 72 6f 67 72 61 6d 0a 25 t this program.%
1450: 72 65 61 64 20 46 49 4c 45 4e 41 4d 45 20 20 20 read FILENAME
1460: 20 20 20 20 20 20 45 78 65 63 75 74 65 20 53 51 Execute SQ
1470: 4c 20 69 6e 20 46 49 4c 45 4e 41 4d 45 0a 25 72 L in FILENAME.%r
1480: 65 73 74 6f 72 65 20 3f 44 42 3f 20 46 49 4c 45 estore ?DB? FILE
1490: 20 20 20 20 20 52 65 73 74 6f 72 65 20 63 6f 6e Restore con
14a0: 74 65 6e 74 20 6f 66 20 44 42 20 28 64 65 66 61 tent of DB (defa
14b0: 75 6c 74 20 22 6d 61 69 6e 22 29 20 66 72 6f 6d ult "main") from
14c0: 20 46 49 4c 45 0a 25 73 61 76 65 20 46 49 4c 45 FILE.%save FILE
14d0: 20 20 20 20 20 20 20 20 20 20 20 20 20 57 72 69 Wri
14e0: 74 65 20 69 6e 2d 6d 65 6d 6f 72 79 20 64 61 74 te in-memory dat
14f0: 61 62 61 73 65 20 69 6e 74 6f 20 46 49 4c 45 0a abase into FILE.
1500: 25 73 63 68 65 6d 61 20 3f 54 41 42 4c 45 3f 20 %schema ?TABLE?
1510: 20 20 20 20 20 20 20 53 68 6f 77 20 74 68 65 20 Show the
1520: 43 52 45 41 54 45 20 73 74 61 74 65 6d 65 6e 74 CREATE statement
1530: 73 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 s.
1540: 20 20 20 20 20 20 20 20 20 20 20 49 66 20 54 41 If TA
1550: 42 4c 45 20 73 70 65 63 69 66 69 65 64 2c 20 6f BLE specified, o
1560: 6e 6c 79 20 73 68 6f 77 20 74 61 62 6c 65 73 20 nly show tables
1570: 6d 61 74 63 68 69 6e 67 0a 20 20 20 20 20 20 20 matching.
1580: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
1590: 20 20 4c 49 4b 45 20 70 61 74 74 65 72 6e 20 54 LIKE pattern T
15a0: 41 42 4c 45 2e 0a 25 73 65 70 61 72 61 74 6f 72 ABLE..%separator
15b0: 20 53 54 52 49 4e 47 20 3f 4e 4c 3f 20 43 68 61 STRING ?NL? Cha
15c0: 6e 67 65 20 73 65 70 61 72 61 74 6f 72 20 75 73 nge separator us
15d0: 65 64 20 62 79 20 6f 75 74 70 75 74 20 6d 6f 64 ed by output mod
15e0: 65 20 61 6e 64 20 2e 69 6d 70 6f 72 74 0a 20 20 e and .import.
15f0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
1600: 20 20 20 20 20 20 20 4e 4c 20 69 73 20 74 68 65 NL is the
1610: 20 65 6e 64 2d 6f 66 2d 6c 69 6e 65 20 6d 61 72 end-of-line mar
1620: 6b 20 66 6f 72 20 43 53 56 0a 25 73 68 65 6c 6c k for CSV.%shell
1630: 20 43 4d 44 20 41 52 47 53 2e 2e 2e 20 20 20 20 CMD ARGS...
1640: 20 52 75 6e 20 43 4d 44 20 41 52 47 53 2e 2e 2e Run CMD ARGS...
1650: 20 69 6e 20 61 20 73 79 73 74 65 6d 20 73 68 65 in a system she
1660: 6c 6c 0a 25 73 68 6f 77 20 20 20 20 20 20 20 20 ll.%show
1670: 20 20 20 20 20 20 20 20 20 20 53 68 6f 77 20 74 Show t
1680: 68 65 20 63 75 72 72 65 6e 74 20 76 61 6c 75 65 he current value
1690: 73 20 66 6f 72 20 76 61 72 69 6f 75 73 20 73 65 s for various se
16a0: 74 74 69 6e 67 73 0a 25 73 74 61 74 73 20 6f 6e ttings.%stats on
16b0: 7c 6f 66 66 20 20 20 20 20 20 20 20 20 20 54 75 |off Tu
16c0: 72 6e 20 73 74 61 74 73 20 6f 6e 20 6f 72 20 6f rn stats on or o
16d0: 66 66 0a 25 73 79 73 74 65 6d 20 43 4d 44 20 41 ff.%system CMD A
16e0: 52 47 53 2e 2e 2e 20 20 20 20 52 75 6e 20 43 4d RGS... Run CM
16f0: 44 20 41 52 47 53 2e 2e 2e 20 69 6e 20 61 20 73 D ARGS... in a s
1700: 79 73 74 65 6d 20 73 68 65 6c 6c 0a 25 74 61 62 ystem shell.%tab
1710: 6c 65 73 20 3f 54 41 42 4c 45 3f 20 20 20 20 20 les ?TABLE?
1720: 20 20 20 4c 69 73 74 20 6e 61 6d 65 73 20 6f 66 List names of
1730: 20 74 61 62 6c 65 73 0a 20 20 20 20 20 20 20 20 tables.
1740: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
1750: 20 49 66 20 54 41 42 4c 45 20 73 70 65 63 69 66 If TABLE specif
1760: 69 65 64 2c 20 6f 6e 6c 79 20 6c 69 73 74 20 74 ied, only list t
1770: 61 62 6c 65 73 20 6d 61 74 63 68 69 6e 67 0a 20 ables matching.
1780: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
1790: 20 20 20 20 20 20 20 20 4c 49 4b 45 20 70 61 74 LIKE pat
17a0: 74 65 72 6e 20 54 41 42 4c 45 2e 0a 25 74 69 6d tern TABLE..%tim
17b0: 65 6f 75 74 20 4d 53 20 20 20 20 20 20 20 20 20 eout MS
17c0: 20 20 20 54 72 79 20 6f 70 65 6e 69 6e 67 20 6c Try opening l
17d0: 6f 63 6b 65 64 20 74 61 62 6c 65 73 20 66 6f 72 ocked tables for
17e0: 20 4d 53 20 6d 69 6c 6c 69 73 65 63 6f 6e 64 73 MS milliseconds
17f0: 0a 25 74 69 6d 65 72 20 6f 6e 7c 6f 66 66 20 20 .%timer on|off
1800: 20 20 20 20 20 20 20 20 54 75 72 6e 20 53 51 4c Turn SQL
1810: 20 74 69 6d 65 72 20 6f 6e 20 6f 72 20 6f 66 66 timer on or off
1820: 0a 25 74 72 61 63 65 20 46 49 4c 45 7c 6f 66 66 .%trace FILE|off
1830: 20 20 20 20 20 20 20 20 4f 75 74 70 75 74 20 65 Output e
1840: 61 63 68 20 53 51 4c 20 73 74 61 74 65 6d 65 6e ach SQL statemen
1850: 74 20 61 73 20 69 74 20 69 73 20 72 75 6e 0a 25 t as it is run.%
1860: 76 66 73 6e 61 6d 65 20 3f 41 55 58 3f 20 20 20 vfsname ?AUX?
1870: 20 20 20 20 20 20 50 72 69 6e 74 20 74 68 65 20 Print the
1880: 6e 61 6d 65 20 6f 66 20 74 68 65 20 56 46 53 20 name of the VFS
1890: 73 74 61 63 6b 0a 25 77 69 64 74 68 20 4e 55 4d stack.%width NUM
18a0: 31 20 4e 55 4d 32 20 2e 2e 2e 20 20 20 53 65 74 1 NUM2 ... Set
18b0: 20 63 6f 6c 75 6d 6e 20 77 69 64 74 68 73 20 66 column widths f
18c0: 6f 72 20 22 63 6f 6c 75 6d 6e 22 20 6d 6f 64 65 or "column" mode
18d0: 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .
18e0: 20 20 20 20 20 20 20 20 20 20 4e 65 67 61 74 69 Negati
18f0: 76 65 20 76 61 6c 75 65 73 20 72 69 67 68 74 2d ve values right-
1900: 6a 75 73 74 69 66 79 0a 73 71 6c 69 74 65 3e 0a justify.sqlite>.
1910: 2e 73 70 0a 2e 66 69 0a 2e 53 48 20 4f 50 54 49 .sp..fi..SH OPTI
1920: 4f 4e 53 0a 2e 42 20 73 71 6c 69 74 65 33 0a 68 ONS..B sqlite3.h
1930: 61 73 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 as the following
1940: 20 6f 70 74 69 6f 6e 73 3a 0a 2e 54 50 0a 2e 42 options:..TP..B
1950: 20 5c 2d 62 61 69 6c 0a 53 74 6f 70 20 61 66 74 \-bail.Stop aft
1960: 65 72 20 68 69 74 74 69 6e 67 20 61 6e 20 65 72 er hitting an er
1970: 72 6f 72 2e 0a 2e 54 50 0a 2e 42 20 5c 2d 62 61 ror...TP..B \-ba
1980: 74 63 68 0a 46 6f 72 63 65 20 62 61 74 63 68 20 tch.Force batch
1990: 49 2f 4f 2e 0a 2e 54 50 0a 2e 42 20 5c 2d 63 6f I/O...TP..B \-co
19a0: 6c 75 6d 6e 0a 51 75 65 72 79 20 72 65 73 75 6c lumn.Query resul
19b0: 74 73 20 77 69 6c 6c 20 62 65 20 64 69 73 70 6c ts will be displ
19c0: 61 79 65 64 20 69 6e 20 61 20 74 61 62 6c 65 20 ayed in a table
19d0: 6c 69 6b 65 20 66 6f 72 6d 2c 20 75 73 69 6e 67 like form, using
19e0: 0a 77 68 69 74 65 73 70 61 63 65 20 63 68 61 72 .whitespace char
19f0: 61 63 74 65 72 73 20 74 6f 20 73 65 70 61 72 61 acters to separa
1a00: 74 65 20 74 68 65 20 63 6f 6c 75 6d 6e 73 20 61 te the columns a
1a10: 6e 64 20 61 6c 69 67 6e 20 74 68 65 0a 6f 75 74 nd align the.out
1a20: 70 75 74 2e 0a 2e 54 50 0a 2e 42 49 20 5c 2d 63 put...TP..BI \-c
1a30: 6d 64 5c 20 20 63 6f 6d 6d 61 6e 64 0a 72 75 6e md\ command.run
1a40: 0a 2e 49 20 63 6f 6d 6d 61 6e 64 0a 62 65 66 6f ..I command.befo
1a50: 72 65 20 72 65 61 64 69 6e 67 20 73 74 64 69 6e re reading stdin
1a60: 0a 2e 54 50 0a 2e 42 20 5c 2d 63 73 76 0a 53 65 ..TP..B \-csv.Se
1a70: 74 20 6f 75 74 70 75 74 20 6d 6f 64 65 20 74 6f t output mode to
1a80: 20 43 53 56 20 28 63 6f 6d 6d 61 20 73 65 70 61 CSV (comma sepa
1a90: 72 61 74 65 64 20 76 61 6c 75 65 73 29 2e 0a 2e rated values)...
1aa0: 54 50 0a 2e 42 20 5c 2d 65 63 68 6f 0a 50 72 69 TP..B \-echo.Pri
1ab0: 6e 74 20 63 6f 6d 6d 61 6e 64 73 20 62 65 66 6f nt commands befo
1ac0: 72 65 20 65 78 65 63 75 74 69 6f 6e 2e 0a 2e 54 re execution...T
1ad0: 50 0a 2e 42 49 20 5c 2d 69 6e 69 74 5c 20 20 66 P..BI \-init\ f
1ae0: 69 6c 65 0a 52 65 61 64 20 61 6e 64 20 65 78 65 ile.Read and exe
1af0: 63 75 74 65 20 63 6f 6d 6d 61 6e 64 73 20 66 72 cute commands fr
1b00: 6f 6d 0a 2e 49 20 66 69 6c 65 0a 2c 20 77 68 69 om..I file., whi
1b10: 63 68 20 63 61 6e 20 63 6f 6e 74 61 69 6e 20 61 ch can contain a
1b20: 20 6d 69 78 20 6f 66 20 53 51 4c 20 73 74 61 74 mix of SQL stat
1b30: 65 6d 65 6e 74 73 20 61 6e 64 20 6d 65 74 61 2d ements and meta-
1b40: 63 6f 6d 6d 61 6e 64 73 2e 0a 2e 54 50 0a 2e 42 commands...TP..B
1b50: 20 5c 2d 5b 6e 6f 5d 68 65 61 64 65 72 0a 54 75 \-[no]header.Tu
1b60: 72 6e 20 68 65 61 64 65 72 73 20 6f 6e 20 6f 72 rn headers on or
1b70: 20 6f 66 66 2e 0a 2e 54 50 0a 2e 42 20 5c 2d 68 off...TP..B \-h
1b80: 65 6c 70 0a 53 68 6f 77 20 68 65 6c 70 20 6f 6e elp.Show help on
1b90: 20 6f 70 74 69 6f 6e 73 20 61 6e 64 20 65 78 69 options and exi
1ba0: 74 2e 0a 2e 54 50 0a 2e 42 20 5c 2d 68 74 6d 6c t...TP..B \-html
1bb0: 0a 51 75 65 72 79 20 72 65 73 75 6c 74 73 20 77 .Query results w
1bc0: 69 6c 6c 20 62 65 20 6f 75 74 70 75 74 20 61 73 ill be output as
1bd0: 20 73 69 6d 70 6c 65 20 48 54 4d 4c 20 74 61 62 simple HTML tab
1be0: 6c 65 73 2e 0a 2e 54 50 0a 2e 42 20 5c 2d 69 6e les...TP..B \-in
1bf0: 74 65 72 61 63 74 69 76 65 0a 46 6f 72 63 65 20 teractive.Force
1c00: 69 6e 74 65 72 61 63 74 69 76 65 20 49 2f 4f 2e interactive I/O.
1c10: 0a 2e 54 50 0a 2e 42 20 5c 2d 6c 69 6e 65 0a 51 ..TP..B \-line.Q
1c20: 75 65 72 79 20 72 65 73 75 6c 74 73 20 77 69 6c uery results wil
1c30: 6c 20 62 65 20 64 69 73 70 6c 61 79 65 64 20 77 l be displayed w
1c40: 69 74 68 20 6f 6e 65 20 76 61 6c 75 65 20 70 65 ith one value pe
1c50: 72 20 6c 69 6e 65 2c 20 72 6f 77 73 0a 73 65 70 r line, rows.sep
1c60: 61 72 61 74 65 64 20 62 79 20 61 20 62 6c 61 6e arated by a blan
1c70: 6b 20 6c 69 6e 65 2e 20 20 44 65 73 69 67 6e 65 k line. Designe
1c80: 64 20 74 6f 20 62 65 20 65 61 73 69 6c 79 20 70 d to be easily p
1c90: 61 72 73 65 64 20 62 79 0a 73 63 72 69 70 74 73 arsed by.scripts
1ca0: 20 6f 72 20 6f 74 68 65 72 20 70 72 6f 67 72 61 or other progra
1cb0: 6d 73 0a 2e 54 50 0a 2e 42 20 5c 2d 6c 69 73 74 ms..TP..B \-list
1cc0: 0a 51 75 65 72 79 20 72 65 73 75 6c 74 73 20 77 .Query results w
1cd0: 69 6c 6c 20 62 65 20 64 69 73 70 6c 61 79 65 64 ill be displayed
1ce0: 20 77 69 74 68 20 74 68 65 20 73 65 70 61 72 61 with the separa
1cf0: 74 6f 72 20 28 7c 2c 20 62 79 20 64 65 66 61 75 tor (|, by defau
1d00: 6c 74 29 0a 63 68 61 72 61 63 74 65 72 20 62 65 lt).character be
1d10: 74 77 65 65 6e 20 65 61 63 68 20 66 69 65 6c 64 tween each field
1d20: 20 76 61 6c 75 65 2e 20 20 54 68 65 20 64 65 66 value. The def
1d30: 61 75 6c 74 2e 0a 2e 54 50 0a 2e 42 49 20 5c 2d ault...TP..BI \-
1d40: 6d 6d 61 70 5c 20 20 4e 0a 53 65 74 20 64 65 66 mmap\ N.Set def
1d50: 61 75 6c 74 20 6d 6d 61 70 20 73 69 7a 65 20 74 ault mmap size t
1d60: 6f 0a 2e 49 20 4e 0a 5c 2e 0a 2e 54 50 0a 2e 42 o..I N.\...TP..B
1d70: 49 20 5c 2d 6e 75 6c 6c 76 61 6c 75 65 5c 20 20 I \-nullvalue\
1d80: 73 74 72 69 6e 67 0a 53 65 74 20 73 74 72 69 6e string.Set strin
1d90: 67 20 75 73 65 64 20 74 6f 20 72 65 70 72 65 73 g used to repres
1da0: 65 6e 74 20 4e 55 4c 4c 20 76 61 6c 75 65 73 2e ent NULL values.
1db0: 20 20 44 65 66 61 75 6c 74 20 69 73 20 27 27 0a Default is ''.
1dc0: 28 65 6d 70 74 79 20 73 74 72 69 6e 67 29 2e 0a (empty string)..
1dd0: 2e 54 50 0a 2e 42 49 20 5c 2d 73 65 70 61 72 61 .TP..BI \-separa
1de0: 74 6f 72 5c 20 20 73 65 70 61 72 61 74 6f 72 0a tor\ separator.
1df0: 53 65 74 20 6f 75 74 70 75 74 20 66 69 65 6c 64 Set output field
1e00: 20 73 65 70 61 72 61 74 6f 72 2e 20 20 44 65 66 separator. Def
1e10: 61 75 6c 74 20 69 73 20 27 7c 27 2e 0a 2e 54 50 ault is '|'...TP
1e20: 0a 2e 42 20 5c 2d 73 74 61 74 73 0a 50 72 69 6e ..B \-stats.Prin
1e30: 74 20 6d 65 6d 6f 72 79 20 73 74 61 74 73 20 62 t memory stats b
1e40: 65 66 6f 72 65 20 65 61 63 68 20 66 69 6e 61 6c efore each final
1e50: 69 7a 65 2e 0a 2e 54 50 0a 2e 42 20 5c 2d 76 65 ize...TP..B \-ve
1e60: 72 73 69 6f 6e 0a 53 68 6f 77 20 53 51 4c 69 74 rsion.Show SQLit
1e70: 65 20 76 65 72 73 69 6f 6e 2e 0a 2e 54 50 0a 2e e version...TP..
1e80: 42 49 20 5c 2d 76 66 73 5c 20 20 6e 61 6d 65 0a BI \-vfs\ name.
1e90: 55 73 65 0a 2e 49 20 6e 61 6d 65 0a 61 73 20 74 Use..I name.as t
1ea0: 68 65 20 64 65 66 61 75 6c 74 20 56 46 53 2e 0a he default VFS..
1eb0: 0a 0a 2e 53 48 20 49 4e 49 54 20 46 49 4c 45 0a ...SH INIT FILE.
1ec0: 2e 42 20 73 71 6c 69 74 65 33 0a 72 65 61 64 73 .B sqlite3.reads
1ed0: 20 61 6e 20 69 6e 69 74 69 61 6c 69 7a 61 74 69 an initializati
1ee0: 6f 6e 20 66 69 6c 65 20 74 6f 20 73 65 74 20 74 on file to set t
1ef0: 68 65 20 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e he configuration
1f00: 20 6f 66 20 74 68 65 0a 69 6e 74 65 72 61 63 74 of the.interact
1f10: 69 76 65 20 65 6e 76 69 72 6f 6e 6d 65 6e 74 2e ive environment.
1f20: 20 20 54 68 72 6f 75 67 68 6f 75 74 20 69 6e 69 Throughout ini
1f30: 74 69 61 6c 69 7a 61 74 69 6f 6e 2c 20 61 6e 79 tialization, any
1f40: 20 70 72 65 76 69 6f 75 73 6c 79 0a 73 70 65 63 previously.spec
1f50: 69 66 69 65 64 20 73 65 74 74 69 6e 67 20 63 61 ified setting ca
1f60: 6e 20 62 65 20 6f 76 65 72 72 69 64 64 65 6e 2e n be overridden.
1f70: 20 20 54 68 65 20 73 65 71 75 65 6e 63 65 20 6f The sequence o
1f80: 66 20 69 6e 69 74 69 61 6c 69 7a 61 74 69 6f 6e f initialization
1f90: 20 69 73 0a 61 73 20 66 6f 6c 6c 6f 77 73 3a 0a is.as follows:.
1fa0: 0a 6f 20 54 68 65 20 64 65 66 61 75 6c 74 20 63 .o The default c
1fb0: 6f 6e 66 69 67 75 72 61 74 69 6f 6e 20 69 73 20 onfiguration is
1fc0: 65 73 74 61 62 6c 69 73 68 65 64 20 61 73 20 66 established as f
1fd0: 6f 6c 6c 6f 77 73 3a 0a 0a 2e 73 70 0a 2e 6e 66 ollows:...sp..nf
1fe0: 0a 2e 63 63 20 7c 0a 6d 6f 64 65 20 20 20 20 20 ..cc |.mode
1ff0: 20 20 20 20 20 20 20 3d 20 4c 49 53 54 0a 73 65 = LIST.se
2000: 70 61 72 61 74 6f 72 20 20 20 20 20 20 20 3d 20 parator =
2010: 22 7c 22 0a 6d 61 69 6e 20 70 72 6f 6d 70 74 20 "|".main prompt
2020: 20 20 20 20 3d 20 22 73 71 6c 69 74 65 3e 20 22 = "sqlite> "
2030: 0a 63 6f 6e 74 69 6e 75 65 20 70 72 6f 6d 70 74 .continue prompt
2040: 20 3d 20 22 20 20 20 2e 2e 2e 3e 20 22 0a 7c 63 = " ...> ".|c
2050: 63 20 2e 0a 2e 73 70 0a 2e 66 69 0a 0a 6f 20 49 c ...sp..fi..o I
2060: 66 20 74 68 65 20 66 69 6c 65 20 0a 2e 42 20 7e f the file ..B ~
2070: 2f 2e 73 71 6c 69 74 65 72 63 0a 65 78 69 73 74 /.sqliterc.exist
2080: 73 2c 20 69 74 20 69 73 20 70 72 6f 63 65 73 73 s, it is process
2090: 65 64 20 66 69 72 73 74 2e 0a 63 61 6e 20 62 65 ed first..can be
20a0: 20 66 6f 75 6e 64 20 69 6e 20 74 68 65 20 75 73 found in the us
20b0: 65 72 27 73 20 68 6f 6d 65 20 64 69 72 65 63 74 er's home direct
20c0: 6f 72 79 2c 20 69 74 20 69 73 0a 72 65 61 64 20 ory, it is.read
20d0: 61 6e 64 20 70 72 6f 63 65 73 73 65 64 2e 20 20 and processed.
20e0: 49 74 20 73 68 6f 75 6c 64 20 67 65 6e 65 72 61 It should genera
20f0: 6c 6c 79 20 6f 6e 6c 79 20 63 6f 6e 74 61 69 6e lly only contain
2100: 20 6d 65 74 61 2d 63 6f 6d 6d 61 6e 64 73 2e 0a meta-commands..
2110: 0a 6f 20 49 66 20 74 68 65 20 2d 69 6e 69 74 20 .o If the -init
2120: 6f 70 74 69 6f 6e 20 69 73 20 70 72 65 73 65 6e option is presen
2130: 74 2c 20 74 68 65 20 73 70 65 63 69 66 69 65 64 t, the specified
2140: 20 66 69 6c 65 20 69 73 20 70 72 6f 63 65 73 73 file is process
2150: 65 64 2e 0a 0a 6f 20 41 6c 6c 20 6f 74 68 65 72 ed...o All other
2160: 20 63 6f 6d 6d 61 6e 64 20 6c 69 6e 65 20 6f 70 command line op
2170: 74 69 6f 6e 73 20 61 72 65 20 70 72 6f 63 65 73 tions are proces
2180: 73 65 64 2e 0a 0a 2e 53 48 20 53 45 45 20 41 4c sed....SH SEE AL
2190: 53 4f 0a 68 74 74 70 3a 2f 2f 77 77 77 2e 73 71 SO.http://www.sq
21a0: 6c 69 74 65 2e 6f 72 67 2f 63 6c 69 2e 68 74 6d lite.org/cli.htm
21b0: 6c 0a 2e 62 72 0a 54 68 65 20 73 71 6c 69 74 65 l..br.The sqlite
21c0: 33 2d 64 6f 63 20 70 61 63 6b 61 67 65 2e 0a 2e 3-doc package...
21d0: 53 48 20 41 55 54 48 4f 52 0a 54 68 69 73 20 6d SH AUTHOR.This m
21e0: 61 6e 75 61 6c 20 70 61 67 65 20 77 61 73 20 6f anual page was o
21f0: 72 69 67 69 6e 61 6c 6c 79 20 77 72 69 74 74 65 riginally writte
2200: 6e 20 62 79 20 41 6e 64 72 65 61 73 20 52 6f 74 n by Andreas Rot
2210: 74 6d 61 6e 6e 0a 3c 72 6f 74 74 79 40 64 65 62 tmann.<rotty@deb
2220: 69 61 6e 2e 6f 72 67 3e 2c 20 66 6f 72 20 74 68 ian.org>, for th
2230: 65 20 44 65 62 69 61 6e 20 47 4e 55 2f 4c 69 6e e Debian GNU/Lin
2240: 75 78 20 73 79 73 74 65 6d 20 28 62 75 74 20 6d ux system (but m
2250: 61 79 20 62 65 20 75 73 65 64 0a 62 79 20 6f 74 ay be used.by ot
2260: 68 65 72 73 29 2e 20 49 74 20 77 61 73 20 73 75 hers). It was su
2270: 62 73 65 71 75 65 6e 74 6c 79 20 72 65 76 69 73 bsequently revis
2280: 65 64 20 62 79 20 42 69 6c 6c 20 42 75 6d 67 61 ed by Bill Bumga
2290: 72 6e 65 72 20 3c 62 62 75 6d 40 6d 61 63 2e 63 rner <bbum@mac.c
22a0: 6f 6d 3e 20 61 6e 64 0a 66 75 72 74 68 65 72 20 om> and.further
22b0: 75 70 64 61 74 65 64 20 62 79 20 4c 61 73 7a 6c updated by Laszl
22c0: 6f 20 42 6f 73 7a 6f 72 6d 65 6e 79 69 20 3c 67 o Boszormenyi <g
22d0: 63 73 40 64 65 62 69 61 6e 2e 68 75 3e 20 2e 0a cs@debian.hu> ..