Documentation Source Text

Hex Artifact Content
Login

Artifact dcc7b088c6d63d3cee06bb019d9a213dd9112b173fe8d4ec89ac5b0f956f0d4d:


0000: 3c 74 63 6c 3e 68 64 5f 6b 65 79 77 6f 72 64 73  <tcl>hd_keywords
0010: 20 2a 61 70 70 66 6f 72 6d 61 74 20 7b 61 70 70   *appformat {app
0020: 6c 69 63 61 74 69 6f 6e 20 66 69 6c 65 2d 66 6f  lication file-fo
0030: 72 6d 61 74 7d 20 5c 0a 20 20 20 20 20 7b 41 70  rmat} \.     {Ap
0040: 70 6c 69 63 61 74 69 6f 6e 20 46 69 6c 65 20 46  plication File F
0050: 6f 72 6d 61 74 7d 20 7b 61 70 70 6c 69 63 61 74  ormat} {applicat
0060: 69 6f 6e 20 66 69 6c 65 20 66 6f 72 6d 61 74 7d  ion file format}
0070: 3c 2f 74 63 6c 3e 0a 3c 74 69 74 6c 65 3e 53 51  </tcl>.<title>SQ
0080: 4c 69 74 65 20 41 73 20 41 6e 20 41 70 70 6c 69  Lite As An Appli
0090: 63 61 74 69 6f 6e 20 46 69 6c 65 20 46 6f 72 6d  cation File Form
00a0: 61 74 3c 2f 74 69 74 6c 65 3e 0a 0a 3c 68 31 20  at</title>..<h1 
00b0: 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 0a  align="center">.
00c0: 53 51 4c 69 74 65 20 41 73 20 41 6e 20 41 70 70  SQLite As An App
00d0: 6c 69 63 61 74 69 6f 6e 20 46 69 6c 65 20 46 6f  lication File Fo
00e0: 72 6d 61 74 0a 3c 2f 68 31 3e 0a 0a 3c 68 32 3e  rmat.</h1>..<h2>
00f0: 45 78 65 63 75 74 69 76 65 20 53 75 6d 6d 61 72  Executive Summar
0100: 79 3c 2f 68 32 3e 0a 0a 3c 70 3e 41 6e 20 53 51  y</h2>..<p>An SQ
0110: 4c 69 74 65 20 64 61 74 61 62 61 73 65 20 66 69  Lite database fi
0120: 6c 65 20 77 69 74 68 20 61 20 64 65 66 69 6e 65  le with a define
0130: 64 20 73 63 68 65 6d 61 0a 6f 66 74 65 6e 20 6d  d schema.often m
0140: 61 6b 65 73 20 61 6e 20 65 78 63 65 6c 6c 65 6e  akes an excellen
0150: 74 20 61 70 70 6c 69 63 61 74 69 6f 6e 20 66 69  t application fi
0160: 6c 65 20 66 6f 72 6d 61 74 2e 0a 48 65 72 65 20  le format..Here 
0170: 61 72 65 20 61 20 64 6f 7a 65 6e 20 72 65 61 73  are a dozen reas
0180: 6f 6e 73 20 77 68 79 20 74 68 69 73 20 69 73 20  ons why this is 
0190: 73 6f 3a 0a 0a 3c 6f 6c 3e 0a 3c 6c 69 3e 20 53  so:..<ol>.<li> S
01a0: 69 6d 70 6c 69 66 69 65 64 20 41 70 70 6c 69 63  implified Applic
01b0: 61 74 69 6f 6e 20 44 65 76 65 6c 6f 70 6d 65 6e  ation Developmen
01c0: 74 0a 3c 6c 69 3e 20 53 69 6e 67 6c 65 2d 46 69  t.<li> Single-Fi
01d0: 6c 65 20 44 6f 63 75 6d 65 6e 74 73 0a 3c 6c 69  le Documents.<li
01e0: 3e 20 48 69 67 68 2d 4c 65 76 65 6c 20 51 75 65  > High-Level Que
01f0: 72 79 20 4c 61 6e 67 75 61 67 65 0a 3c 6c 69 3e  ry Language.<li>
0200: 20 41 63 63 65 73 73 69 62 6c 65 20 43 6f 6e 74   Accessible Cont
0210: 65 6e 74 0a 3c 6c 69 3e 20 43 72 6f 73 73 2d 50  ent.<li> Cross-P
0220: 6c 61 74 66 6f 72 6d 0a 3c 6c 69 3e 20 41 74 6f  latform.<li> Ato
0230: 6d 69 63 20 54 72 61 6e 73 61 63 74 69 6f 6e 73  mic Transactions
0240: 0a 3c 6c 69 3e 20 49 6e 63 72 65 6d 65 6e 74 61  .<li> Incrementa
0250: 6c 20 41 6e 64 20 43 6f 6e 74 69 6e 75 6f 75 73  l And Continuous
0260: 20 55 70 64 61 74 65 73 0a 3c 6c 69 3e 20 45 61   Updates.<li> Ea
0270: 73 69 6c 79 20 45 78 74 65 6e 73 69 62 6c 65 0a  sily Extensible.
0280: 3c 6c 69 3e 20 50 65 72 66 6f 72 6d 61 6e 63 65  <li> Performance
0290: 0a 3c 6c 69 3e 20 43 6f 6e 63 75 72 72 65 6e 74  .<li> Concurrent
02a0: 20 55 73 65 20 42 79 20 4d 75 6c 74 69 70 6c 65   Use By Multiple
02b0: 20 50 72 6f 63 65 73 73 65 73 0a 3c 6c 69 3e 20   Processes.<li> 
02c0: 4d 75 6c 74 69 70 6c 65 20 50 72 6f 67 72 61 6d  Multiple Program
02d0: 6d 69 6e 67 20 4c 61 6e 67 75 61 67 65 73 0a 3c  ming Languages.<
02e0: 6c 69 3e 20 42 65 74 74 65 72 20 41 70 70 6c 69  li> Better Appli
02f0: 63 61 74 69 6f 6e 73 0a 3c 2f 6f 6c 3e 0a 0a 3c  cations.</ol>..<
0300: 70 3e 45 61 63 68 20 6f 66 20 74 68 65 73 65 20  p>Each of these 
0310: 70 6f 69 6e 74 73 20 77 69 6c 6c 20 62 65 20 64  points will be d
0320: 65 73 63 72 69 62 65 64 20 69 6e 20 6d 6f 72 65  escribed in more
0330: 20 64 65 74 61 69 6c 20 62 65 6c 6f 77 2c 0a 61   detail below,.a
0340: 66 74 65 72 20 66 69 72 73 74 20 63 6f 6e 73 69  fter first consi
0350: 64 65 72 69 6e 67 20 6d 6f 72 65 20 63 6c 6f 73  dering more clos
0360: 65 6c 79 20 74 68 65 20 6d 65 61 6e 69 6e 67 20  ely the meaning 
0370: 6f 66 0a 22 61 70 70 6c 69 63 61 74 69 6f 6e 20  of."application 
0380: 66 69 6c 65 20 66 6f 72 6d 61 74 22 2e 20 20 53  file format".  S
0390: 65 65 20 61 6c 73 6f 20 74 68 65 20 5b 61 66 66  ee also the [aff
03a0: 73 68 6f 72 74 7c 73 68 6f 72 74 20 76 65 72 73  short|short vers
03b0: 69 6f 6e 5d 20 6f 66 20 74 68 69 73 0a 77 68 69  ion] of this.whi
03c0: 74 65 70 61 70 65 72 2e 0a 0a 3c 68 32 3e 57 68  tepaper...<h2>Wh
03d0: 61 74 20 49 73 20 41 6e 20 41 70 70 6c 69 63 61  at Is An Applica
03e0: 74 69 6f 6e 20 46 69 6c 65 20 46 6f 72 6d 61 74  tion File Format
03f0: 3f 3c 2f 68 32 3e 0a 0a 3c 70 3e 0a 41 6e 20 22  ?</h2>..<p>.An "
0400: 61 70 70 6c 69 63 61 74 69 6f 6e 20 66 69 6c 65  application file
0410: 20 66 6f 72 6d 61 74 22 20 69 73 20 74 68 65 20   format" is the 
0420: 66 69 6c 65 20 66 6f 72 6d 61 74 0a 75 73 65 64  file format.used
0430: 20 74 6f 20 70 65 72 73 69 73 74 20 61 70 70 6c   to persist appl
0440: 69 63 61 74 69 6f 6e 20 73 74 61 74 65 20 74 6f  ication state to
0450: 20 64 69 73 6b 20 6f 72 20 74 6f 20 65 78 63 68   disk or to exch
0460: 61 6e 67 65 0a 69 6e 66 6f 72 6d 61 74 69 6f 6e  ange.information
0470: 20 62 65 74 77 65 65 6e 20 70 72 6f 67 72 61 6d   between program
0480: 73 2e 0a 54 68 65 72 65 20 61 72 65 20 74 68 6f  s..There are tho
0490: 75 73 61 6e 64 73 20 6f 66 20 61 70 70 6c 69 63  usands of applic
04a0: 61 74 69 6f 6e 20 66 69 6c 65 20 66 6f 72 6d 61  ation file forma
04b0: 74 73 20 69 6e 20 75 73 65 20 74 6f 64 61 79 2e  ts in use today.
04c0: 0a 48 65 72 65 20 61 72 65 20 6a 75 73 74 20 61  .Here are just a
04d0: 20 66 65 77 20 65 78 61 6d 70 6c 65 73 3a 0a 0a   few examples:..
04e0: 3c 75 6c 3e 0a 3c 6c 69 3e 44 4f 43 20 2d 20 57  <ul>.<li>DOC - W
04f0: 6f 72 64 20 50 65 72 66 65 63 74 20 61 6e 64 20  ord Perfect and 
0500: 4d 69 63 72 6f 73 6f 66 74 20 4f 66 66 69 63 65  Microsoft Office
0510: 20 64 6f 63 75 6d 65 6e 74 73 0a 3c 6c 69 3e 44   documents.<li>D
0520: 57 47 20 2d 20 41 75 74 6f 43 41 44 20 64 72 61  WG - AutoCAD dra
0530: 77 69 6e 67 73 0a 3c 6c 69 3e 50 44 46 20 2d 20  wings.<li>PDF - 
0540: 50 6f 72 74 61 62 6c 65 20 44 6f 63 75 6d 65 6e  Portable Documen
0550: 74 20 46 6f 72 6d 61 74 20 66 72 6f 6d 20 41 64  t Format from Ad
0560: 6f 62 65 0a 3c 6c 69 3e 58 4c 53 20 2d 20 4d 69  obe.<li>XLS - Mi
0570: 63 72 6f 73 6f 66 74 20 45 78 63 65 6c 20 53 70  crosoft Excel Sp
0580: 72 65 61 64 73 68 65 65 74 0a 3c 6c 69 3e 47 49  readsheet.<li>GI
0590: 54 20 2d 20 47 69 74 20 73 6f 75 72 63 65 20 63  T - Git source c
05a0: 6f 64 65 20 72 65 70 6f 73 69 74 6f 72 79 0a 3c  ode repository.<
05b0: 6c 69 3e 45 50 55 42 20 2d 20 54 68 65 20 45 6c  li>EPUB - The El
05c0: 65 63 74 72 6f 6e 69 63 20 50 75 62 6c 69 63 61  ectronic Publica
05d0: 74 69 6f 6e 20 66 6f 72 6d 61 74 20 75 73 65 64  tion format used
05e0: 20 62 79 20 6e 6f 6e 2d 4b 69 6e 64 6c 65 20 65   by non-Kindle e
05f0: 42 6f 6f 6b 73 0a 3c 6c 69 3e 4f 44 54 20 2d 20  Books.<li>ODT - 
0600: 54 68 65 20 4f 70 65 6e 20 44 6f 63 75 6d 65 6e  The Open Documen
0610: 74 20 66 6f 72 6d 61 74 20 75 73 65 64 20 62 79  t format used by
0620: 20 4f 70 65 6e 4f 66 66 69 63 65 20 61 6e 64 20   OpenOffice and 
0630: 6f 74 68 65 72 73 0a 3c 6c 69 3e 50 50 54 20 2d  others.<li>PPT -
0640: 20 4d 69 63 72 6f 73 6f 66 74 20 50 6f 77 65 72   Microsoft Power
0650: 50 6f 69 6e 74 20 70 72 65 73 65 6e 74 61 74 69  Point presentati
0660: 6f 6e 73 0a 3c 6c 69 3e 4f 44 50 20 2d 20 54 68  ons.<li>ODP - Th
0670: 65 20 4f 70 65 6e 20 44 6f 63 75 6d 65 6e 74 20  e Open Document 
0680: 70 72 65 73 65 6e 74 61 74 69 6f 6e 20 66 6f 72  presentation for
0690: 6d 61 74 20 75 73 65 64 20 62 79 20 4f 70 65 6e  mat used by Open
06a0: 4f 66 66 69 63 65 20 61 6e 64 20 6f 74 68 65 72  Office and other
06b0: 73 0a 3c 2f 75 6c 3e 0a 0a 3c 70 3e 57 65 20 6d  s.</ul>..<p>We m
06c0: 61 6b 65 20 61 20 64 69 73 74 69 6e 63 74 69 6f  ake a distinctio
06d0: 6e 20 62 65 74 77 65 65 6e 20 61 20 22 66 69 6c  n between a "fil
06e0: 65 20 66 6f 72 6d 61 74 22 20 61 6e 64 20 61 6e  e format" and an
06f0: 20 22 61 70 70 6c 69 63 61 74 69 6f 6e 20 66 6f   "application fo
0700: 72 6d 61 74 22 2e 0a 41 20 66 69 6c 65 20 66 6f  rmat"..A file fo
0710: 72 6d 61 74 20 69 73 20 75 73 65 64 20 74 6f 20  rmat is used to 
0720: 73 74 6f 72 65 20 61 20 73 69 6e 67 6c 65 20 6f  store a single o
0730: 62 6a 65 63 74 2e 20 20 53 6f 2c 20 66 6f 72 20  bject.  So, for 
0740: 65 78 61 6d 70 6c 65 2c 20 61 20 47 49 46 20 6f  example, a GIF o
0750: 72 0a 4a 50 45 47 20 66 69 6c 65 20 73 74 6f 72  r.JPEG file stor
0760: 65 73 20 61 20 73 69 6e 67 6c 65 20 69 6d 61 67  es a single imag
0770: 65 2c 20 61 6e 64 20 61 6e 20 58 48 54 4d 4c 20  e, and an XHTML 
0780: 66 69 6c 65 20 73 74 6f 72 65 73 20 74 65 78 74  file stores text
0790: 2c 0a 73 6f 20 74 68 6f 73 65 20 61 72 65 20 22  ,.so those are "
07a0: 66 69 6c 65 20 66 6f 72 6d 61 74 73 22 20 61 6e  file formats" an
07b0: 64 20 6e 6f 74 20 22 61 70 70 6c 69 63 61 74 69  d not "applicati
07c0: 6f 6e 20 66 6f 72 6d 61 74 73 22 2e 20 20 41 6e  on formats".  An
07d0: 20 45 50 55 42 20 66 69 6c 65 2c 20 0a 69 6e 20   EPUB file, .in 
07e0: 63 6f 6e 74 72 61 73 74 2c 20 73 74 6f 72 65 73  contrast, stores
07f0: 20 62 6f 74 68 20 74 65 78 74 20 61 6e 64 20 69   both text and i
0800: 6d 61 67 65 73 20 28 61 73 20 63 6f 6e 74 61 69  mages (as contai
0810: 6e 65 64 20 58 48 54 4d 4c 20 61 6e 64 20 47 49  ned XHTML and GI
0820: 46 2f 4a 50 45 47 0a 66 69 6c 65 73 29 20 61 6e  F/JPEG.files) an
0830: 64 20 73 6f 20 69 74 20 69 73 20 63 6f 6e 73 69  d so it is consi
0840: 64 65 72 65 64 20 61 6e 20 22 61 70 70 6c 69 63  dered an "applic
0850: 61 74 69 6f 6e 20 66 6f 72 6d 61 74 22 2e 20 20  ation format".  
0860: 54 68 69 73 20 61 72 74 69 63 6c 65 20 69 73 0a  This article is.
0870: 61 62 6f 75 74 20 22 61 70 70 6c 69 63 61 74 69  about "applicati
0880: 6f 6e 20 66 6f 72 6d 61 74 73 22 2e 0a 0a 3c 70  on formats"...<p
0890: 3e 54 68 65 20 62 6f 75 6e 64 61 72 79 20 62 65  >The boundary be
08a0: 74 77 65 65 6e 20 61 20 66 69 6c 65 20 66 6f 72  tween a file for
08b0: 6d 61 74 20 61 6e 64 20 61 6e 20 61 70 70 6c 69  mat and an appli
08c0: 63 61 74 69 6f 6e 20 66 6f 72 6d 61 74 20 69 73  cation format is
08d0: 20 66 75 7a 7a 79 2e 0a 54 68 69 73 20 61 72 74   fuzzy..This art
08e0: 69 63 6c 65 20 63 61 6c 6c 73 20 4a 50 45 47 20  icle calls JPEG 
08f0: 61 20 66 69 6c 65 20 66 6f 72 6d 61 74 2c 20 62  a file format, b
0900: 75 74 20 66 6f 72 20 61 6e 20 69 6d 61 67 65 20  ut for an image 
0910: 65 64 69 74 6f 72 2c 20 4a 50 45 47 20 0a 6d 69  editor, JPEG .mi
0920: 67 68 74 20 62 65 20 63 6f 6e 73 69 64 65 72 65  ght be considere
0930: 64 20 74 68 65 20 61 70 70 6c 69 63 61 74 69 6f  d the applicatio
0940: 6e 20 66 6f 72 6d 61 74 2e 20 20 4d 75 63 68 20  n format.  Much 
0950: 64 65 70 65 6e 64 73 20 6f 6e 20 63 6f 6e 74 65  depends on conte
0960: 78 74 2e 0a 46 6f 72 20 74 68 69 73 20 61 72 74  xt..For this art
0970: 69 63 6c 65 2c 20 6c 65 74 20 75 73 20 73 61 79  icle, let us say
0980: 20 74 68 61 74 20 61 20 66 69 6c 65 20 66 6f 72   that a file for
0990: 6d 61 74 20 73 74 6f 72 65 73 20 61 20 73 69 6e  mat stores a sin
09a0: 67 6c 65 20 6f 62 6a 65 63 74 0a 61 6e 64 20 61  gle object.and a
09b0: 6e 20 61 70 70 6c 69 63 61 74 69 6f 6e 20 66 6f  n application fo
09c0: 72 6d 61 74 20 73 74 6f 72 65 73 20 6d 61 6e 79  rmat stores many
09d0: 20 64 69 66 66 65 72 65 6e 74 20 6f 62 6a 65 63   different objec
09e0: 74 73 20 61 6e 64 20 74 68 65 69 72 20 72 65 6c  ts and their rel
09f0: 61 74 69 6f 6e 73 68 69 70 73 0a 74 6f 20 6f 6e  ationships.to on
0a00: 65 20 61 6e 6f 74 68 65 72 2e 0a 0a 3c 70 3e 4d  e another...<p>M
0a10: 6f 73 74 20 61 70 70 6c 69 63 61 74 69 6f 6e 20  ost application 
0a20: 66 6f 72 6d 61 74 73 20 66 69 74 20 69 6e 74 6f  formats fit into
0a30: 20 6f 6e 65 20 6f 66 20 74 68 65 73 65 20 74 68   one of these th
0a40: 72 65 65 20 63 61 74 65 67 6f 72 69 65 73 3a 0a  ree categories:.
0a50: 0a 3c 6f 6c 3e 0a 3c 6c 69 3e 3c 70 3e 3c 62 3e  .<ol>.<li><p><b>
0a60: 46 75 6c 6c 79 20 43 75 73 74 6f 6d 20 46 6f 72  Fully Custom For
0a70: 6d 61 74 73 2e 3c 2f 62 3e 0a 43 75 73 74 6f 6d  mats.</b>.Custom
0a80: 20 66 6f 72 6d 61 74 73 20 61 72 65 20 73 70 65   formats are spe
0a90: 63 69 66 69 63 61 6c 6c 79 20 64 65 73 69 67 6e  cifically design
0aa0: 65 64 20 66 6f 72 20 61 20 73 69 6e 67 6c 65 20  ed for a single 
0ab0: 61 70 70 6c 69 63 61 74 69 6f 6e 2e 0a 44 4f 43  application..DOC
0ac0: 2c 20 44 57 47 2c 20 50 44 46 2c 20 58 4c 53 2c  , DWG, PDF, XLS,
0ad0: 20 61 6e 64 20 50 50 54 20 61 72 65 20 65 78 61   and PPT are exa
0ae0: 6d 70 6c 65 73 20 6f 66 20 63 75 73 74 6f 6d 20  mples of custom 
0af0: 66 6f 72 6d 61 74 73 2e 20 20 43 75 73 74 6f 6d  formats.  Custom
0b00: 0a 66 6f 72 6d 61 74 73 20 61 72 65 20 75 73 75  .formats are usu
0b10: 61 6c 6c 79 20 63 6f 6e 74 61 69 6e 65 64 20 77  ally contained w
0b20: 69 74 68 69 6e 20 61 20 73 69 6e 67 6c 65 20 66  ithin a single f
0b30: 69 6c 65 2c 20 66 6f 72 20 65 61 73 65 20 6f 66  ile, for ease of
0b40: 20 74 72 61 6e 73 70 6f 72 74 2e 0a 54 68 65 79   transport..They
0b50: 20 61 72 65 20 61 6c 73 6f 20 75 73 75 61 6c 6c   are also usuall
0b60: 79 20 62 69 6e 61 72 79 2c 20 74 68 6f 75 67 68  y binary, though
0b70: 20 74 68 65 20 44 57 47 20 66 6f 72 6d 61 74 20   the DWG format 
0b80: 69 73 20 61 20 6e 6f 74 61 62 6c 65 20 65 78 63  is a notable exc
0b90: 65 70 74 69 6f 6e 2e 0a 43 75 73 74 6f 6d 20 66  eption..Custom f
0ba0: 69 6c 65 20 66 6f 72 6d 61 74 73 20 72 65 71 75  ile formats requ
0bb0: 69 72 65 20 73 70 65 63 69 61 6c 69 7a 65 64 20  ire specialized 
0bc0: 61 70 70 6c 69 63 61 74 69 6f 6e 20 63 6f 64 65  application code
0bd0: 0a 74 6f 20 72 65 61 64 20 61 6e 64 20 77 72 69  .to read and wri
0be0: 74 65 20 61 6e 64 20 61 72 65 20 6e 6f 74 20 6e  te and are not n
0bf0: 6f 72 6d 61 6c 6c 79 20 61 63 63 65 73 73 69 62  ormally accessib
0c00: 6c 65 20 66 72 6f 6d 20 63 6f 6d 6d 6f 6e 6c 79  le from commonly
0c10: 0a 61 76 61 69 6c 61 62 6c 65 20 74 6f 6f 6c 73  .available tools
0c20: 20 73 75 63 68 20 61 73 20 75 6e 69 78 20 63 6f   such as unix co
0c30: 6d 6d 61 6e 64 2d 6c 69 6e 65 20 70 72 6f 67 72  mmand-line progr
0c40: 61 6d 73 20 61 6e 64 20 74 65 78 74 20 65 64 69  ams and text edi
0c50: 74 6f 72 73 2e 0a 49 6e 20 6f 74 68 65 72 20 77  tors..In other w
0c60: 6f 72 64 73 2c 20 63 75 73 74 6f 6d 20 66 6f 72  ords, custom for
0c70: 6d 61 74 73 20 61 72 65 20 75 73 75 61 6c 6c 79  mats are usually
0c80: 20 22 6f 70 61 71 75 65 20 62 6c 6f 62 73 22 2e   "opaque blobs".
0c90: 0a 54 6f 20 61 63 63 65 73 73 20 74 68 65 20 63  .To access the c
0ca0: 6f 6e 74 65 6e 74 20 6f 66 20 61 20 63 75 73 74  ontent of a cust
0cb0: 6f 6d 20 61 70 70 6c 69 63 61 74 69 6f 6e 20 66  om application f
0cc0: 69 6c 65 20 66 6f 72 6d 61 74 2c 20 6f 6e 65 20  ile format, one 
0cd0: 6e 65 65 64 73 0a 61 20 74 6f 6f 6c 20 73 70 65  needs.a tool spe
0ce0: 63 69 66 69 63 61 6c 6c 79 20 65 6e 67 69 6e 65  cifically engine
0cf0: 65 72 65 64 20 74 6f 20 72 65 61 64 20 61 6e 64  ered to read and
0d00: 2f 6f 72 20 77 72 69 74 65 20 74 68 61 74 20 66  /or write that f
0d10: 6f 72 6d 61 74 2e 0a 0a 3c 6c 69 3e 3c 70 3e 3c  ormat...<li><p><
0d20: 62 3e 50 69 6c 65 2d 6f 66 2d 46 69 6c 65 73 20  b>Pile-of-Files 
0d30: 46 6f 72 6d 61 74 73 2e 3c 2f 62 3e 0a 53 6f 6d  Formats.</b>.Som
0d40: 65 74 69 6d 65 73 20 74 68 65 20 61 70 70 6c 69  etimes the appli
0d50: 63 61 74 69 6f 6e 20 73 74 61 74 65 20 69 73 20  cation state is 
0d60: 73 74 6f 72 65 64 20 61 73 20 61 20 68 69 65 72  stored as a hier
0d70: 61 72 63 68 79 20 6f 66 0a 66 69 6c 65 73 2e 20  archy of.files. 
0d80: 20 47 69 74 20 69 73 20 61 20 70 72 69 6d 65 20   Git is a prime 
0d90: 65 78 61 6d 70 6c 65 20 6f 66 20 74 68 69 73 2c  example of this,
0da0: 20 74 68 6f 75 67 68 20 74 68 65 20 70 68 65 6e   though the phen
0db0: 6f 6d 65 6e 6f 6e 20 6f 63 63 75 72 73 0a 66 72  omenon occurs.fr
0dc0: 65 71 75 65 6e 74 6c 79 20 69 6e 20 6f 6e 65 2d  equently in one-
0dd0: 6f 66 66 20 61 6e 64 20 62 65 73 70 6f 6b 65 20  off and bespoke 
0de0: 61 70 70 6c 69 63 61 74 69 6f 6e 73 2e 20 20 41  applications.  A
0df0: 20 70 69 6c 65 2d 6f 66 2d 66 69 6c 65 73 20 66   pile-of-files f
0e00: 6f 72 6d 61 74 0a 65 73 73 65 6e 74 69 61 6c 6c  ormat.essentiall
0e10: 79 20 75 73 65 73 20 74 68 65 20 66 69 6c 65 73  y uses the files
0e20: 79 73 74 65 6d 20 61 73 20 61 20 6b 65 79 2f 76  ystem as a key/v
0e30: 61 6c 75 65 20 64 61 74 61 62 61 73 65 2c 20 73  alue database, s
0e40: 74 6f 72 69 6e 67 20 73 6d 61 6c 6c 0a 63 68 75  toring small.chu
0e50: 6e 6b 73 20 6f 66 20 69 6e 66 6f 72 6d 61 74 69  nks of informati
0e60: 6f 6e 20 69 6e 74 6f 20 73 65 70 61 72 61 74 65  on into separate
0e70: 20 66 69 6c 65 73 2e 20 20 54 68 69 73 20 67 69   files.  This gi
0e80: 76 65 73 20 74 68 65 0a 61 64 76 61 6e 74 61 67  ves the.advantag
0e90: 65 20 6f 66 20 6d 61 6b 69 6e 67 20 74 68 65 20  e of making the 
0ea0: 63 6f 6e 74 65 6e 74 20 6d 6f 72 65 20 61 63 63  content more acc
0eb0: 65 73 73 69 62 6c 65 20 74 6f 20 63 6f 6d 6d 6f  essible to commo
0ec0: 6e 20 75 74 69 6c 69 74 79 0a 70 72 6f 67 72 61  n utility.progra
0ed0: 6d 73 20 73 75 63 68 20 61 73 20 74 65 78 74 20  ms such as text 
0ee0: 65 64 69 74 6f 72 73 20 6f 72 20 22 61 77 6b 22  editors or "awk"
0ef0: 20 6f 72 20 22 67 72 65 70 22 2e 20 20 42 75 74   or "grep".  But
0f00: 20 65 76 65 6e 20 69 66 20 6d 61 6e 79 20 0a 6f   even if many .o
0f10: 66 20 74 68 65 20 66 69 6c 65 73 20 69 6e 20 61  f the files in a
0f20: 20 70 69 6c 65 2d 6f 66 2d 66 69 6c 65 73 20 66   pile-of-files f
0f30: 6f 72 6d 61 74 0a 61 72 65 20 65 61 73 69 6c 79  ormat.are easily
0f40: 20 72 65 61 64 61 62 6c 65 2c 20 74 68 65 72 65   readable, there
0f50: 20 61 72 65 20 75 73 75 61 6c 6c 79 20 73 6f 6d   are usually som
0f60: 65 20 66 69 6c 65 73 20 74 68 61 74 20 68 61 76  e files that hav
0f70: 65 20 74 68 65 69 72 0a 6f 77 6e 20 63 75 73 74  e their.own cust
0f80: 6f 6d 20 66 6f 72 6d 61 74 20 28 65 78 61 6d 70  om format (examp
0f90: 6c 65 3a 20 47 69 74 20 22 50 61 63 6b 66 69 6c  le: Git "Packfil
0fa0: 65 73 22 29 20 61 6e 64 20 61 72 65 20 68 65 6e  es") and are hen
0fb0: 63 65 0a 22 6f 70 61 71 75 65 20 62 6c 6f 62 73  ce."opaque blobs
0fc0: 22 20 74 68 61 74 20 61 72 65 20 6e 6f 74 20 72  " that are not r
0fd0: 65 61 64 61 62 6c 65 0a 6f 72 20 77 72 69 74 61  eadable.or writa
0fe0: 62 6c 65 20 77 69 74 68 6f 75 74 20 73 70 65 63  ble without spec
0ff0: 69 61 6c 69 7a 65 64 20 74 6f 6f 6c 73 2e 20 20  ialized tools.  
1000: 49 74 20 69 73 20 61 6c 73 6f 20 6d 75 63 68 20  It is also much 
1010: 6c 65 73 73 20 63 6f 6e 76 65 6e 69 65 6e 74 0a  less convenient.
1020: 74 6f 20 6d 6f 76 65 20 61 20 70 69 6c 65 2d 6f  to move a pile-o
1030: 66 2d 66 69 6c 65 73 20 66 72 6f 6d 20 6f 6e 65  f-files from one
1040: 20 70 6c 61 63 65 20 6f 72 20 6d 61 63 68 69 6e   place or machin
1050: 65 20 74 6f 20 61 6e 6f 74 68 65 72 2c 20 74 68  e to another, th
1060: 61 6e 0a 69 74 20 69 73 20 74 6f 20 6d 6f 76 65  an.it is to move
1070: 20 61 20 73 69 6e 67 6c 65 20 66 69 6c 65 2e 20   a single file. 
1080: 20 41 6e 64 20 69 74 20 69 73 20 68 61 72 64 20   And it is hard 
1090: 74 6f 20 6d 61 6b 65 20 61 20 70 69 6c 65 2d 6f  to make a pile-o
10a0: 66 2d 66 69 6c 65 73 0a 64 6f 63 75 6d 65 6e 74  f-files.document
10b0: 20 69 6e 74 6f 20 61 6e 20 65 6d 61 69 6c 20 61   into an email a
10c0: 74 74 61 63 68 6d 65 6e 74 2c 20 66 6f 72 20 65  ttachment, for e
10d0: 78 61 6d 70 6c 65 2e 20 20 46 69 6e 61 6c 6c 79  xample.  Finally
10e0: 2c 20 61 20 70 69 6c 65 2d 6f 66 2d 66 69 6c 65  , a pile-of-file
10f0: 73 0a 66 6f 72 6d 61 74 20 62 72 65 61 6b 73 20  s.format breaks 
1100: 74 68 65 20 22 64 6f 63 75 6d 65 6e 74 20 6d 65  the "document me
1110: 74 61 70 68 6f 72 22 3a 0a 74 68 65 72 65 20 69  taphor":.there i
1120: 73 20 6e 6f 20 6f 6e 65 20 66 69 6c 65 20 74 68  s no one file th
1130: 61 74 20 61 20 75 73 65 72 20 63 61 6e 20 70 6f  at a user can po
1140: 69 6e 74 20 74 6f 0a 74 68 61 74 20 69 73 20 22  int to.that is "
1150: 74 68 65 20 64 6f 63 75 6d 65 6e 74 22 2e 0a 0a  the document"...
1160: 3c 6c 69 3e 3c 70 3e 3c 62 3e 57 72 61 70 70 65  <li><p><b>Wrappe
1170: 64 20 50 69 6c 65 2d 6f 66 2d 46 69 6c 65 73 20  d Pile-of-Files 
1180: 46 6f 72 6d 61 74 73 2e 3c 2f 62 3e 0a 53 6f 6d  Formats.</b>.Som
1190: 65 20 61 70 70 6c 69 63 61 74 69 6f 6e 73 20 75  e applications u
11a0: 73 65 20 61 20 50 69 6c 65 2d 6f 66 2d 46 69 6c  se a Pile-of-Fil
11b0: 65 73 20 74 68 61 74 20 69 73 20 74 68 65 6e 20  es that is then 
11c0: 65 6e 63 61 70 73 75 6c 61 74 65 64 20 69 6e 74  encapsulated int
11d0: 6f 0a 73 6f 6d 65 20 6b 69 6e 64 20 6f 66 20 73  o.some kind of s
11e0: 69 6e 67 6c 65 2d 66 69 6c 65 20 63 6f 6e 74 61  ingle-file conta
11f0: 69 6e 65 72 2c 20 75 73 75 61 6c 6c 79 20 61 20  iner, usually a 
1200: 5a 49 50 20 61 72 63 68 69 76 65 2e 20 20 0a 45  ZIP archive.  .E
1210: 50 55 42 2c 20 4f 44 54 2c 61 6e 64 20 4f 44 50  PUB, ODT,and ODP
1220: 20 61 72 65 20 65 78 61 6d 70 6c 65 73 20 6f 66   are examples of
1230: 20 74 68 69 73 20 61 70 70 72 6f 61 63 68 2e 0a   this approach..
1240: 41 6e 20 45 50 55 42 20 62 6f 6f 6b 20 69 73 20  An EPUB book is 
1250: 72 65 61 6c 6c 79 20 6a 75 73 74 20 61 20 5a 49  really just a ZI
1260: 50 20 61 72 63 68 69 76 65 20 74 68 61 74 20 63  P archive that c
1270: 6f 6e 74 61 69 6e 73 20 76 61 72 69 6f 75 73 0a  ontains various.
1280: 58 48 54 4d 4c 20 66 69 6c 65 73 20 66 6f 72 20  XHTML files for 
1290: 74 68 65 20 74 65 78 74 20 6f 66 20 62 6f 6f 6b  the text of book
12a0: 20 63 68 61 70 74 65 72 73 2c 20 47 49 46 20 61   chapters, GIF a
12b0: 6e 64 20 4a 50 45 47 20 69 6d 61 67 65 73 20 66  nd JPEG images f
12c0: 6f 72 0a 74 68 65 20 61 72 74 77 6f 72 6b 2c 20  or.the artwork, 
12d0: 61 6e 64 20 61 20 73 70 65 63 69 61 6c 69 7a 65  and a specialize
12e0: 64 20 63 61 74 61 6c 6f 67 20 66 69 6c 65 20 74  d catalog file t
12f0: 68 61 74 20 74 65 6c 6c 73 20 74 68 65 20 65 42  hat tells the eB
1300: 6f 6f 6b 0a 72 65 61 64 65 72 20 68 6f 77 20 61  ook.reader how a
1310: 6c 6c 20 74 68 65 20 58 4d 4c 20 61 6e 64 20 69  ll the XML and i
1320: 6d 61 67 65 20 66 69 6c 65 73 20 66 69 74 20 74  mage files fit t
1330: 6f 67 65 74 68 65 72 2e 20 20 4f 70 65 6e 4f 66  ogether.  OpenOf
1340: 66 69 63 65 0a 64 6f 63 75 6d 65 6e 74 73 20 28  fice.documents (
1350: 4f 44 54 20 61 6e 64 20 4f 44 50 29 20 61 72 65  ODT and ODP) are
1360: 20 61 6c 73 6f 20 5a 49 50 20 61 72 63 68 69 76   also ZIP archiv
1370: 65 73 20 63 6f 6e 74 61 69 6e 69 6e 67 20 58 4d  es containing XM
1380: 4c 20 61 6e 64 0a 69 6d 61 67 65 73 20 74 68 61  L and.images tha
1390: 74 20 72 65 70 72 65 73 65 6e 74 20 74 68 65 69  t represent thei
13a0: 72 20 63 6f 6e 74 65 6e 74 20 61 73 20 77 65 6c  r content as wel
13b0: 6c 20 61 73 20 22 63 61 74 61 6c 6f 67 22 20 66  l as "catalog" f
13c0: 69 6c 65 73 20 74 68 61 74 0a 73 68 6f 77 20 74  iles that.show t
13d0: 68 65 20 69 6e 74 65 72 72 65 6c 61 74 69 6f 6e  he interrelation
13e0: 73 68 69 70 73 20 62 65 74 77 65 65 6e 20 74 68  ships between th
13f0: 65 20 63 6f 6d 70 6f 6e 65 6e 74 20 70 61 72 74  e component part
1400: 73 2e 0a 0a 3c 70 3e 41 20 77 72 61 70 70 65 64  s...<p>A wrapped
1410: 20 70 69 6c 65 2d 6f 66 2d 66 69 6c 65 73 20 66   pile-of-files f
1420: 6f 72 6d 61 74 20 69 73 20 61 20 63 6f 6d 70 72  ormat is a compr
1430: 6f 6d 69 73 65 20 62 65 74 77 65 65 6e 20 61 20  omise between a 
1440: 66 75 6c 6c 0a 63 75 73 74 6f 6d 20 66 69 6c 65  full.custom file
1450: 20 66 6f 72 6d 61 74 20 61 6e 64 20 61 20 70 75   format and a pu
1460: 72 65 20 70 69 6c 65 2d 6f 66 2d 66 69 6c 65 73  re pile-of-files
1470: 20 66 6f 72 6d 61 74 2e 0a 41 20 77 72 61 70 70   format..A wrapp
1480: 65 64 20 70 69 6c 65 2d 6f 66 2d 66 69 6c 65 73  ed pile-of-files
1490: 20 66 6f 72 6d 61 74 20 69 73 20 6e 6f 74 20 61   format is not a
14a0: 6e 20 6f 70 61 71 75 65 20 62 6c 6f 62 20 69 6e  n opaque blob in
14b0: 20 74 68 65 20 73 61 6d 65 20 73 65 6e 73 65 0a   the same sense.
14c0: 61 73 20 61 20 63 75 73 74 6f 6d 20 66 6f 72 6d  as a custom form
14d0: 61 74 2c 20 73 69 6e 63 65 20 74 68 65 20 63 6f  at, since the co
14e0: 6d 70 6f 6e 65 6e 74 20 70 61 72 74 73 20 63 61  mponent parts ca
14f0: 6e 20 73 74 69 6c 6c 20 62 65 20 61 63 63 65 73  n still be acces
1500: 73 65 64 0a 75 73 69 6e 67 20 61 6e 79 20 63 6f  sed.using any co
1510: 6d 6d 6f 6e 20 5a 49 50 20 61 72 63 68 69 76 65  mmon ZIP archive
1520: 72 2c 20 62 75 74 20 74 68 65 20 66 6f 72 6d 61  r, but the forma
1530: 74 20 69 73 20 6e 6f 74 20 71 75 69 74 65 20 61  t is not quite a
1540: 73 20 61 63 63 65 73 73 69 62 6c 65 0a 61 73 20  s accessible.as 
1550: 61 20 70 75 72 65 20 70 69 6c 65 2d 6f 66 2d 66  a pure pile-of-f
1560: 69 6c 65 73 20 66 6f 72 6d 61 74 20 62 65 63 61  iles format beca
1570: 75 73 65 20 6f 6e 65 20 64 6f 65 73 20 73 74 69  use one does sti
1580: 6c 6c 20 6e 65 65 64 20 74 68 65 20 5a 49 50 20  ll need the ZIP 
1590: 0a 61 72 63 68 69 76 65 72 2c 20 61 6e 64 20 6f  .archiver, and o
15a0: 6e 65 20 63 61 6e 6e 6f 74 20 6e 6f 72 6d 61 6c  ne cannot normal
15b0: 6c 79 20 75 73 65 20 63 6f 6d 6d 61 6e 64 2d 6c  ly use command-l
15c0: 69 6e 65 20 74 6f 6f 6c 73 20 6c 69 6b 65 20 22  ine tools like "
15d0: 66 69 6e 64 22 0a 6f 6e 20 74 68 65 20 66 69 6c  find".on the fil
15e0: 65 20 68 69 65 72 61 72 63 68 79 20 77 69 74 68  e hierarchy with
15f0: 6f 75 74 20 66 69 72 73 74 20 75 6e 2d 7a 69 70  out first un-zip
1600: 70 69 6e 67 20 69 74 2e 20 20 4f 6e 20 74 68 65  ping it.  On the
1610: 20 6f 74 68 65 72 0a 68 61 6e 64 2c 20 61 20 77   other.hand, a w
1620: 72 61 70 70 65 64 20 70 69 6c 65 2d 6f 66 2d 66  rapped pile-of-f
1630: 69 6c 65 73 20 66 6f 72 6d 61 74 20 64 6f 65 73  iles format does
1640: 20 70 72 65 73 65 72 76 65 20 74 68 65 20 64 6f   preserve the do
1650: 63 75 6d 65 6e 74 0a 6d 65 74 61 70 68 6f 72 20  cument.metaphor 
1660: 62 79 20 70 75 74 74 69 6e 67 20 61 6c 6c 20 63  by putting all c
1670: 6f 6e 74 65 6e 74 20 69 6e 74 6f 20 61 20 73 69  ontent into a si
1680: 6e 67 6c 65 20 64 69 73 6b 20 66 69 6c 65 2e 20  ngle disk file. 
1690: 20 41 6e 64 0a 62 65 63 61 75 73 65 20 69 74 20   And.because it 
16a0: 69 73 20 63 6f 6d 70 72 65 73 73 65 64 2c 20 74  is compressed, t
16b0: 68 65 20 77 72 61 70 70 65 64 20 70 69 6c 65 2d  he wrapped pile-
16c0: 6f 66 2d 66 69 6c 65 73 20 66 6f 72 6d 61 74 20  of-files format 
16d0: 74 65 6e 64 73 20 74 6f 0a 62 65 20 6d 6f 72 65  tends to.be more
16e0: 20 63 6f 6d 70 61 63 74 2e 0a 0a 3c 70 3e 41 73   compact...<p>As
16f0: 20 77 69 74 68 20 63 75 73 74 6f 6d 20 66 69 6c   with custom fil
1700: 65 20 66 6f 72 6d 61 74 73 2c 20 61 6e 64 20 75  e formats, and u
1710: 6e 6c 69 6b 65 20 70 75 72 65 20 70 69 6c 65 2d  nlike pure pile-
1720: 6f 66 2d 66 69 6c 65 20 66 6f 72 6d 61 74 73 2c  of-file formats,
1730: 0a 61 20 77 72 61 70 70 65 64 20 70 69 6c 65 2d  .a wrapped pile-
1740: 6f 66 2d 66 69 6c 65 73 20 66 6f 72 6d 61 74 20  of-files format 
1750: 69 73 20 6e 6f 74 20 61 73 20 65 61 73 79 20 74  is not as easy t
1760: 6f 20 65 64 69 74 2c 20 73 69 6e 63 65 0a 75 73  o edit, since.us
1770: 75 61 6c 6c 79 20 74 68 65 20 65 6e 74 69 72 65  ually the entire
1780: 20 66 69 6c 65 20 6d 75 73 74 20 62 65 20 72 65   file must be re
1790: 77 72 69 74 74 65 6e 20 69 6e 20 6f 72 64 65 72  written in order
17a0: 20 74 6f 20 63 68 61 6e 67 65 20 61 6e 79 0a 63   to change any.c
17b0: 6f 6d 70 6f 6e 65 6e 74 20 70 61 72 74 2e 0a 3c  omponent part..<
17c0: 2f 6f 6c 3e 0a 0a 3c 70 3e 54 68 65 20 70 75 72  /ol>..<p>The pur
17d0: 70 6f 73 65 20 6f 66 20 74 68 69 73 20 64 6f 63  pose of this doc
17e0: 75 6d 65 6e 74 20 69 73 20 74 6f 20 61 72 67 75  ument is to argu
17f0: 65 20 69 6e 20 66 61 76 6f 72 20 6f 66 20 61 20  e in favor of a 
1800: 66 6f 75 72 74 68 0a 6e 65 77 20 63 61 74 65 67  fourth.new categ
1810: 6f 72 79 20 6f 66 20 61 70 70 6c 69 63 61 74 69  ory of applicati
1820: 6f 6e 20 66 69 6c 65 20 66 6f 72 6d 61 74 3a 20  on file format: 
1830: 41 6e 20 53 51 4c 69 74 65 20 64 61 74 61 62 61  An SQLite databa
1840: 73 65 20 66 69 6c 65 2e 0a 0a 3c 68 32 3e 53 51  se file...<h2>SQ
1850: 4c 69 74 65 20 41 73 20 54 68 65 20 41 70 70 6c  Lite As The Appl
1860: 69 63 61 74 69 6f 6e 20 46 69 6c 65 20 46 6f 72  ication File For
1870: 6d 61 74 3c 2f 68 32 3e 0a 0a 3c 70 3e 0a 41 6e  mat</h2>..<p>.An
1880: 79 20 61 70 70 6c 69 63 61 74 69 6f 6e 20 73 74  y application st
1890: 61 74 65 20 74 68 61 74 20 63 61 6e 20 62 65 20  ate that can be 
18a0: 72 65 63 6f 72 64 65 64 20 69 6e 20 61 20 70 69  recorded in a pi
18b0: 6c 65 2d 6f 66 2d 66 69 6c 65 73 20 63 61 6e 0a  le-of-files can.
18c0: 61 6c 73 6f 20 62 65 20 72 65 63 6f 72 64 65 64  also be recorded
18d0: 20 69 6e 20 61 6e 20 53 51 4c 69 74 65 20 64 61   in an SQLite da
18e0: 74 61 62 61 73 65 20 77 69 74 68 20 61 20 73 69  tabase with a si
18f0: 6d 70 6c 65 20 6b 65 79 2f 76 61 6c 75 65 20 73  mple key/value s
1900: 63 68 65 6d 61 0a 6c 69 6b 65 20 74 68 69 73 3a  chema.like this:
1910: 0a 3c 62 6c 6f 63 6b 71 75 6f 74 65 3e 3c 70 72  .<blockquote><pr
1920: 65 3e 0a 43 52 45 41 54 45 20 54 41 42 4c 45 20  e>.CREATE TABLE 
1930: 66 69 6c 65 73 28 66 69 6c 65 6e 61 6d 65 20 54  files(filename T
1940: 45 58 54 20 50 52 49 4d 41 52 59 20 4b 45 59 2c  EXT PRIMARY KEY,
1950: 20 63 6f 6e 74 65 6e 74 20 42 4c 4f 42 29 3b 0a   content BLOB);.
1960: 3c 2f 70 72 65 3e 3c 2f 62 6c 6f 63 6b 71 75 6f  </pre></blockquo
1970: 74 65 3e 0a 49 66 20 74 68 65 20 63 6f 6e 74 65  te>.If the conte
1980: 6e 74 20 69 73 20 63 6f 6d 70 72 65 73 73 65 64  nt is compressed
1990: 2c 20 74 68 65 6e 20 73 75 63 68 20 61 6e 20 5b  , then such an [
19a0: 53 51 4c 69 74 65 20 41 72 63 68 69 76 65 5d 20  SQLite Archive] 
19b0: 64 61 74 61 62 61 73 65 20 69 73 0a 5b 53 51 4c  database is.[SQL
19c0: 69 74 65 20 41 72 63 68 69 76 65 20 73 6d 61 6c  ite Archive smal
19d0: 6c 65 72 20 74 68 61 6e 20 5a 49 50 7c 74 68 65  ler than ZIP|the
19e0: 20 73 61 6d 65 20 73 69 7a 65 5d 20 28 26 23 31   same size] (&#1
19f0: 37 37 3b 31 25 29 0a 61 73 20 61 6e 20 65 71 75  77;1%).as an equ
1a00: 69 76 61 6c 65 6e 74 20 5a 49 50 20 61 72 63 68  ivalent ZIP arch
1a10: 69 76 65 2c 20 61 6e 64 20 69 74 20 68 61 73 20  ive, and it has 
1a20: 74 68 65 20 61 64 76 61 6e 74 61 67 65 0a 6f 66  the advantage.of
1a30: 20 62 65 69 6e 67 20 61 62 6c 65 20 74 6f 20 75   being able to u
1a40: 70 64 61 74 65 20 69 6e 64 69 76 69 64 75 61 6c  pdate individual
1a50: 20 22 66 69 6c 65 73 22 20 77 69 74 68 6f 75 74   "files" without
1a60: 20 72 65 77 72 69 74 69 6e 67 0a 74 68 65 20 65   rewriting.the e
1a70: 6e 74 69 72 65 20 64 6f 63 75 6d 65 6e 74 2e 0a  ntire document..
1a80: 0a 3c 70 3e 0a 42 75 74 20 61 6e 20 53 51 4c 69  .<p>.But an SQLi
1a90: 74 65 20 64 61 74 61 62 61 73 65 20 69 73 20 6e  te database is n
1aa0: 6f 74 20 6c 69 6d 69 74 65 64 20 74 6f 20 61 20  ot limited to a 
1ab0: 73 69 6d 70 6c 65 20 6b 65 79 2f 76 61 6c 75 65  simple key/value
1ac0: 20 73 74 72 75 63 74 75 72 65 0a 6c 69 6b 65 20   structure.like 
1ad0: 61 20 70 69 6c 65 2d 6f 66 2d 66 69 6c 65 73 20  a pile-of-files 
1ae0: 64 61 74 61 62 61 73 65 2e 20 20 41 6e 20 53 51  database.  An SQ
1af0: 4c 69 74 65 20 64 61 74 61 62 61 73 65 20 63 61  Lite database ca
1b00: 6e 20 68 61 76 65 20 64 6f 7a 65 6e 73 0a 6f 72  n have dozens.or
1b10: 20 68 75 6e 64 72 65 64 73 20 6f 72 20 74 68 6f   hundreds or tho
1b20: 75 73 61 6e 64 73 20 6f 66 20 64 69 66 66 65 72  usands of differ
1b30: 65 6e 74 20 74 61 62 6c 65 73 2c 20 77 69 74 68  ent tables, with
1b40: 20 64 6f 7a 65 6e 73 20 6f 72 0a 68 75 6e 64 72   dozens or.hundr
1b50: 65 64 73 20 6f 72 20 74 68 6f 75 73 61 6e 64 73  eds or thousands
1b60: 20 6f 66 20 66 69 65 6c 64 73 20 70 65 72 20 74   of fields per t
1b70: 61 62 6c 65 2c 20 65 61 63 68 20 77 69 74 68 20  able, each with 
1b80: 64 69 66 66 65 72 65 6e 74 20 64 61 74 61 74 79  different dataty
1b90: 70 65 73 0a 61 6e 64 20 63 6f 6e 73 74 72 61 69  pes.and constrai
1ba0: 6e 74 73 20 61 6e 64 20 70 61 72 74 69 63 75 6c  nts and particul
1bb0: 61 72 20 6d 65 61 6e 69 6e 67 73 2c 20 61 6c 6c  ar meanings, all
1bc0: 20 63 72 6f 73 73 2d 72 65 66 65 72 65 6e 63 69   cross-referenci
1bd0: 6e 67 20 65 61 63 68 20 6f 74 68 65 72 2c 0a 61  ng each other,.a
1be0: 70 70 72 6f 70 72 69 61 74 65 6c 79 20 61 6e 64  ppropriately and
1bf0: 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 20 69   automatically i
1c00: 6e 64 65 78 65 64 20 66 6f 72 20 72 61 70 69 64  ndexed for rapid
1c10: 20 72 65 74 72 69 65 76 61 6c 2c 0a 61 6e 64 20   retrieval,.and 
1c20: 61 6c 6c 20 73 74 6f 72 65 64 20 65 66 66 69 63  all stored effic
1c30: 69 65 6e 74 6c 79 20 61 6e 64 20 63 6f 6d 70 61  iently and compa
1c40: 63 74 6c 79 20 69 6e 20 61 20 73 69 6e 67 6c 65  ctly in a single
1c50: 20 64 69 73 6b 20 66 69 6c 65 2e 0a 41 6e 64 20   disk file..And 
1c60: 61 6c 6c 20 6f 66 20 74 68 69 73 20 73 74 72 75  all of this stru
1c70: 63 74 75 72 65 20 69 73 20 73 75 63 63 69 6e 63  cture is succinc
1c80: 74 6c 79 20 64 6f 63 75 6d 65 6e 74 65 64 20 66  tly documented f
1c90: 6f 72 20 68 75 6d 61 6e 73 0a 62 79 20 74 68 65  or humans.by the
1ca0: 20 53 51 4c 20 73 63 68 65 6d 61 2e 0a 0a 3c 70   SQL schema...<p
1cb0: 3e 49 6e 20 6f 74 68 65 72 20 77 6f 72 64 73 2c  >In other words,
1cc0: 20 61 6e 20 53 51 4c 69 74 65 20 64 61 74 61 62   an SQLite datab
1cd0: 61 73 65 20 63 61 6e 20 64 6f 20 65 76 65 72 79  ase can do every
1ce0: 74 68 69 6e 67 20 74 68 61 74 20 61 20 0a 70 69  thing that a .pi
1cf0: 6c 65 2d 6f 66 2d 66 69 6c 65 73 20 6f 72 20 77  le-of-files or w
1d00: 72 61 70 70 65 64 20 70 69 6c 65 2d 6f 66 2d 66  rapped pile-of-f
1d10: 69 6c 65 73 20 66 6f 72 6d 61 74 20 63 61 6e 20  iles format can 
1d20: 64 6f 2c 20 70 6c 75 73 20 6d 75 63 68 20 6d 6f  do, plus much mo
1d30: 72 65 2c 0a 61 6e 64 20 77 69 74 68 20 67 72 65  re,.and with gre
1d40: 61 74 65 72 20 6c 75 63 69 64 69 74 79 2e 0a 41  ater lucidity..A
1d50: 6e 20 53 51 4c 69 74 65 20 64 61 74 61 62 61 73  n SQLite databas
1d60: 65 20 69 73 20 61 20 6d 6f 72 65 20 76 65 72 73  e is a more vers
1d70: 61 74 69 6c 65 20 63 6f 6e 74 61 69 6e 65 72 20  atile container 
1d80: 74 68 61 6e 20 6b 65 79 2f 76 61 6c 75 65 0a 66  than key/value.f
1d90: 69 6c 65 73 79 73 74 65 6d 20 6f 72 20 61 20 5a  ilesystem or a Z
1da0: 49 50 20 61 72 63 68 69 76 65 2e 20 20 28 46 6f  IP archive.  (Fo
1db0: 72 20 61 20 64 65 74 61 69 6c 65 64 20 65 78 61  r a detailed exa
1dc0: 6d 70 6c 65 2c 20 73 65 65 20 74 68 65 0a 5b 4f  mple, see the.[O
1dd0: 70 65 6e 4f 66 66 69 63 65 20 63 61 73 65 20 73  penOffice case s
1de0: 74 75 64 79 5d 20 65 73 73 61 79 2e 29 0a 0a 3c  tudy] essay.)..<
1df0: 70 3e 54 68 65 20 70 6f 77 65 72 20 6f 66 20 61  p>The power of a
1e00: 6e 20 53 51 4c 69 74 65 20 64 61 74 61 62 61 73  n SQLite databas
1e10: 65 20 63 6f 75 6c 64 2c 20 69 6e 20 74 68 65 6f  e could, in theo
1e20: 72 79 2c 20 62 65 20 61 63 68 69 65 76 65 64 20  ry, be achieved 
1e30: 75 73 69 6e 67 0a 61 20 63 75 73 74 6f 6d 20 66  using.a custom f
1e40: 69 6c 65 20 66 6f 72 6d 61 74 2e 20 20 42 75 74  ile format.  But
1e50: 20 61 6e 79 20 63 75 73 74 6f 6d 20 66 69 6c 65   any custom file
1e60: 20 66 6f 72 6d 61 74 20 74 68 61 74 20 69 73 20   format that is 
1e70: 61 73 20 65 78 70 72 65 73 73 69 76 65 0a 61 73  as expressive.as
1e80: 20 61 20 72 65 6c 61 74 69 6f 6e 61 6c 20 64 61   a relational da
1e90: 74 61 62 61 73 65 20 77 6f 75 6c 64 20 6c 69 6b  tabase would lik
1ea0: 65 6c 79 20 72 65 71 75 69 72 65 20 61 6e 20 65  ely require an e
1eb0: 6e 6f 72 6d 6f 75 73 20 64 65 73 69 67 6e 20 73  normous design s
1ec0: 70 65 63 69 66 69 63 61 74 69 6f 6e 20 0a 61 6e  pecification .an
1ed0: 64 20 6d 61 6e 79 20 74 65 6e 73 20 6f 72 20 68  d many tens or h
1ee0: 75 6e 64 72 65 64 73 20 6f 66 20 74 68 6f 75 73  undreds of thous
1ef0: 61 6e 64 73 20 6f 66 20 6c 69 6e 65 73 20 6f 66  ands of lines of
1f00: 20 63 6f 64 65 20 74 6f 20 0a 69 6d 70 6c 65 6d   code to .implem
1f10: 65 6e 74 2e 20 20 41 6e 64 20 74 68 65 20 65 6e  ent.  And the en
1f20: 64 20 72 65 73 75 6c 74 20 77 6f 75 6c 64 20 62  d result would b
1f30: 65 20 61 6e 20 22 6f 70 61 71 75 65 20 62 6c 6f  e an "opaque blo
1f40: 62 22 20 74 68 61 74 20 69 73 0a 69 6e 61 63 63  b" that is.inacc
1f50: 65 73 73 69 62 6c 65 20 77 69 74 68 6f 75 74 20  essible without 
1f60: 73 70 65 63 69 61 6c 69 7a 65 64 20 74 6f 6f 6c  specialized tool
1f70: 73 2e 0a 0a 3c 70 3e 0a 48 65 6e 63 65 2c 20 69  s...<p>.Hence, i
1f80: 6e 20 63 6f 6d 70 61 72 69 73 6f 6e 20 74 6f 20  n comparison to 
1f90: 6f 74 68 65 72 20 61 70 70 72 6f 61 63 68 65 73  other approaches
1fa0: 2c 20 74 68 65 20 75 73 65 20 6f 66 0a 61 6e 20  , the use of.an 
1fb0: 53 51 4c 69 74 65 20 64 61 74 61 62 61 73 65 20  SQLite database 
1fc0: 61 73 20 61 6e 20 61 70 70 6c 69 63 61 74 69 6f  as an applicatio
1fd0: 6e 20 66 69 6c 65 20 66 6f 72 6d 61 74 20 68 61  n file format ha
1fe0: 73 0a 63 6f 6d 70 65 6c 6c 69 6e 67 20 61 64 76  s.compelling adv
1ff0: 61 6e 74 61 67 65 73 2e 20 20 48 65 72 65 20 61  antages.  Here a
2000: 72 65 20 61 20 66 65 77 20 6f 66 20 74 68 65 73  re a few of thes
2010: 65 20 61 64 76 61 6e 74 61 67 65 73 2c 0a 65 6e  e advantages,.en
2020: 75 6d 65 72 61 74 65 64 20 61 6e 64 20 65 78 70  umerated and exp
2030: 6f 75 6e 64 65 64 3a 0a 3c 2f 70 3e 0a 0a 3c 6f  ounded:.</p>..<o
2040: 6c 3e 0a 3c 6c 69 3e 3c 70 3e 3c 62 3e 53 69 6d  l>.<li><p><b>Sim
2050: 70 6c 69 66 69 65 64 20 41 70 70 6c 69 63 61 74  plified Applicat
2060: 69 6f 6e 20 44 65 76 65 6c 6f 70 6d 65 6e 74 2e  ion Development.
2070: 3c 2f 62 3e 0a 4e 6f 20 6e 65 77 20 63 6f 64 65  </b>.No new code
2080: 20 69 73 20 6e 65 65 64 65 64 20 66 6f 72 20 72   is needed for r
2090: 65 61 64 69 6e 67 20 6f 72 20 77 72 69 74 69 6e  eading or writin
20a0: 67 20 74 68 65 20 61 70 70 6c 69 63 61 74 69 6f  g the applicatio
20b0: 6e 20 66 69 6c 65 2e 0a 4f 6e 65 20 68 61 73 20  n file..One has 
20c0: 6d 65 72 65 6c 79 20 74 6f 20 6c 69 6e 6b 20 61  merely to link a
20d0: 67 61 69 6e 73 74 20 74 68 65 20 53 51 4c 69 74  gainst the SQLit
20e0: 65 20 6c 69 62 72 61 72 79 2c 20 6f 72 20 69 6e  e library, or in
20f0: 63 6c 75 64 65 20 74 68 65 20 0a 5b 61 6d 61 6c  clude the .[amal
2100: 67 61 6d 61 74 69 6f 6e 20 7c 20 73 69 6e 67 6c  gamation | singl
2110: 65 20 22 73 71 6c 69 74 65 33 2e 63 22 20 73 6f  e "sqlite3.c" so
2120: 75 72 63 65 20 66 69 6c 65 5d 20 77 69 74 68 20  urce file] with 
2130: 74 68 65 20 72 65 73 74 20 6f 66 20 74 68 65 0a  the rest of the.
2140: 61 70 70 6c 69 63 61 74 69 6f 6e 20 43 20 63 6f  application C co
2150: 64 65 2c 20 61 6e 64 20 53 51 4c 69 74 65 20 77  de, and SQLite w
2160: 69 6c 6c 20 74 61 6b 65 20 63 61 72 65 20 6f 66  ill take care of
2170: 20 61 6c 6c 20 6f 66 20 74 68 65 20 61 70 70 6c   all of the appl
2180: 69 63 61 74 69 6f 6e 0a 66 69 6c 65 20 49 2f 4f  ication.file I/O
2190: 2e 20 20 54 68 69 73 20 63 61 6e 20 72 65 64 75  .  This can redu
21a0: 63 65 20 61 70 70 6c 69 63 61 74 69 6f 6e 20 63  ce application c
21b0: 6f 64 65 20 73 69 7a 65 20 62 79 20 6d 61 6e 79  ode size by many
21c0: 20 74 68 6f 75 73 61 6e 64 73 20 6f 66 0a 6c 69   thousands of.li
21d0: 6e 65 73 2c 20 77 69 74 68 20 63 6f 72 72 65 73  nes, with corres
21e0: 70 6f 6e 64 69 6e 67 20 73 61 76 69 6e 67 20 69  ponding saving i
21f0: 6e 20 64 65 76 65 6c 6f 70 6d 65 6e 74 20 61 6e  n development an
2200: 64 20 6d 61 69 6e 74 65 6e 61 6e 63 65 20 63 6f  d maintenance co
2210: 73 74 73 2e 0a 0a 3c 70 3e 53 51 4c 69 74 65 20  sts...<p>SQLite 
2220: 69 73 20 6f 6e 65 20 6f 66 20 74 68 65 0a 5b 6d  is one of the.[m
2230: 6f 73 74 20 77 69 64 65 6c 79 20 64 65 70 6c 6f  ost widely deplo
2240: 79 65 64 7c 6d 6f 73 74 20 75 73 65 64 5d 20 73  yed|most used] s
2250: 6f 66 74 77 61 72 65 20 6c 69 62 72 61 72 69 65  oftware librarie
2260: 73 20 69 6e 20 74 68 65 20 77 6f 72 6c 64 2e 0a  s in the world..
2270: 54 68 65 72 65 20 61 72 65 20 6c 69 74 65 72 61  There are litera
2280: 6c 6c 79 20 74 65 6e 73 20 6f 66 20 62 69 6c 6c  lly tens of bill
2290: 69 6f 6e 73 20 6f 66 20 53 51 4c 69 74 65 20 64  ions of SQLite d
22a0: 61 74 61 62 61 73 65 20 66 69 6c 65 73 20 69 6e  atabase files in
22b0: 20 75 73 65 20 0a 64 61 69 6c 79 2c 20 6f 6e 20   use .daily, on 
22c0: 73 6d 61 72 74 70 68 6f 6e 65 73 20 61 6e 64 20  smartphones and 
22d0: 67 61 64 67 65 74 73 20 61 6e 64 20 69 6e 20 64  gadgets and in d
22e0: 65 73 6b 74 6f 70 20 61 70 70 6c 69 63 61 74 69  esktop applicati
22f0: 6f 6e 73 2e 0a 53 51 4c 69 74 65 20 69 73 20 5b  ons..SQLite is [
2300: 74 65 73 74 65 64 20 7c 20 63 61 72 65 66 75 6c  tested | careful
2310: 6c 79 20 74 65 73 74 65 64 5d 20 61 6e 64 20 70  ly tested] and p
2320: 72 6f 76 65 6e 20 72 65 6c 69 61 62 6c 65 2e 20  roven reliable. 
2330: 20 49 74 20 69 73 20 6e 6f 74 0a 61 20 63 6f 6d   It is not.a com
2340: 70 6f 6e 65 6e 74 20 74 68 61 74 20 6e 65 65 64  ponent that need
2350: 73 20 6d 75 63 68 20 74 75 6e 69 6e 67 20 6f 72  s much tuning or
2360: 20 64 65 62 75 67 67 69 6e 67 2c 20 61 6c 6c 6f   debugging, allo
2370: 77 69 6e 67 20 64 65 76 65 6c 6f 70 65 72 73 0a  wing developers.
2380: 74 6f 20 73 74 61 79 20 66 6f 63 75 73 65 64 20  to stay focused 
2390: 6f 6e 20 61 70 70 6c 69 63 61 74 69 6f 6e 20 6c  on application l
23a0: 6f 67 69 63 2e 0a 0a 3c 6c 69 3e 3c 70 3e 3c 62  ogic...<li><p><b
23b0: 3e 53 69 6e 67 6c 65 2d 46 69 6c 65 20 44 6f 63  >Single-File Doc
23c0: 75 6d 65 6e 74 73 2e 3c 2f 62 3e 0a 41 6e 20 53  uments.</b>.An S
23d0: 51 4c 69 74 65 20 64 61 74 61 62 61 73 65 20 69  QLite database i
23e0: 73 20 63 6f 6e 74 61 69 6e 65 64 20 69 6e 20 61  s contained in a
23f0: 20 73 69 6e 67 6c 65 20 66 69 6c 65 2c 20 77 68   single file, wh
2400: 69 63 68 20 69 73 20 65 61 73 69 6c 79 0a 63 6f  ich is easily.co
2410: 70 69 65 64 20 6f 72 20 6d 6f 76 65 64 20 6f 72  pied or moved or
2420: 20 61 74 74 61 63 68 65 64 2e 20 20 54 68 65 20   attached.  The 
2430: 22 64 6f 63 75 6d 65 6e 74 22 20 6d 65 74 61 70  "document" metap
2440: 68 6f 72 20 69 73 20 70 72 65 73 65 72 76 65 64  hor is preserved
2450: 2e 0a 0a 3c 70 3e 53 51 4c 69 74 65 20 64 6f 65  ...<p>SQLite doe
2460: 73 20 6e 6f 74 20 68 61 76 65 20 61 6e 79 20 66  s not have any f
2470: 69 6c 65 20 6e 61 6d 69 6e 67 20 72 65 71 75 69  ile naming requi
2480: 72 65 6d 65 6e 74 73 0a 61 6e 64 20 73 6f 20 74  rements.and so t
2490: 68 65 20 61 70 70 6c 69 63 61 74 69 6f 6e 20 63  he application c
24a0: 61 6e 20 75 73 65 20 61 6e 79 20 63 75 73 74 6f  an use any custo
24b0: 6d 20 66 69 6c 65 20 73 75 66 66 69 78 20 74 68  m file suffix th
24c0: 61 74 20 69 74 20 77 61 6e 74 73 0a 74 6f 20 68  at it wants.to h
24d0: 65 6c 70 20 69 64 65 6e 74 69 66 79 20 74 68 65  elp identify the
24e0: 20 66 69 6c 65 20 61 73 20 22 62 65 6c 6f 6e 67   file as "belong
24f0: 69 6e 67 22 20 74 6f 20 74 68 65 20 61 70 70 6c  ing" to the appl
2500: 69 63 61 74 69 6f 6e 2e 0a 53 51 4c 69 74 65 20  ication..SQLite 
2510: 64 61 74 61 62 61 73 65 20 66 69 6c 65 73 20 63  database files c
2520: 6f 6e 74 61 69 6e 20 61 20 34 2d 62 79 74 65 20  ontain a 4-byte 
2530: 5b 41 70 70 6c 69 63 61 74 69 6f 6e 20 49 44 5d  [Application ID]
2540: 20 69 6e 0a 74 68 65 69 72 20 68 65 61 64 65 72   in.their header
2550: 73 20 74 68 61 74 20 63 61 6e 20 62 65 20 73 65  s that can be se
2560: 74 20 74 6f 20 61 6e 20 61 70 70 6c 69 63 61 74  t to an applicat
2570: 69 6f 6e 2d 64 65 66 69 6e 65 64 20 76 61 6c 75  ion-defined valu
2580: 65 0a 61 6e 64 20 74 68 65 6e 20 75 73 65 64 20  e.and then used 
2590: 74 6f 20 69 64 65 6e 74 69 66 79 20 74 68 65 20  to identify the 
25a0: 22 74 79 70 65 22 20 6f 66 20 74 68 65 20 64 6f  "type" of the do
25b0: 63 75 6d 65 6e 74 20 66 6f 72 20 75 74 69 6c 69  cument for utili
25c0: 74 79 0a 70 72 6f 67 72 61 6d 73 20 73 75 63 68  ty.programs such
25d0: 20 61 73 20 5b 68 74 74 70 3a 2f 2f 6c 69 6e 75   as [http://linu
25e0: 78 2e 64 69 65 2e 6e 65 74 2f 6d 61 6e 2f 31 2f  x.die.net/man/1/
25f0: 66 69 6c 65 20 7c 20 66 69 6c 65 28 31 29 5d 2c  file | file(1)],
2600: 20 66 75 72 74 68 65 72 0a 65 6e 68 61 6e 63 69   further.enhanci
2610: 6e 67 20 74 68 65 20 64 6f 63 75 6d 65 6e 74 20  ng the document 
2620: 6d 65 74 61 70 68 6f 72 2e 0a 0a 0a 3c 6c 69 3e  metaphor....<li>
2630: 3c 70 3e 3c 62 3e 48 69 67 68 2d 4c 65 76 65 6c  <p><b>High-Level
2640: 20 51 75 65 72 79 20 4c 61 6e 67 75 61 67 65 2e   Query Language.
2650: 3c 2f 62 3e 0a 53 51 4c 69 74 65 20 69 73 20 61  </b>.SQLite is a
2660: 20 63 6f 6d 70 6c 65 74 65 20 72 65 6c 61 74 69   complete relati
2670: 6f 6e 61 6c 20 64 61 74 61 62 61 73 65 20 65 6e  onal database en
2680: 67 69 6e 65 2c 20 77 68 69 63 68 20 6d 65 61 6e  gine, which mean
2690: 73 20 74 68 61 74 20 74 68 65 0a 61 70 70 6c 69  s that the.appli
26a0: 63 61 74 69 6f 6e 20 63 61 6e 20 61 63 63 65 73  cation can acces
26b0: 73 20 63 6f 6e 74 65 6e 74 20 75 73 69 6e 67 20  s content using 
26c0: 68 69 67 68 2d 6c 65 76 65 6c 20 71 75 65 72 69  high-level queri
26d0: 65 73 2e 20 20 41 70 70 6c 69 63 61 74 69 6f 6e  es.  Application
26e0: 0a 64 65 76 65 6c 6f 70 65 72 73 20 6e 65 65 64  .developers need
26f0: 20 6e 6f 74 20 73 70 65 6e 64 20 74 69 6d 65 20   not spend time 
2700: 74 68 69 6e 6b 69 6e 67 20 61 62 6f 75 74 20 22  thinking about "
2710: 68 6f 77 22 20 74 6f 20 72 65 74 72 69 65 76 65  how" to retrieve
2720: 20 74 68 65 0a 69 6e 66 6f 72 6d 61 74 69 6f 6e   the.information
2730: 20 74 68 65 79 20 6e 65 65 64 20 66 72 6f 6d 20   they need from 
2740: 61 20 64 6f 63 75 6d 65 6e 74 2e 20 20 44 65 76  a document.  Dev
2750: 65 6c 6f 70 65 72 73 20 77 72 69 74 65 20 53 51  elopers write SQ
2760: 4c 20 74 68 61 74 0a 65 78 70 72 65 73 73 65 73  L that.expresses
2770: 20 22 77 68 61 74 22 20 69 6e 66 6f 72 6d 61 74   "what" informat
2780: 69 6f 6e 20 74 68 65 79 20 77 61 6e 74 20 61 6e  ion they want an
2790: 64 20 6c 65 74 20 74 68 65 20 64 61 74 61 62 61  d let the databa
27a0: 73 65 20 65 6e 67 69 6e 65 0a 74 6f 20 66 69 67  se engine.to fig
27b0: 75 72 65 20 6f 75 74 20 68 6f 77 20 74 6f 20 62  ure out how to b
27c0: 65 73 74 20 72 65 74 72 69 65 76 65 20 74 68 61  est retrieve tha
27d0: 74 20 63 6f 6e 74 65 6e 74 2e 20 20 54 68 69 73  t content.  This
27e0: 20 68 65 6c 70 73 20 64 65 76 65 6c 6f 70 65 72   helps developer
27f0: 73 0a 6f 70 65 72 61 74 65 20 22 68 65 61 64 73  s.operate "heads
2800: 20 75 70 22 20 61 6e 64 20 72 65 6d 61 69 6e 20   up" and remain 
2810: 66 6f 63 75 73 65 64 20 6f 6e 20 73 6f 6c 76 69  focused on solvi
2820: 6e 67 20 74 68 65 20 75 73 65 72 27 73 20 70 72  ng the user's pr
2830: 6f 62 6c 65 6d 2c 0a 61 6e 64 20 61 76 6f 69 64  oblem,.and avoid
2840: 20 74 69 6d 65 20 73 70 65 6e 74 20 22 68 65 61   time spent "hea
2850: 64 73 20 64 6f 77 6e 22 20 66 69 64 64 6c 69 6e  ds down" fiddlin
2860: 67 20 77 69 74 68 20 6c 6f 77 2d 6c 65 76 65 6c  g with low-level
2870: 20 66 69 6c 65 0a 66 6f 72 6d 61 74 74 69 6e 67   file.formatting
2880: 20 64 65 74 61 69 6c 73 2e 0a 0a 3c 70 3e 41 20   details...<p>A 
2890: 70 69 6c 65 2d 6f 66 2d 66 69 6c 65 73 20 66 6f  pile-of-files fo
28a0: 72 6d 61 74 20 63 61 6e 20 62 65 20 76 69 65 77  rmat can be view
28b0: 65 64 20 61 73 20 61 20 6b 65 79 2f 76 61 6c 75  ed as a key/valu
28c0: 65 20 64 61 74 61 62 61 73 65 2e 20 20 0a 41 20  e database.  .A 
28d0: 6b 65 79 2f 76 61 6c 75 65 20 64 61 74 61 62 61  key/value databa
28e0: 73 65 20 69 73 20 62 65 74 74 65 72 20 74 68 61  se is better tha
28f0: 6e 20 6e 6f 20 64 61 74 61 62 61 73 65 20 61 74  n no database at
2900: 20 61 6c 6c 2e 0a 42 75 74 20 77 69 74 68 6f 75   all..But withou
2910: 74 20 74 72 61 6e 73 61 63 74 69 6f 6e 73 20 6f  t transactions o
2920: 72 20 69 6e 64 69 63 65 73 20 6f 72 20 61 20 68  r indices or a h
2930: 69 67 68 2d 6c 65 76 65 6c 20 71 75 65 72 79 20  igh-level query 
2940: 6c 61 6e 67 75 61 67 65 20 6f 72 0a 61 20 70 72  language or.a pr
2950: 6f 70 65 72 20 73 63 68 65 6d 61 2c 0a 69 74 20  oper schema,.it 
2960: 69 73 20 6d 75 63 68 20 68 61 72 64 65 72 20 61  is much harder a
2970: 6e 64 20 6d 6f 72 65 20 65 72 72 6f 72 20 70 72  nd more error pr
2980: 6f 6e 65 20 74 6f 20 75 73 65 20 61 20 6b 65 79  one to use a key
2990: 2f 76 61 6c 75 65 20 64 61 74 61 62 61 73 65 20  /value database 
29a0: 74 68 61 6e 0a 61 20 72 65 6c 61 74 69 6f 6e 61  than.a relationa
29b0: 6c 20 64 61 74 61 62 61 73 65 2e 0a 0a 3c 6c 69  l database...<li
29c0: 3e 3c 70 3e 3c 62 3e 41 63 63 65 73 73 69 62 6c  ><p><b>Accessibl
29d0: 65 20 43 6f 6e 74 65 6e 74 2e 3c 2f 62 3e 0a 49  e Content.</b>.I
29e0: 6e 66 6f 72 6d 61 74 69 6f 6e 20 68 65 6c 64 20  nformation held 
29f0: 69 6e 20 61 6e 20 53 51 4c 69 74 65 20 64 61 74  in an SQLite dat
2a00: 61 62 61 73 65 20 66 69 6c 65 20 69 73 20 61 63  abase file is ac
2a10: 63 65 73 73 69 62 6c 65 20 75 73 69 6e 67 20 0a  cessible using .
2a20: 63 6f 6d 6d 6f 6e 6c 79 20 61 76 61 69 6c 61 62  commonly availab
2a30: 6c 65 20 6f 70 65 6e 2d 73 6f 75 72 63 65 20 63  le open-source c
2a40: 6f 6d 6d 61 6e 64 2d 6c 69 6e 65 20 74 6f 6f 6c  ommand-line tool
2a50: 73 20 2d 20 74 6f 6f 6c 73 20 74 68 61 74 20 0a  s - tools that .
2a60: 61 72 65 20 69 6e 73 74 61 6c 6c 65 64 20 62 79  are installed by
2a70: 20 64 65 66 61 75 6c 74 20 6f 6e 20 4d 61 63 20   default on Mac 
2a80: 61 6e 64 20 4c 69 6e 75 78 20 73 79 73 74 65 6d  and Linux system
2a90: 73 20 61 6e 64 20 74 68 61 74 20 61 72 65 20 0a  s and that are .
2aa0: 66 72 65 65 6c 79 20 61 76 61 69 6c 61 62 6c 65  freely available
2ab0: 20 61 73 20 61 20 73 65 6c 66 2d 63 6f 6e 74 61   as a self-conta
2ac0: 69 6e 65 64 20 45 58 45 20 66 69 6c 65 20 6f 6e  ined EXE file on
2ad0: 20 57 69 6e 64 6f 77 73 2e 0a 55 6e 6c 69 6b 65   Windows..Unlike
2ae0: 20 63 75 73 74 6f 6d 20 66 69 6c 65 20 66 6f 72   custom file for
2af0: 6d 61 74 73 2c 20 61 70 70 6c 69 63 61 74 69 6f  mats, applicatio
2b00: 6e 2d 73 70 65 63 69 66 69 63 20 70 72 6f 67 72  n-specific progr
2b10: 61 6d 73 20 61 72 65 0a 6e 6f 74 20 72 65 71 75  ams are.not requ
2b20: 69 72 65 64 20 74 6f 20 72 65 61 64 20 6f 72 20  ired to read or 
2b30: 77 72 69 74 65 20 63 6f 6e 74 65 6e 74 20 69 6e  write content in
2b40: 20 61 6e 20 53 51 4c 69 74 65 20 64 61 74 61 62   an SQLite datab
2b50: 61 73 65 2e 0a 41 6e 20 53 51 4c 69 74 65 20 64  ase..An SQLite d
2b60: 61 74 61 62 61 73 65 20 66 69 6c 65 20 69 73 20  atabase file is 
2b70: 6e 6f 74 20 61 6e 20 6f 70 61 71 75 65 20 62 6c  not an opaque bl
2b80: 6f 62 2e 20 20 49 74 20 69 73 20 74 72 75 65 0a  ob.  It is true.
2b90: 74 68 61 74 20 63 6f 6d 6d 61 6e 64 2d 6c 69 6e  that command-lin
2ba0: 65 20 74 6f 6f 6c 73 20 73 75 63 68 20 61 73 20  e tools such as 
2bb0: 74 65 78 74 20 65 64 69 74 6f 72 73 20 6f 72 20  text editors or 
2bc0: 22 67 72 65 70 22 20 6f 72 20 22 61 77 6b 22 20  "grep" or "awk" 
2bd0: 61 72 65 0a 6e 6f 74 20 75 73 65 66 75 6c 20 6f  are.not useful o
2be0: 6e 20 61 6e 20 53 51 4c 69 74 65 20 64 61 74 61  n an SQLite data
2bf0: 62 61 73 65 2c 20 62 75 74 20 74 68 65 20 53 51  base, but the SQ
2c00: 4c 20 71 75 65 72 79 20 6c 61 6e 67 75 61 67 65  L query language
2c10: 20 69 73 20 61 20 6d 75 63 68 0a 6d 6f 72 65 20   is a much.more 
2c20: 70 6f 77 65 72 66 75 6c 20 61 6e 64 20 63 6f 6e  powerful and con
2c30: 76 65 6e 69 65 6e 74 20 77 61 79 20 66 6f 72 20  venient way for 
2c40: 65 78 61 6d 69 6e 69 6e 67 20 74 68 65 20 63 6f  examining the co
2c50: 6e 74 65 6e 74 2c 20 73 6f 20 74 68 65 0a 69 6e  ntent, so the.in
2c60: 61 62 69 6c 69 74 79 20 74 6f 20 75 73 65 20 22  ability to use "
2c70: 67 72 65 70 22 20 61 6e 64 20 22 61 77 6b 22 20  grep" and "awk" 
2c80: 61 6e 64 20 74 68 65 20 6c 69 6b 65 20 69 73 20  and the like is 
2c90: 6e 6f 74 20 73 65 65 6e 20 61 73 20 61 20 6c 6f  not seen as a lo
2ca0: 73 73 2e 0a 0a 3c 70 3e 41 6e 20 53 51 4c 69 74  ss...<p>An SQLit
2cb0: 65 20 64 61 74 61 62 61 73 65 20 69 73 20 61 20  e database is a 
2cc0: 5b 66 69 6c 65 20 66 6f 72 6d 61 74 20 7c 20 77  [file format | w
2cd0: 65 6c 6c 2d 64 65 66 69 6e 65 64 20 61 6e 64 20  ell-defined and 
2ce0: 77 65 6c 6c 2d 64 6f 63 75 6d 65 6e 74 65 64 5d  well-documented]
2cf0: 0a 66 69 6c 65 20 66 6f 72 6d 61 74 20 74 68 61  .file format tha
2d00: 74 20 69 73 20 69 6e 20 77 69 64 65 73 70 72 65  t is in widespre
2d10: 61 64 20 75 73 65 20 62 79 20 6c 69 74 65 72 61  ad use by litera
2d20: 6c 6c 79 20 6d 69 6c 6c 69 6f 6e 73 20 6f 66 20  lly millions of 
2d30: 61 70 70 6c 69 63 61 74 69 6f 6e 73 0a 61 6e 64  applications.and
2d40: 20 69 73 20 62 61 63 6b 77 61 72 64 73 20 63 6f   is backwards co
2d50: 6d 70 61 74 69 62 6c 65 20 74 6f 20 69 74 73 20  mpatible to its 
2d60: 69 6e 63 65 70 74 69 6f 6e 20 69 6e 20 32 30 30  inception in 200
2d70: 34 20 61 6e 64 20 77 68 69 63 68 20 70 72 6f 6d  4 and which prom
2d80: 69 73 65 73 0a 74 6f 20 63 6f 6e 74 69 6e 75 65  ises.to continue
2d90: 20 74 6f 20 62 65 20 63 6f 6d 70 61 74 69 62 6c   to be compatibl
2da0: 65 20 69 6e 20 64 65 63 61 64 65 73 20 74 6f 20  e in decades to 
2db0: 63 6f 6d 65 2e 20 20 54 68 65 20 6c 6f 6e 67 65  come.  The longe
2dc0: 76 69 74 79 20 6f 66 0a 53 51 4c 69 74 65 20 64  vity of.SQLite d
2dd0: 61 74 61 62 61 73 65 20 66 69 6c 65 73 20 69 73  atabase files is
2de0: 20 70 61 72 74 69 63 75 6c 61 72 6c 79 20 69 6d   particularly im
2df0: 70 6f 72 74 61 6e 74 20 74 6f 20 62 65 73 70 6f  portant to bespo
2e00: 6b 65 20 61 70 70 6c 69 63 61 74 69 6f 6e 73 2c  ke applications,
2e10: 0a 73 69 6e 63 65 20 69 74 20 61 6c 6c 6f 77 73  .since it allows
2e20: 20 74 68 65 20 64 6f 63 75 6d 65 6e 74 20 63 6f   the document co
2e30: 6e 74 65 6e 74 20 74 6f 20 62 65 20 61 63 63 65  ntent to be acce
2e40: 73 73 65 64 20 66 61 72 20 69 6e 20 74 68 65 0a  ssed far in the.
2e50: 66 75 74 75 72 65 2c 20 6c 6f 6e 67 20 61 66 74  future, long aft
2e60: 65 72 20 61 6c 6c 20 74 72 61 63 65 73 20 6f 66  er all traces of
2e70: 20 74 68 65 20 6f 72 69 67 69 6e 61 6c 20 61 70   the original ap
2e80: 70 6c 69 63 61 74 69 6f 6e 20 68 61 76 65 20 62  plication have b
2e90: 65 65 6e 20 6c 6f 73 74 2e 0a 44 61 74 61 20 6c  een lost..Data l
2ea0: 69 76 65 73 20 6c 6f 6e 67 65 72 20 74 68 61 6e  ives longer than
2eb0: 20 63 6f 64 65 2e 0a 53 51 4c 69 74 65 20 64 61   code..SQLite da
2ec0: 74 61 62 61 73 65 73 20 61 72 65 20 5b 72 65 63  tabases are [rec
2ed0: 6f 6d 6d 65 6e 64 65 64 20 62 79 20 74 68 65 20  ommended by the 
2ee0: 55 53 20 4c 69 62 72 61 72 79 20 6f 66 20 43 6f  US Library of Co
2ef0: 6e 67 72 65 73 73 5d 0a 61 73 20 61 20 73 74 6f  ngress].as a sto
2f00: 72 61 67 65 20 66 6f 72 6d 61 74 20 66 6f 72 20  rage format for 
2f10: 6c 6f 6e 67 2d 74 65 72 6d 20 70 72 65 73 65 72  long-term preser
2f20: 76 61 74 69 6f 6e 20 6f 66 20 64 69 67 69 74 61  vation of digita
2f30: 6c 20 63 6f 6e 74 65 6e 74 2e 0a 0a 0a 3c 6c 69  l content....<li
2f40: 3e 3c 70 3e 3c 62 3e 43 72 6f 73 73 2d 50 6c 61  ><p><b>Cross-Pla
2f50: 74 66 6f 72 6d 2e 3c 2f 62 3e 0a 53 51 4c 69 74  tform.</b>.SQLit
2f60: 65 20 64 61 74 61 62 61 73 65 20 66 69 6c 65 73  e database files
2f70: 20 61 72 65 20 70 6f 72 74 61 62 6c 65 20 62 65   are portable be
2f80: 74 77 65 65 6e 20 33 32 2d 62 69 74 20 61 6e 64  tween 32-bit and
2f90: 20 36 34 2d 62 69 74 20 6d 61 63 68 69 6e 65 73   64-bit machines
2fa0: 20 61 6e 64 0a 62 65 74 77 65 65 6e 20 62 69 67   and.between big
2fb0: 2d 65 6e 64 69 61 6e 20 61 6e 64 20 6c 69 74 74  -endian and litt
2fc0: 6c 65 2d 65 6e 64 69 61 6e 20 61 72 63 68 69 74  le-endian archit
2fd0: 65 63 74 75 72 65 73 20 61 6e 64 20 62 65 74 77  ectures and betw
2fe0: 65 65 6e 20 61 6e 79 20 6f 66 20 74 68 65 0a 76  een any of the.v
2ff0: 61 72 69 6f 75 73 20 66 6c 61 76 6f 72 73 20 6f  arious flavors o
3000: 66 20 57 69 6e 64 6f 77 73 20 61 6e 64 20 55 6e  f Windows and Un
3010: 69 78 2d 6c 69 6b 65 20 6f 70 65 72 61 74 69 6e  ix-like operatin
3020: 67 20 73 79 73 74 65 6d 73 2e 0a 54 68 65 20 61  g systems..The a
3030: 70 70 6c 69 63 61 74 69 6f 6e 20 75 73 69 6e 67  pplication using
3040: 20 61 6e 20 53 51 4c 69 74 65 20 61 70 70 6c 69   an SQLite appli
3050: 63 61 74 69 6f 6e 20 66 69 6c 65 20 66 6f 72 6d  cation file form
3060: 61 74 20 63 61 6e 20 73 74 6f 72 65 0a 62 69 6e  at can store.bin
3070: 61 72 79 20 6e 75 6d 65 72 69 63 20 64 61 74 61  ary numeric data
3080: 20 77 69 74 68 6f 75 74 20 68 61 76 69 6e 67 20   without having 
3090: 74 6f 20 77 6f 72 72 79 20 61 62 6f 75 74 20 74  to worry about t
30a0: 68 65 20 62 79 74 65 2d 6f 72 64 65 72 20 6f 66  he byte-order of
30b0: 0a 69 6e 74 65 67 65 72 73 20 6f 72 20 66 6c 6f  .integers or flo
30c0: 61 74 69 6e 67 20 70 6f 69 6e 74 20 6e 75 6d 62  ating point numb
30d0: 65 72 73 2e 0a 54 65 78 74 20 63 6f 6e 74 65 6e  ers..Text conten
30e0: 74 20 63 61 6e 20 62 65 20 72 65 61 64 20 6f 72  t can be read or
30f0: 20 77 72 69 74 74 65 6e 20 61 73 20 55 54 46 2d   written as UTF-
3100: 38 2c 20 55 54 46 2d 31 36 4c 45 2c 20 6f 72 20  8, UTF-16LE, or 
3110: 55 54 46 2d 31 36 42 45 20 61 6e 64 20 0a 53 51  UTF-16BE and .SQ
3120: 4c 69 74 65 20 77 69 6c 6c 20 61 75 74 6f 6d 61  Lite will automa
3130: 74 69 63 61 6c 6c 79 20 70 65 72 66 6f 72 6d 20  tically perform 
3140: 61 6e 79 20 6e 65 63 65 73 73 61 72 79 20 74 72  any necessary tr
3150: 61 6e 73 6c 61 74 69 6f 6e 73 20 6f 6e 2d 74 68  anslations on-th
3160: 65 2d 66 6c 79 2e 0a 0a 3c 6c 69 3e 3c 70 3e 3c  e-fly...<li><p><
3170: 62 3e 41 74 6f 6d 69 63 20 54 72 61 6e 73 61 63  b>Atomic Transac
3180: 74 69 6f 6e 73 2e 3c 2f 62 3e 0a 57 72 69 74 65  tions.</b>.Write
3190: 73 20 74 6f 20 61 6e 20 53 51 4c 69 74 65 20 64  s to an SQLite d
31a0: 61 74 61 62 61 73 65 20 61 72 65 20 5b 61 74 6f  atabase are [ato
31b0: 6d 69 63 20 63 6f 6d 6d 69 74 20 7c 20 61 74 6f  mic commit | ato
31c0: 6d 69 63 5d 2e 20 20 0a 54 68 65 79 20 65 69 74  mic].  .They eit
31d0: 68 65 72 20 68 61 70 70 65 6e 20 63 6f 6d 70 6c  her happen compl
31e0: 65 74 65 6c 79 0a 6f 72 20 6e 6f 74 20 61 74 20  etely.or not at 
31f0: 61 6c 6c 2c 20 65 76 65 6e 20 64 75 72 69 6e 67  all, even during
3200: 20 73 79 73 74 65 6d 20 63 72 61 73 68 65 73 20   system crashes 
3210: 6f 72 20 70 6f 77 65 72 20 66 61 69 6c 75 72 65  or power failure
3220: 73 2e 20 20 53 6f 0a 74 68 65 72 65 20 69 73 20  s.  So.there is 
3230: 6e 6f 20 64 61 6e 67 65 72 20 6f 66 20 63 6f 72  no danger of cor
3240: 72 75 70 74 69 6e 67 20 61 20 64 6f 63 75 6d 65  rupting a docume
3250: 6e 74 20 6a 75 73 74 20 62 65 63 61 75 73 65 20  nt just because 
3260: 74 68 65 20 70 6f 77 65 72 20 68 61 70 70 65 6e  the power happen
3270: 65 64 0a 74 6f 20 67 6f 20 6f 75 74 20 61 74 20  ed.to go out at 
3280: 74 68 65 20 73 61 6d 65 20 69 6e 73 74 61 6e 74  the same instant
3290: 20 74 68 61 74 20 61 20 63 68 61 6e 67 65 20 77   that a change w
32a0: 61 73 20 62 65 69 6e 67 20 77 72 69 74 74 65 6e  as being written
32b0: 20 74 6f 20 64 69 73 6b 2e 0a 0a 3c 70 3e 53 51   to disk...<p>SQ
32c0: 4c 69 74 65 20 69 73 20 74 72 61 6e 73 61 63 74  Lite is transact
32d0: 69 6f 6e 61 6c 2c 20 6d 65 61 6e 69 6e 67 20 74  ional, meaning t
32e0: 68 61 74 20 6d 75 6c 74 69 70 6c 65 20 63 68 61  hat multiple cha
32f0: 6e 67 65 73 20 63 61 6e 20 62 65 20 67 72 6f 75  nges can be grou
3300: 70 65 64 0a 74 6f 67 65 74 68 65 72 20 73 75 63  ped.together suc
3310: 68 20 74 68 61 74 20 65 69 74 68 65 72 20 61 6c  h that either al
3320: 6c 20 6f 72 20 6e 6f 6e 65 20 6f 66 20 74 68 65  l or none of the
3330: 6d 20 6f 63 63 75 72 2c 20 61 6e 64 20 73 6f 20  m occur, and so 
3340: 74 68 61 74 20 74 68 65 0a 63 68 61 6e 67 65 73  that the.changes
3350: 20 63 61 6e 20 62 65 20 72 6f 6c 6c 65 64 20 62   can be rolled b
3360: 61 63 6b 20 69 66 20 61 20 70 72 6f 62 6c 65 6d  ack if a problem
3370: 20 69 73 20 66 6f 75 6e 64 20 70 72 69 6f 72 20   is found prior 
3380: 74 6f 20 63 6f 6d 6d 69 74 2e 0a 54 68 69 73 20  to commit..This 
3390: 61 6c 6c 6f 77 73 20 61 6e 20 61 70 70 6c 69 63  allows an applic
33a0: 61 74 69 6f 6e 20 74 6f 20 6d 61 6b 65 20 61 20  ation to make a 
33b0: 63 68 61 6e 67 65 20 69 6e 63 72 65 6d 65 6e 74  change increment
33c0: 61 6c 6c 79 2c 20 74 68 65 6e 20 72 75 6e 0a 76  ally, then run.v
33d0: 61 72 69 6f 75 73 20 73 61 6e 69 74 79 20 61 6e  arious sanity an
33e0: 64 20 63 6f 6e 73 69 73 74 65 6e 63 79 20 63 68  d consistency ch
33f0: 65 63 6b 73 20 6f 6e 20 74 68 65 20 72 65 73 75  ecks on the resu
3400: 6c 74 69 6e 67 20 64 61 74 61 20 70 72 69 6f 72  lting data prior
3410: 20 74 6f 0a 63 6f 6d 6d 69 74 74 69 6e 67 20 74   to.committing t
3420: 68 65 20 63 68 61 6e 67 65 73 20 74 6f 20 64 69  he changes to di
3430: 73 6b 2e 20 20 54 68 65 0a 5b 68 74 74 70 3a 2f  sk.  The.[http:/
3440: 2f 77 77 77 2e 66 6f 73 73 69 6c 2d 73 63 6d 2e  /www.fossil-scm.
3450: 6f 72 67 2f 20 7c 20 46 6f 73 73 69 6c 5d 20 44  org/ | Fossil] D
3460: 56 43 53 20 0a 5b 68 74 74 70 3a 2f 2f 77 77 77  VCS .[http://www
3470: 2e 66 6f 73 73 69 6c 2d 73 63 6d 2e 6f 72 67 2f  .fossil-scm.org/
3480: 66 6f 73 73 69 6c 2f 64 6f 63 2f 74 69 70 2f 77  fossil/doc/tip/w
3490: 77 77 2f 73 65 6c 66 63 68 65 63 6b 2e 77 69 6b  ww/selfcheck.wik
34a0: 69 7c 75 73 65 73 20 74 68 69 73 20 74 65 63 68  i|uses this tech
34b0: 6e 69 71 75 65 5d 0a 74 6f 20 76 65 72 69 66 79  nique].to verify
34c0: 20 74 68 61 74 20 6e 6f 20 72 65 70 6f 73 69 74   that no reposit
34d0: 6f 72 79 20 68 69 73 74 6f 72 79 20 68 61 73 20  ory history has 
34e0: 62 65 65 6e 20 6c 6f 73 74 20 70 72 69 6f 72 20  been lost prior 
34f0: 74 6f 20 65 61 63 68 20 63 68 61 6e 67 65 2e 0a  to each change..
3500: 0a 3c 6c 69 3e 3c 70 3e 3c 62 3e 49 6e 63 72 65  .<li><p><b>Incre
3510: 6d 65 6e 74 61 6c 20 41 6e 64 20 43 6f 6e 74 69  mental And Conti
3520: 6e 75 6f 75 73 20 55 70 64 61 74 65 73 2e 3c 2f  nuous Updates.</
3530: 62 3e 0a 57 68 65 6e 20 77 72 69 74 69 6e 67 20  b>.When writing 
3540: 74 6f 20 61 6e 20 53 51 4c 69 74 65 20 64 61 74  to an SQLite dat
3550: 61 62 61 73 65 20 66 69 6c 65 2c 20 6f 6e 6c 79  abase file, only
3560: 20 74 68 6f 73 65 20 70 61 72 74 73 20 6f 66 20   those parts of 
3570: 74 68 65 20 66 69 6c 65 20 74 68 61 74 0a 61 63  the file that.ac
3580: 74 75 61 6c 6c 79 20 63 68 61 6e 67 65 20 61 72  tually change ar
3590: 65 20 77 72 69 74 74 65 6e 20 6f 75 74 20 74 6f  e written out to
35a0: 20 64 69 73 6b 2e 20 20 54 68 69 73 20 6d 61 6b   disk.  This mak
35b0: 65 73 20 74 68 65 20 77 72 69 74 69 6e 67 20 68  es the writing h
35c0: 61 70 70 65 6e 20 66 61 73 74 65 72 0a 61 6e 64  appen faster.and
35d0: 20 73 61 76 65 73 20 77 65 61 72 20 6f 6e 20 53   saves wear on S
35e0: 53 44 73 2e 20 20 54 68 69 73 20 69 73 20 61 6e  SDs.  This is an
35f0: 20 65 6e 6f 72 6d 6f 75 73 20 61 64 76 61 6e 74   enormous advant
3600: 61 67 65 20 6f 76 65 72 20 63 75 73 74 6f 6d 0a  age over custom.
3610: 61 6e 64 20 77 72 61 70 70 65 64 20 70 69 6c 65  and wrapped pile
3620: 2d 6f 66 2d 66 69 6c 65 73 20 66 6f 72 6d 61 74  -of-files format
3630: 73 2c 20 62 6f 74 68 20 6f 66 20 77 68 69 63 68  s, both of which
3640: 20 75 73 75 61 6c 6c 79 20 72 65 71 75 69 72 65   usually require
3650: 20 61 0a 72 65 77 72 69 74 65 20 6f 66 20 74 68   a.rewrite of th
3660: 65 20 65 6e 74 69 72 65 20 64 6f 63 75 6d 65 6e  e entire documen
3670: 74 20 69 6e 20 6f 72 64 65 72 20 74 6f 20 63 68  t in order to ch
3680: 61 6e 67 65 20 61 20 73 69 6e 67 6c 65 20 62 79  ange a single by
3690: 74 65 2e 20 20 0a 50 75 72 65 20 70 69 6c 65 2d  te.  .Pure pile-
36a0: 6f 66 2d 66 69 6c 65 73 20 66 6f 72 6d 61 74 73  of-files formats
36b0: 20 63 61 6e 20 61 6c 73 6f 0a 64 6f 20 69 6e 63   can also.do inc
36c0: 72 65 6d 65 6e 74 61 6c 20 75 70 64 61 74 65 73  remental updates
36d0: 20 74 6f 20 73 6f 6d 65 20 65 78 74 65 6e 74 2c   to some extent,
36e0: 20 74 68 6f 75 67 68 20 74 68 65 20 67 72 61 6e   though the gran
36f0: 75 6c 61 72 69 74 79 20 6f 66 20 77 72 69 74 65  ularity of write
3700: 73 20 69 73 20 0a 75 73 75 61 6c 6c 79 20 6c 61  s is .usually la
3710: 72 67 65 72 20 77 69 74 68 20 70 69 6c 65 2d 6f  rger with pile-o
3720: 66 2d 66 69 6c 65 20 66 6f 72 6d 61 74 73 20 28  f-file formats (
3730: 61 20 73 69 6e 67 6c 65 20 66 69 6c 65 29 20 74  a single file) t
3740: 68 61 6e 20 77 69 74 68 20 53 51 4c 69 74 65 0a  han with SQLite.
3750: 28 61 20 73 69 6e 67 6c 65 20 70 61 67 65 29 2e  (a single page).
3760: 0a 0a 3c 70 3e 53 51 4c 69 74 65 20 61 6c 73 6f  ..<p>SQLite also
3770: 20 73 75 70 70 6f 72 74 73 20 63 6f 6e 74 69 6e   supports contin
3780: 75 6f 75 73 20 75 70 64 61 74 65 2e 0a 49 6e 73  uous update..Ins
3790: 74 65 61 64 20 6f 66 20 63 6f 6c 6c 65 63 74 69  tead of collecti
37a0: 6e 67 20 63 68 61 6e 67 65 73 20 69 6e 20 6d 65  ng changes in me
37b0: 6d 6f 72 79 20 61 6e 64 20 74 68 65 6e 20 77 72  mory and then wr
37c0: 69 74 69 6e 67 0a 74 68 65 6d 20 74 6f 20 64 69  iting.them to di
37d0: 73 6b 20 6f 6e 6c 79 20 6f 6e 20 61 20 46 69 6c  sk only on a Fil
37e0: 65 2f 53 61 76 65 20 61 63 74 69 6f 6e 2c 20 63  e/Save action, c
37f0: 68 61 6e 67 65 73 20 63 61 6e 20 62 65 20 77 72  hanges can be wr
3800: 69 74 74 65 6e 20 62 61 63 6b 20 74 6f 0a 74 68  itten back to.th
3810: 65 20 64 69 73 6b 20 61 73 20 74 68 65 79 20 6f  e disk as they o
3820: 63 63 75 72 2e 20 20 54 68 69 73 20 61 76 6f 69  ccur.  This avoi
3830: 64 73 20 6c 6f 73 73 20 6f 66 20 77 6f 72 6b 20  ds loss of work 
3840: 6f 6e 20 61 20 73 79 73 74 65 6d 20 63 72 61 73  on a system cras
3850: 68 20 6f 72 0a 70 6f 77 65 72 20 66 61 69 6c 75  h or.power failu
3860: 72 65 2e 20 20 41 6e 20 5b 61 75 74 6f 6d 61 74  re.  An [automat
3870: 65 64 20 75 6e 64 6f 2f 72 65 64 6f 20 73 74 61  ed undo/redo sta
3880: 63 6b 5d 2c 20 6d 61 6e 61 67 65 64 20 75 73 69  ck], managed usi
3890: 6e 67 20 74 72 69 67 67 65 72 73 2c 0a 63 61 6e  ng triggers,.can
38a0: 20 62 65 20 6b 65 70 74 20 69 6e 20 74 68 65 20   be kept in the 
38b0: 6f 6e 2d 64 69 73 6b 20 64 61 74 61 62 61 73 65  on-disk database
38c0: 2c 20 6d 65 61 6e 69 6e 67 20 74 68 61 74 20 75  , meaning that u
38d0: 6e 64 6f 2f 72 65 64 6f 20 63 61 6e 20 6f 63 63  ndo/redo can occ
38e0: 75 72 20 0a 61 63 72 6f 73 73 20 73 65 73 73 69  ur .across sessi
38f0: 6f 6e 20 62 6f 75 6e 64 61 72 69 65 73 2e 0a 0a  on boundaries...
3900: 3c 6c 69 3e 3c 70 3e 3c 62 3e 45 61 73 69 6c 79  <li><p><b>Easily
3910: 20 45 78 74 65 6e 73 69 62 6c 65 2e 3c 2f 62 3e   Extensible.</b>
3920: 0a 41 73 20 61 6e 20 61 70 70 6c 69 63 61 74 69  .As an applicati
3930: 6f 6e 20 67 72 6f 77 73 2c 20 6e 65 77 20 66 65  on grows, new fe
3940: 61 74 75 72 65 73 20 63 61 6e 20 62 65 20 61 64  atures can be ad
3950: 64 65 64 20 74 6f 20 61 6e 0a 53 51 4c 69 74 65  ded to an.SQLite
3960: 20 61 70 70 6c 69 63 61 74 69 6f 6e 20 66 69 6c   application fil
3970: 65 20 66 6f 72 6d 61 74 20 73 69 6d 70 6c 79 20  e format simply 
3980: 62 79 20 61 64 64 69 6e 67 20 6e 65 77 20 74 61  by adding new ta
3990: 62 6c 65 73 20 74 6f 20 74 68 65 20 73 63 68 65  bles to the sche
39a0: 6d 61 0a 6f 72 20 62 79 20 61 64 64 69 6e 67 20  ma.or by adding 
39b0: 6e 65 77 20 63 6f 6c 75 6d 6e 73 20 74 6f 20 65  new columns to e
39c0: 78 69 73 74 69 6e 67 20 74 61 62 6c 65 73 2e 20  xisting tables. 
39d0: 20 41 64 64 69 6e 67 20 63 6f 6c 75 6d 6e 73 20   Adding columns 
39e0: 6f 72 20 74 61 62 6c 65 73 0a 64 6f 65 73 20 6e  or tables.does n
39f0: 6f 74 20 63 68 61 6e 67 65 20 74 68 65 20 6d 65  ot change the me
3a00: 61 6e 69 6e 67 20 6f 66 20 70 72 69 6f 72 20 71  aning of prior q
3a10: 75 65 72 69 65 73 2c 20 73 6f 20 77 69 74 68 20  ueries, so with 
3a20: 61 20 0a 6d 6f 64 69 63 75 6d 20 6f 66 20 63 61  a .modicum of ca
3a30: 72 65 20 74 6f 20 65 6e 73 75 72 69 6e 67 20 74  re to ensuring t
3a40: 68 61 74 20 74 68 65 20 6d 65 61 6e 69 6e 67 20  hat the meaning 
3a50: 6f 66 20 6c 65 67 61 63 79 20 63 6f 6c 75 6d 6e  of legacy column
3a60: 73 20 61 6e 64 0a 74 61 62 6c 65 73 20 61 72 65  s and.tables are
3a70: 20 70 72 65 73 65 72 76 65 64 2c 20 62 61 63 6b   preserved, back
3a80: 77 61 72 64 73 20 63 6f 6d 70 61 74 69 62 69 6c  wards compatibil
3a90: 69 74 79 20 69 73 20 6d 61 69 6e 74 61 69 6e 65  ity is maintaine
3aa0: 64 2e 0a 0a 3c 70 3e 49 74 20 69 73 20 70 6f 73  d...<p>It is pos
3ab0: 73 69 62 6c 65 20 74 6f 20 65 78 74 65 6e 64 20  sible to extend 
3ac0: 63 75 73 74 6f 6d 20 6f 72 20 70 69 6c 65 2d 6f  custom or pile-o
3ad0: 66 2d 66 69 6c 65 73 20 66 6f 72 6d 61 74 73 20  f-files formats 
3ae0: 74 6f 6f 2c 20 6f 66 20 63 6f 75 72 73 65 2c 0a  too, of course,.
3af0: 62 75 74 20 64 6f 69 6e 67 20 69 73 20 6f 66 74  but doing is oft
3b00: 65 6e 20 6d 75 63 68 20 68 61 72 64 65 72 2e 20  en much harder. 
3b10: 20 49 66 20 69 6e 64 69 63 65 73 20 61 72 65 20   If indices are 
3b20: 61 64 64 65 64 2c 20 74 68 65 6e 20 61 6c 6c 20  added, then all 
3b30: 61 70 70 6c 69 63 61 74 69 6f 6e 0a 63 6f 64 65  application.code
3b40: 20 74 68 61 74 20 63 68 61 6e 67 65 73 20 74 68   that changes th
3b50: 65 20 63 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20  e corresponding 
3b60: 74 61 62 6c 65 73 20 6d 75 73 74 20 62 65 20 6c  tables must be l
3b70: 6f 63 61 74 65 64 20 61 6e 64 20 6d 6f 64 69 66  ocated and modif
3b80: 69 65 64 20 74 6f 0a 6b 65 65 70 20 74 68 6f 73  ied to.keep thos
3b90: 65 20 69 6e 64 69 63 65 73 20 75 70 2d 74 6f 2d  e indices up-to-
3ba0: 64 61 74 65 2e 20 20 49 66 20 63 6f 6c 75 6d 6e  date.  If column
3bb0: 73 20 61 72 65 20 61 64 64 65 64 2c 20 74 68 65  s are added, the
3bc0: 6e 20 61 6c 6c 20 61 70 70 6c 69 63 61 74 69 6f  n all applicatio
3bd0: 6e 0a 63 6f 64 65 20 74 68 61 74 20 61 63 63 65  n.code that acce
3be0: 73 73 65 73 20 74 68 65 20 63 6f 72 72 65 73 70  sses the corresp
3bf0: 6f 6e 64 69 6e 67 20 74 61 62 6c 65 20 6d 75 73  onding table mus
3c00: 74 20 62 65 20 6c 6f 63 61 74 65 64 20 61 6e 64  t be located and
3c10: 20 6d 6f 64 69 66 69 65 64 20 74 6f 20 0a 74 61   modified to .ta
3c20: 6b 65 20 69 6e 74 6f 20 61 63 63 6f 75 6e 74 20  ke into account 
3c30: 74 68 65 20 6e 65 77 20 63 6f 6c 75 6d 6e 73 2e  the new columns.
3c40: 0a 0a 3c 6c 69 3e 3c 70 3e 3c 62 3e 50 65 72 66  ..<li><p><b>Perf
3c50: 6f 72 6d 61 6e 63 65 2e 3c 2f 62 3e 0a 49 6e 20  ormance.</b>.In 
3c60: 6d 61 6e 79 20 63 61 73 65 73 2c 20 61 6e 20 53  many cases, an S
3c70: 51 4c 69 74 65 20 61 70 70 6c 69 63 61 74 69 6f  QLite applicatio
3c80: 6e 20 66 69 6c 65 20 66 6f 72 6d 61 74 20 77 69  n file format wi
3c90: 6c 6c 20 62 65 20 0a 5b 66 61 73 74 65 72 20 74  ll be .[faster t
3ca0: 68 61 6e 20 74 68 65 20 66 69 6c 65 73 79 73 74  han the filesyst
3cb0: 65 6d 7c 66 61 73 74 65 72 20 74 68 61 6e 20 61  em|faster than a
3cc0: 20 70 69 6c 65 2d 6f 66 2d 66 69 6c 65 73 20 66   pile-of-files f
3cd0: 6f 72 6d 61 74 5d 20 6f 72 0a 61 20 63 75 73 74  ormat] or.a cust
3ce0: 6f 6d 20 66 6f 72 6d 61 74 2e 20 20 49 6e 20 61  om format.  In a
3cf0: 64 64 69 74 69 6f 6e 20 74 6f 20 62 65 69 6e 67  ddition to being
3d00: 20 66 61 73 74 65 72 20 66 6f 72 20 72 61 77 20   faster for raw 
3d10: 72 65 61 64 20 61 6e 64 0a 77 72 69 74 65 73 2c  read and.writes,
3d20: 20 53 51 4c 69 74 65 20 63 61 6e 20 6f 66 74 65   SQLite can ofte
3d30: 6e 20 64 72 61 6d 61 74 69 63 61 6c 6c 79 20 69  n dramatically i
3d40: 6d 70 72 6f 76 65 73 20 73 74 61 72 74 2d 75 70  mproves start-up
3d50: 20 74 69 6d 65 73 20 62 65 63 61 75 73 65 20 0a   times because .
3d60: 69 6e 73 74 65 61 64 20 6f 66 20 68 61 76 69 6e  instead of havin
3d70: 67 20 74 6f 0a 72 65 61 64 20 61 6e 64 20 70 61  g to.read and pa
3d80: 72 73 65 20 74 68 65 20 65 6e 74 69 72 65 20 64  rse the entire d
3d90: 6f 63 75 6d 65 6e 74 20 69 6e 74 6f 20 6d 65 6d  ocument into mem
3da0: 6f 72 79 2c 20 74 68 65 20 61 70 70 6c 69 63 61  ory, the applica
3db0: 74 69 6f 6e 20 63 61 6e 0a 64 6f 20 71 75 65 72  tion can.do quer
3dc0: 69 65 73 20 74 6f 20 65 78 74 72 61 63 74 20 6f  ies to extract o
3dd0: 6e 6c 79 20 74 68 65 20 69 6e 66 6f 72 6d 61 74  nly the informat
3de0: 69 6f 6e 20 6e 65 65 64 65 64 20 66 6f 72 20 74  ion needed for t
3df0: 68 65 20 69 6e 69 74 69 61 6c 20 73 63 72 65 65  he initial scree
3e00: 6e 2e 0a 41 73 20 74 68 65 20 61 70 70 6c 69 63  n..As the applic
3e10: 61 74 69 6f 6e 20 70 72 6f 67 72 65 73 73 65 73  ation progresses
3e20: 2c 20 69 74 20 6f 6e 6c 79 20 6e 65 65 64 73 20  , it only needs 
3e30: 74 6f 20 6c 6f 61 64 20 61 73 20 6d 75 63 68 20  to load as much 
3e40: 6d 61 74 65 72 69 61 6c 20 61 73 0a 69 73 20 6e  material as.is n
3e50: 65 65 64 65 64 20 74 6f 20 64 72 61 77 20 74 68  eeded to draw th
3e60: 65 20 6e 65 78 74 20 73 63 72 65 65 6e 2c 20 61  e next screen, a
3e70: 6e 64 20 63 61 6e 20 64 69 73 63 61 72 64 20 69  nd can discard i
3e80: 6e 66 6f 72 6d 61 74 69 6f 6e 20 66 72 6f 6d 0a  nformation from.
3e90: 70 72 69 6f 72 20 73 63 72 65 65 6e 73 20 74 68  prior screens th
3ea0: 61 74 20 69 73 20 6e 6f 20 6c 6f 6e 67 65 72 20  at is no longer 
3eb0: 69 6e 20 75 73 65 2e 20 20 54 68 69 73 20 68 65  in use.  This he
3ec0: 6c 70 73 20 6b 65 65 70 20 74 68 65 20 6d 65 6d  lps keep the mem
3ed0: 6f 72 79 0a 66 6f 6f 74 70 72 69 6e 74 20 6f 66  ory.footprint of
3ee0: 20 74 68 65 20 61 70 70 6c 69 63 61 74 69 6f 6e   the application
3ef0: 20 75 6e 64 65 72 20 63 6f 6e 74 72 6f 6c 2e 0a   under control..
3f00: 0a 3c 70 3e 41 20 70 69 6c 65 2d 6f 66 2d 66 69  .<p>A pile-of-fi
3f10: 6c 65 73 20 66 6f 72 6d 61 74 20 63 61 6e 20 62  les format can b
3f20: 65 20 72 65 61 64 20 69 6e 63 72 65 6d 65 6e 74  e read increment
3f30: 61 6c 6c 79 20 6a 75 73 74 20 6c 69 6b 65 20 53  ally just like S
3f40: 51 4c 69 74 65 2e 0a 42 75 74 20 6d 61 6e 79 20  QLite..But many 
3f50: 64 65 76 65 6c 6f 70 65 72 73 20 61 72 65 20 73  developers are s
3f60: 75 72 70 72 69 73 65 64 20 74 6f 20 6c 65 61 72  urprised to lear
3f70: 6e 20 74 68 61 74 20 53 51 4c 69 74 65 20 63 61  n that SQLite ca
3f80: 6e 20 72 65 61 64 20 61 6e 64 20 0a 77 72 69 74  n read and .writ
3f90: 65 20 73 6d 61 6c 6c 65 72 20 42 4c 4f 42 73 20  e smaller BLOBs 
3fa0: 28 6c 65 73 73 20 74 68 61 6e 20 61 62 6f 75 74  (less than about
3fb0: 20 31 30 30 4b 42 20 69 6e 20 73 69 7a 65 29 20   100KB in size) 
3fc0: 66 72 6f 6d 20 69 74 73 20 64 61 74 61 62 61 73  from its databas
3fd0: 65 20 0a 66 61 73 74 65 72 20 74 68 61 6e 20 74  e .faster than t
3fe0: 68 6f 73 65 20 73 61 6d 65 20 62 6c 6f 62 73 20  hose same blobs 
3ff0: 63 61 6e 20 62 65 20 72 65 61 64 20 6f 72 20 77  can be read or w
4000: 72 69 74 74 65 6e 20 61 73 20 73 65 70 61 72 61  ritten as separa
4010: 74 65 20 66 69 6c 65 73 20 0a 66 72 6f 6d 20 74  te files .from t
4020: 68 65 20 66 69 6c 65 73 79 73 74 65 6d 2e 20 20  he filesystem.  
4030: 28 53 65 65 0a 5b 66 61 73 74 65 72 20 74 68 61  (See.[faster tha
4040: 6e 20 74 68 65 20 66 69 6c 65 73 79 73 74 65 6d  n the filesystem
4050: 7c 33 35 25 20 46 61 73 74 65 72 20 54 68 61 6e  |35% Faster Than
4060: 20 54 68 65 20 46 69 6c 65 73 79 73 74 65 6d 5d   The Filesystem]
4070: 20 61 6e 64 0a 5b 49 6e 74 65 72 6e 61 6c 20 56   and.[Internal V
4080: 65 72 73 75 73 20 45 78 74 65 72 6e 61 6c 20 42  ersus External B
4090: 4c 4f 42 73 5d 20 66 6f 72 20 66 75 72 74 68 65  LOBs] for furthe
40a0: 72 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 2e 29 0a  r information.).
40b0: 54 68 65 72 65 20 69 73 20 6f 76 65 72 68 65 61  There is overhea
40c0: 64 20 61 73 73 6f 63 69 61 74 65 64 20 77 69 74  d associated wit
40d0: 68 20 6f 70 65 72 61 74 69 6e 67 20 61 20 72 65  h operating a re
40e0: 6c 61 74 69 6f 6e 61 6c 0a 64 61 74 61 62 61 73  lational.databas
40f0: 65 20 65 6e 67 69 6e 65 2c 20 68 6f 77 65 76 65  e engine, howeve
4100: 72 20 6f 6e 65 20 73 68 6f 75 6c 64 20 6e 6f 74  r one should not
4110: 20 61 73 73 75 6d 65 20 74 68 61 74 20 64 69 72   assume that dir
4120: 65 63 74 20 66 69 6c 65 20 49 2f 4f 0a 69 73 20  ect file I/O.is 
4130: 66 61 73 74 65 72 20 74 68 61 6e 20 53 51 4c 69  faster than SQLi
4140: 74 65 20 64 61 74 61 62 61 73 65 20 49 2f 4f 2c  te database I/O,
4150: 20 61 73 20 6f 66 74 65 6e 20 69 74 20 69 73 20   as often it is 
4160: 6e 6f 74 2e 0a 0a 3c 70 3e 49 6e 20 65 69 74 68  not...<p>In eith
4170: 65 72 20 63 61 73 65 2c 20 69 66 20 70 65 72 66  er case, if perf
4180: 6f 72 6d 61 6e 63 65 20 70 72 6f 62 6c 65 6d 73  ormance problems
4190: 20 64 6f 20 61 72 69 73 65 20 69 6e 20 61 6e 20   do arise in an 
41a0: 53 51 4c 69 74 65 20 61 70 70 6c 69 63 61 74 69  SQLite applicati
41b0: 6f 6e 20 0a 74 68 6f 73 65 20 70 72 6f 62 6c 65  on .those proble
41c0: 6d 73 20 63 61 6e 20 6f 66 74 65 6e 20 62 65 20  ms can often be 
41d0: 72 65 73 6f 6c 76 65 64 20 62 79 20 61 64 64 69  resolved by addi
41e0: 6e 67 20 6f 6e 65 20 6f 72 20 74 77 6f 20 5b 43  ng one or two [C
41f0: 52 45 41 54 45 20 49 4e 44 45 58 5d 0a 73 74 61  REATE INDEX].sta
4200: 74 65 6d 65 6e 74 73 20 74 6f 20 74 68 65 20 73  tements to the s
4210: 63 68 65 6d 61 20 6f 72 20 70 65 72 68 61 70 73  chema or perhaps
4220: 20 72 75 6e 6e 69 6e 67 20 5b 41 4e 41 4c 59 5a   running [ANALYZ
4230: 45 5d 20 6f 6e 65 20 74 69 6d 65 0a 61 6e 64 20  E] one time.and 
4240: 77 69 74 68 6f 75 74 20 68 61 76 69 6e 67 20 74  without having t
4250: 6f 20 74 6f 75 63 68 20 61 20 73 69 6e 67 6c 65  o touch a single
4260: 20 6c 69 6e 65 20 6f 66 0a 61 70 70 6c 69 63 61   line of.applica
4270: 74 69 6f 6e 20 63 6f 64 65 2e 20 20 42 75 74 20  tion code.  But 
4280: 69 66 20 61 20 70 65 72 66 6f 72 6d 61 6e 63 65  if a performance
4290: 20 70 72 6f 62 6c 65 6d 20 63 6f 6d 65 73 20 75   problem comes u
42a0: 70 20 69 6e 20 61 20 63 75 73 74 6f 6d 20 6f 72  p in a custom or
42b0: 20 0a 70 69 6c 65 2d 6f 66 2d 66 69 6c 65 73 20   .pile-of-files 
42c0: 66 6f 72 6d 61 74 2c 20 74 68 65 20 66 69 78 20  format, the fix 
42d0: 77 69 6c 6c 20 6f 66 74 65 6e 20 72 65 71 75 69  will often requi
42e0: 72 65 20 65 78 74 65 6e 73 69 76 65 20 63 68 61  re extensive cha
42f0: 6e 67 65 73 0a 74 6f 20 61 70 70 6c 69 63 61 74  nges.to applicat
4300: 69 6f 6e 20 63 6f 64 65 20 74 6f 20 61 64 64 20  ion code to add 
4310: 61 6e 64 20 6d 61 69 6e 74 61 69 6e 20 6e 65 77  and maintain new
4320: 20 69 6e 64 69 63 65 73 20 6f 72 20 74 6f 20 65   indices or to e
4330: 78 74 72 61 63 74 20 0a 69 6e 66 6f 72 6d 61 74  xtract .informat
4340: 69 6f 6e 20 75 73 69 6e 67 20 64 69 66 66 65 72  ion using differ
4350: 65 6e 74 20 61 6c 67 6f 72 69 74 68 6d 73 2e 0a  ent algorithms..
4360: 0a 3c 6c 69 3e 3c 70 3e 3c 62 3e 43 6f 6e 63 75  .<li><p><b>Concu
4370: 72 72 65 6e 74 20 55 73 65 20 42 79 20 4d 75 6c  rrent Use By Mul
4380: 74 69 70 6c 65 20 50 72 6f 63 65 73 73 65 73 2e  tiple Processes.
4390: 3c 2f 62 3e 0a 53 51 4c 69 74 65 20 61 75 74 6f  </b>.SQLite auto
43a0: 6d 61 74 69 63 61 6c 6c 79 20 63 6f 6f 72 64 69  matically coordi
43b0: 6e 61 74 65 73 20 63 6f 6e 63 75 72 72 65 6e 74  nates concurrent
43c0: 20 61 63 63 65 73 73 20 74 6f 20 74 68 65 20 73   access to the s
43d0: 61 6d 65 0a 64 6f 63 75 6d 65 6e 74 20 66 72 6f  ame.document fro
43e0: 6d 20 6d 75 6c 74 69 70 6c 65 20 74 68 72 65 61  m multiple threa
43f0: 64 73 20 61 6e 64 2f 6f 72 20 70 72 6f 63 65 73  ds and/or proces
4400: 73 65 73 2e 20 20 54 77 6f 20 6f 72 20 6d 6f 72  ses.  Two or mor
4410: 65 0a 61 70 70 6c 69 63 61 74 69 6f 6e 73 20 63  e.applications c
4420: 61 6e 20 63 6f 6e 6e 65 63 74 20 61 6e 64 20 72  an connect and r
4430: 65 61 64 20 66 72 6f 6d 20 74 68 65 20 73 61 6d  ead from the sam
4440: 65 20 64 6f 63 75 6d 65 6e 74 20 61 74 20 74 68  e document at th
4450: 65 0a 73 61 6d 65 20 74 69 6d 65 2e 20 20 57 72  e.same time.  Wr
4460: 69 74 65 73 20 61 72 65 20 73 65 72 69 61 6c 69  ites are seriali
4470: 7a 65 64 2c 20 62 75 74 20 61 73 20 77 72 69 74  zed, but as writ
4480: 65 73 20 6e 6f 72 6d 61 6c 6c 79 20 6f 6e 6c 79  es normally only
4490: 0a 74 61 6b 65 20 6d 69 6c 6c 69 73 65 63 6f 6e  .take millisecon
44a0: 64 73 2c 20 61 70 70 6c 69 63 61 74 69 6f 6e 73  ds, applications
44b0: 20 73 69 6d 70 6c 79 20 74 61 6b 65 20 74 75 72   simply take tur
44c0: 6e 73 20 77 72 69 74 69 6e 67 2e 0a 53 51 4c 69  ns writing..SQLi
44d0: 74 65 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79  te automatically
44e0: 20 65 6e 73 75 72 65 73 20 74 68 61 74 20 74 68   ensures that th
44f0: 65 20 6c 6f 77 2d 6c 65 76 65 6c 20 66 6f 72 6d  e low-level form
4500: 61 74 20 6f 66 20 74 68 65 0a 64 6f 63 75 6d 65  at of the.docume
4510: 6e 74 20 69 73 20 75 6e 63 6f 72 72 75 70 74 65  nt is uncorrupte
4520: 64 2e 20 20 41 63 63 6f 6d 70 6c 69 73 68 69 6e  d.  Accomplishin
4530: 67 20 74 68 65 20 73 61 6d 65 20 77 69 74 68 20  g the same with 
4540: 61 20 63 75 73 74 6f 6d 0a 6f 72 20 70 69 6c 65  a custom.or pile
4550: 2d 6f 66 2d 66 69 6c 65 73 20 66 6f 72 6d 61 74  -of-files format
4560: 2c 20 69 6e 20 63 6f 6e 74 72 61 73 74 2c 20 72  , in contrast, r
4570: 65 71 75 69 72 65 73 20 65 78 74 65 6e 73 69 76  equires extensiv
4580: 65 20 73 75 70 70 6f 72 74 0a 69 6e 20 74 68 65  e support.in the
4590: 20 61 70 70 6c 69 63 61 74 69 6f 6e 2e 20 20 41   application.  A
45a0: 6e 64 20 74 68 65 20 61 70 70 6c 69 63 61 74 69  nd the applicati
45b0: 6f 6e 20 6c 6f 67 69 63 20 6e 65 65 64 65 64 20  on logic needed 
45c0: 74 6f 20 73 75 70 70 6f 72 74 0a 63 6f 6e 63 75  to support.concu
45d0: 72 72 65 6e 63 79 20 69 73 20 61 20 6e 6f 74 6f  rrency is a noto
45e0: 72 69 6f 75 73 20 62 75 67 2d 6d 61 67 6e 65 74  rious bug-magnet
45f0: 2e 0a 0a 3c 6c 69 3e 3c 70 3e 3c 62 3e 4d 75 6c  ...<li><p><b>Mul
4600: 74 69 70 6c 65 20 50 72 6f 67 72 61 6d 6d 69 6e  tiple Programmin
4610: 67 20 4c 61 6e 67 75 61 67 65 73 2e 3c 2f 62 3e  g Languages.</b>
4620: 0a 54 68 6f 75 67 68 20 53 51 4c 69 74 65 20 69  .Though SQLite i
4630: 73 20 69 74 73 65 6c 66 20 77 72 69 74 74 65 6e  s itself written
4640: 20 69 6e 20 41 4e 53 49 2d 43 2c 20 69 6e 74 65   in ANSI-C, inte
4650: 72 66 61 63 65 73 20 65 78 69 73 74 20 66 6f 72  rfaces exist for
4660: 0a 6a 75 73 74 20 61 62 6f 75 74 20 65 76 65 72  .just about ever
4670: 79 20 6f 74 68 65 72 20 70 72 6f 67 72 61 6d 6d  y other programm
4680: 69 6e 67 20 6c 61 6e 67 75 61 67 65 20 79 6f 75  ing language you
4690: 20 63 61 6e 20 74 68 69 6e 6b 20 6f 66 3a 0a 43   can think of:.C
46a0: 2b 2b 2c 20 43 23 2c 20 4f 62 6a 65 63 74 69 76  ++, C#, Objectiv
46b0: 65 2d 43 2c 20 4a 61 76 61 2c 20 54 63 6c 2c 20  e-C, Java, Tcl, 
46c0: 50 65 72 6c 2c 20 50 79 74 68 6f 6e 2c 20 52 75  Perl, Python, Ru
46d0: 62 79 2c 20 45 72 6c 61 6e 67 2c 0a 4a 61 76 61  by, Erlang,.Java
46e0: 53 63 72 69 70 74 2c 20 61 6e 64 20 73 6f 20 66  Script, and so f
46f0: 6f 72 74 68 2e 20 20 53 6f 20 70 72 6f 67 72 61  orth.  So progra
4700: 6d 6d 65 72 73 20 63 61 6e 20 64 65 76 65 6c 6f  mmers can develo
4710: 70 20 69 6e 20 77 68 61 74 65 76 65 72 0a 6c 61  p in whatever.la
4720: 6e 67 75 61 67 65 20 74 68 65 79 20 61 72 65 20  nguage they are 
4730: 6d 6f 73 74 20 63 6f 6d 66 6f 72 74 61 62 6c 65  most comfortable
4740: 20 77 69 74 68 20 61 6e 64 20 77 68 69 63 68 20   with and which 
4750: 62 65 73 74 20 6d 61 74 63 68 65 73 0a 74 68 65  best matches.the
4760: 20 6e 65 65 64 73 20 6f 66 20 74 68 65 20 70 72   needs of the pr
4770: 6f 6a 65 63 74 2e 0a 0a 3c 70 3e 41 6e 20 53 51  oject...<p>An SQ
4780: 4c 69 74 65 20 61 70 70 6c 69 63 61 74 69 6f 6e  Lite application
4790: 20 66 69 6c 65 20 66 6f 72 6d 61 74 20 69 73 20   file format is 
47a0: 61 20 67 72 65 61 74 20 0a 63 68 6f 69 63 65 20  a great .choice 
47b0: 69 6e 20 63 61 73 65 73 20 77 68 65 72 65 20 74  in cases where t
47c0: 68 65 72 65 20 69 73 20 61 20 63 6f 6c 6c 65 63  here is a collec
47d0: 74 69 6f 6e 20 6f 72 20 22 66 65 64 65 72 61 74  tion or "federat
47e0: 69 6f 6e 22 20 6f 66 0a 73 65 70 61 72 61 74 65  ion" of.separate
47f0: 20 70 72 6f 67 72 61 6d 73 2c 20 6f 66 74 65 6e   programs, often
4800: 20 77 72 69 74 74 65 6e 20 69 6e 20 64 69 66 66   written in diff
4810: 65 72 65 6e 74 20 6c 61 6e 67 75 61 67 65 73 20  erent languages 
4820: 61 6e 64 20 62 79 0a 64 69 66 66 65 72 65 6e 74  and by.different
4830: 20 64 65 76 65 6c 6f 70 6d 65 6e 74 20 74 65 61   development tea
4840: 6d 73 2e 0a 54 68 69 73 20 63 6f 6d 65 73 20 75  ms..This comes u
4850: 70 20 63 6f 6d 6d 6f 6e 6c 79 20 69 6e 20 72 65  p commonly in re
4860: 73 65 61 72 63 68 20 6f 72 20 6c 61 62 6f 72 61  search or labora
4870: 74 6f 72 79 0a 65 6e 76 69 72 6f 6e 6d 65 6e 74  tory.environment
4880: 73 20 77 68 65 72 65 20 6f 6e 65 20 74 65 61 6d  s where one team
4890: 20 69 73 20 72 65 73 70 6f 6e 73 69 62 6c 65 20   is responsible 
48a0: 66 6f 72 20 64 61 74 61 20 61 63 71 75 69 73 69  for data acquisi
48b0: 74 69 6f 6e 0a 61 6e 64 20 6f 74 68 65 72 20 74  tion.and other t
48c0: 65 61 6d 73 20 61 72 65 20 72 65 73 70 6f 6e 73  eams are respons
48d0: 69 62 6c 65 20 66 6f 72 20 76 61 72 69 6f 75 73  ible for various
48e0: 20 73 74 61 67 65 73 20 6f 66 20 61 6e 61 6c 79   stages of analy
48f0: 73 69 73 2e 0a 45 61 63 68 20 74 65 61 6d 20 63  sis..Each team c
4900: 61 6e 20 75 73 65 20 77 68 61 74 65 76 65 72 20  an use whatever 
4910: 68 61 72 64 77 61 72 65 2c 20 6f 70 65 72 61 74  hardware, operat
4920: 69 6e 67 20 73 79 73 74 65 6d 2c 0a 70 72 6f 67  ing system,.prog
4930: 72 61 6d 6d 69 6e 67 20 6c 61 6e 67 75 61 67 65  ramming language
4940: 20 61 6e 64 20 64 65 76 65 6c 6f 70 6d 65 6e 74   and development
4950: 20 6d 65 74 68 6f 64 6f 6c 6f 67 79 20 74 68 61   methodology tha
4960: 74 20 74 68 65 79 20 61 72 65 20 0a 6d 6f 73 74  t they are .most
4970: 20 63 6f 6d 66 6f 72 74 61 62 6c 65 20 77 69 74   comfortable wit
4980: 68 2c 20 61 6e 64 20 61 73 20 6c 6f 6e 67 20 61  h, and as long a
4990: 73 20 61 6c 6c 20 70 72 6f 67 72 61 6d 73 20 75  s all programs u
49a0: 73 65 20 61 6e 20 53 51 4c 69 74 65 20 0a 64 61  se an SQLite .da
49b0: 74 61 62 61 73 65 20 77 69 74 68 20 61 20 63 6f  tabase with a co
49c0: 6d 6d 6f 6e 20 73 63 68 65 6d 61 2c 20 74 68 65  mmon schema, the
49d0: 79 20 63 61 6e 20 61 6c 6c 20 69 6e 74 65 72 6f  y can all intero
49e0: 70 65 72 61 74 65 2e 0a 0a 0a 3c 6c 69 3e 3c 70  perate....<li><p
49f0: 3e 3c 62 3e 42 65 74 74 65 72 20 41 70 70 6c 69  ><b>Better Appli
4a00: 63 61 74 69 6f 6e 73 2e 3c 2f 62 3e 0a 49 66 20  cations.</b>.If 
4a10: 74 68 65 20 61 70 70 6c 69 63 61 74 69 6f 6e 20  the application 
4a20: 66 69 6c 65 20 66 6f 72 6d 61 74 20 69 73 20 61  file format is a
4a30: 6e 20 53 51 4c 69 74 65 20 64 61 74 61 62 61 73  n SQLite databas
4a40: 65 2c 20 74 68 65 20 63 6f 6d 70 6c 65 74 65 0a  e, the complete.
4a50: 64 6f 63 75 6d 65 6e 74 61 74 69 6f 6e 20 66 6f  documentation fo
4a60: 72 20 74 68 61 74 20 66 69 6c 65 20 66 6f 72 6d  r that file form
4a70: 61 74 20 63 6f 6e 73 69 73 74 73 20 6f 66 20 74  at consists of t
4a80: 68 65 20 64 61 74 61 62 61 73 65 20 73 63 68 65  he database sche
4a90: 6d 61 2c 0a 77 69 74 68 20 70 65 72 68 61 70 73  ma,.with perhaps
4aa0: 20 61 20 66 65 77 20 65 78 74 72 61 20 77 6f 72   a few extra wor
4ab0: 64 73 20 61 62 6f 75 74 20 77 68 61 74 20 65 61  ds about what ea
4ac0: 63 68 20 74 61 62 6c 65 20 61 6e 64 20 63 6f 6c  ch table and col
4ad0: 75 6d 6e 0a 72 65 70 72 65 73 65 6e 74 73 2e 20  umn.represents. 
4ae0: 20 54 68 65 20 64 65 73 63 72 69 70 74 69 6f 6e   The description
4af0: 20 6f 66 20 61 20 63 75 73 74 6f 6d 20 66 69 6c   of a custom fil
4b00: 65 20 66 6f 72 6d 61 74 2c 0a 6f 6e 20 74 68 65  e format,.on the
4b10: 20 6f 74 68 65 72 20 68 61 6e 64 2c 20 74 79 70   other hand, typ
4b20: 69 63 61 6c 6c 79 20 72 75 6e 73 20 6f 6e 20 66  ically runs on f
4b30: 6f 72 20 68 75 6e 64 72 65 64 73 20 6f 66 20 0a  or hundreds of .
4b40: 70 61 67 65 73 2e 20 20 41 20 70 69 6c 65 2d 6f  pages.  A pile-o
4b50: 66 2d 66 69 6c 65 73 20 66 6f 72 6d 61 74 2c 20  f-files format, 
4b60: 77 68 69 6c 65 20 6d 75 63 68 20 73 69 6d 70 6c  while much simpl
4b70: 65 72 20 61 6e 64 20 65 61 73 69 65 72 20 74 6f  er and easier to
4b80: 0a 64 65 73 63 72 69 62 65 20 74 68 61 6e 20 61  .describe than a
4b90: 20 66 75 6c 6c 79 20 63 75 73 74 6f 6d 20 66 6f   fully custom fo
4ba0: 72 6d 61 74 2c 20 73 74 69 6c 6c 20 74 65 6e 64  rmat, still tend
4bb0: 73 20 74 6f 20 62 65 20 6d 75 63 68 20 6c 61 72  s to be much lar
4bc0: 67 65 72 0a 61 6e 64 20 6d 6f 72 65 20 63 6f 6d  ger.and more com
4bd0: 70 6c 65 78 20 74 68 61 6e 20 61 6e 20 53 51 4c  plex than an SQL
4be0: 20 73 63 68 65 6d 61 20 64 75 6d 70 2c 20 73 69   schema dump, si
4bf0: 6e 63 65 20 74 68 65 20 6e 61 6d 65 73 20 61 6e  nce the names an
4c00: 64 20 66 6f 72 6d 61 74 0a 66 6f 72 20 74 68 65  d format.for the
4c10: 20 69 6e 64 69 76 69 64 75 61 6c 20 66 69 6c 65   individual file
4c20: 73 20 6d 75 73 74 20 73 74 69 6c 6c 20 62 65 20  s must still be 
4c30: 64 65 73 63 72 69 62 65 64 2e 0a 0a 3c 70 3e 54  described...<p>T
4c40: 68 69 73 20 69 73 20 6e 6f 74 20 61 20 74 72 69  his is not a tri
4c50: 76 69 61 6c 20 70 6f 69 6e 74 2e 20 20 41 20 63  vial point.  A c
4c60: 6c 65 61 72 2c 20 63 6f 6e 63 69 73 65 2c 20 61  lear, concise, a
4c70: 6e 64 20 65 61 73 79 20 74 6f 20 75 6e 64 65 72  nd easy to under
4c80: 73 74 61 6e 64 0a 66 69 6c 65 20 66 6f 72 6d 61  stand.file forma
4c90: 74 20 69 73 20 61 20 63 72 75 63 69 61 6c 20 70  t is a crucial p
4ca0: 61 72 74 20 6f 66 20 61 6e 79 20 61 70 70 6c 69  art of any appli
4cb0: 63 61 74 69 6f 6e 20 64 65 73 69 67 6e 2e 0a 46  cation design..F
4cc0: 72 65 64 20 42 72 6f 6f 6b 73 2c 20 69 6e 20 68  red Brooks, in h
4cd0: 69 73 20 61 6c 6c 2d 74 69 6d 65 20 62 65 73 74  is all-time best
4ce0: 2d 73 65 6c 6c 69 6e 67 20 63 6f 6d 70 75 74 65  -selling compute
4cf0: 72 20 73 63 69 65 6e 63 65 20 74 65 78 74 2c 0a  r science text,.
4d00: 3c 69 3e 54 68 65 20 4d 79 74 68 69 63 61 6c 20  <i>The Mythical 
4d10: 4d 61 6e 2d 4d 6f 6e 74 68 3c 2f 69 3e 20 73 61  Man-Month</i> sa
4d20: 79 73 3a 0a 3c 62 6c 6f 63 6b 71 75 6f 74 65 3e  ys:.<blockquote>
4d30: 3c 69 3e 52 65 70 72 65 73 65 6e 74 61 74 69 6f  <i>Representatio
4d40: 6e 20 69 73 20 74 68 65 0a 65 73 73 65 6e 63 65  n is the.essence
4d50: 20 6f 66 20 63 6f 6d 70 75 74 65 72 20 70 72 6f   of computer pro
4d60: 67 72 61 6d 6d 69 6e 67 2e 3c 62 72 20 2f 3e 2e  gramming.<br />.
4d70: 2e 2e 3c 62 72 20 2f 3e 0a 53 68 6f 77 20 6d 65  ..<br />.Show me
4d80: 20 79 6f 75 72 20 66 6c 6f 77 63 68 61 72 74 73   your flowcharts
4d90: 20 61 6e 64 20 63 6f 6e 63 65 61 6c 20 79 6f 75   and conceal you
4da0: 72 20 74 61 62 6c 65 73 2c 20 61 6e 64 20 49 20  r tables, and I 
4db0: 73 68 61 6c 6c 20 0a 63 6f 6e 74 69 6e 75 65 20  shall .continue 
4dc0: 74 6f 20 62 65 20 6d 79 73 74 69 66 69 65 64 2e  to be mystified.
4dd0: 20 20 53 68 6f 77 20 6d 65 20 79 6f 75 72 20 74    Show me your t
4de0: 61 62 6c 65 73 2c 20 61 6e 64 20 49 20 77 6f 6e  ables, and I won
4df0: 27 74 20 75 73 75 61 6c 6c 79 0a 6e 65 65 64 20  't usually.need 
4e00: 79 6f 75 72 20 66 6c 6f 77 63 68 61 72 74 73 3b  your flowcharts;
4e10: 20 74 68 65 79 27 6c 6c 20 62 65 20 6f 62 76 69   they'll be obvi
4e20: 6f 75 73 2e 3c 2f 69 3e 3c 2f 62 6c 6f 63 6b 71  ous.</i></blockq
4e30: 75 6f 74 65 3e 0a 3c 70 3e 52 6f 62 20 50 69 6b  uote>.<p>Rob Pik
4e40: 65 2c 20 69 6e 20 68 69 73 0a 3c 69 3e 52 75 6c  e, in his.<i>Rul
4e50: 65 73 20 6f 66 20 50 72 6f 67 72 61 6d 6d 69 6e  es of Programmin
4e60: 67 3c 2f 69 3e 20 65 78 70 72 65 73 73 65 73 20  g</i> expresses 
4e70: 74 68 65 20 73 61 6d 65 20 69 64 65 61 20 74 68  the same idea th
4e80: 69 73 20 77 61 79 3a 0a 3c 62 6c 6f 63 6b 71 75  is way:.<blockqu
4e90: 6f 74 65 3e 0a 3c 69 3e 44 61 74 61 20 64 6f 6d  ote>.<i>Data dom
4ea0: 69 6e 61 74 65 73 2e 20 20 49 66 20 79 6f 75 27  inates.  If you'
4eb0: 76 65 20 63 68 6f 73 65 6e 20 74 68 65 20 72 69  ve chosen the ri
4ec0: 67 68 74 20 64 61 74 61 20 73 74 72 75 63 74 75  ght data structu
4ed0: 72 65 73 0a 61 6e 64 20 6f 72 67 61 6e 69 7a 65  res.and organize
4ee0: 64 20 74 68 69 6e 67 73 20 77 65 6c 6c 2c 20 74  d things well, t
4ef0: 68 65 20 61 6c 67 6f 72 69 74 68 6d 73 20 77 69  he algorithms wi
4f00: 6c 6c 20 61 6c 6d 6f 73 74 20 61 6c 77 61 79 73  ll almost always
4f10: 0a 62 65 20 73 65 6c 66 2d 65 76 69 64 65 6e 74  .be self-evident
4f20: 2e 20 20 44 61 74 61 20 73 74 72 75 63 74 75 72  .  Data structur
4f30: 65 73 2c 20 6e 6f 74 20 61 6c 67 6f 72 69 74 68  es, not algorith
4f40: 6d 73 2c 20 61 72 65 20 63 65 6e 74 72 61 6c 0a  ms, are central.
4f50: 74 6f 20 70 72 6f 67 72 61 6d 6d 69 6e 67 2e 3c  to programming.<
4f60: 2f 69 3e 3c 2f 62 6c 6f 63 6b 71 75 6f 74 65 3e  /i></blockquote>
4f70: 0a 3c 70 3e 20 4c 69 6e 75 73 20 54 6f 72 76 61  .<p> Linus Torva
4f80: 6c 64 73 20 75 73 65 64 20 64 69 66 66 65 72 65  lds used differe
4f90: 6e 74 20 77 6f 72 64 73 20 74 6f 20 73 61 79 0a  nt words to say.
4fa0: 6d 75 63 68 20 74 68 65 20 73 61 6d 65 20 74 68  much the same th
4fb0: 69 6e 67 20 6f 6e 20 74 68 65 20 47 69 74 20 6d  ing on the Git m
4fc0: 61 69 6c 69 6e 67 20 6c 69 73 74 20 6f 6e 20 32  ailing list on 2
4fd0: 30 30 36 2d 30 36 2d 32 37 3a 20 0a 3c 62 6c 6f  006-06-27: .<blo
4fe0: 63 6b 71 75 6f 74 65 3e 0a 3c 69 3e 42 61 64 20  ckquote>.<i>Bad 
4ff0: 70 72 6f 67 72 61 6d 6d 65 72 73 20 77 6f 72 72  programmers worr
5000: 79 20 61 62 6f 75 74 20 74 68 65 20 63 6f 64 65  y about the code
5010: 2e 20 20 47 6f 6f 64 20 70 72 6f 67 72 61 6d 6d  .  Good programm
5020: 65 72 73 20 77 6f 72 72 79 0a 61 62 6f 75 74 20  ers worry.about 
5030: 64 61 74 61 20 73 74 72 75 63 74 75 72 65 73 20  data structures 
5040: 61 6e 64 20 74 68 65 69 72 20 72 65 6c 61 74 69  and their relati
5050: 6f 6e 73 68 69 70 73 2e 3c 2f 69 3e 0a 3c 2f 62  onships.</i>.</b
5060: 6c 6f 63 6b 71 75 6f 74 65 3e 0a 0a 3c 70 3e 54  lockquote>..<p>T
5070: 68 65 20 70 6f 69 6e 74 20 69 73 20 74 68 69 73  he point is this
5080: 3a 20 61 6e 20 53 51 4c 20 64 61 74 61 62 61 73  : an SQL databas
5090: 65 20 73 63 68 65 6d 61 20 61 6c 6d 6f 73 74 20  e schema almost 
50a0: 61 6c 77 61 79 73 20 64 6f 65 73 20 0a 61 20 66  always does .a f
50b0: 61 72 20 62 65 74 74 65 72 20 6a 6f 62 20 6f 66  ar better job of
50c0: 20 64 65 66 69 6e 69 6e 67 20 61 6e 64 20 6f 72   defining and or
50d0: 67 61 6e 69 7a 69 6e 67 20 74 68 65 20 74 61 62  ganizing the tab
50e0: 6c 65 73 20 61 6e 64 20 0a 64 61 74 61 20 73 74  les and .data st
50f0: 72 75 63 74 75 72 65 73 20 61 6e 64 20 74 68 65  ructures and the
5100: 69 72 20 72 65 6c 61 74 69 6f 6e 73 68 69 70 73  ir relationships
5110: 2e 0a 41 6e 64 20 68 61 76 69 6e 67 20 63 6c 65  ..And having cle
5120: 61 72 2c 20 63 6f 6e 63 69 73 65 2c 20 61 6e 64  ar, concise, and
5130: 20 77 65 6c 6c 2d 64 65 66 69 6e 65 64 20 72 65   well-defined re
5140: 70 72 65 73 65 6e 74 61 74 69 6f 6e 0a 61 6c 6d  presentation.alm
5150: 6f 73 74 20 61 6c 77 61 79 73 20 72 65 73 75 6c  ost always resul
5160: 74 73 20 69 6e 20 61 6e 20 61 70 70 6c 69 63 61  ts in an applica
5170: 74 69 6f 6e 20 74 68 61 74 20 70 65 72 66 6f 72  tion that perfor
5180: 6d 73 20 62 65 74 74 65 72 2c 0a 68 61 73 20 66  ms better,.has f
5190: 65 77 65 72 20 70 72 6f 62 6c 65 6d 73 2c 20 61  ewer problems, a
51a0: 6e 64 20 69 73 20 65 61 73 69 65 72 20 74 6f 20  nd is easier to 
51b0: 64 65 76 65 6c 6f 70 20 61 6e 64 20 6d 61 69 6e  develop and main
51c0: 74 61 69 6e 2e 0a 3c 2f 6f 6c 3e 0a 0a 3c 68 32  tain..</ol>..<h2
51d0: 3e 43 6f 6e 63 6c 75 73 69 6f 6e 3c 2f 68 32 3e  >Conclusion</h2>
51e0: 0a 0a 3c 70 3e 0a 53 51 4c 69 74 65 20 69 73 20  ..<p>.SQLite is 
51f0: 6e 6f 74 20 74 68 65 20 70 65 72 66 65 63 74 20  not the perfect 
5200: 61 70 70 6c 69 63 61 74 69 6f 6e 20 66 69 6c 65  application file
5210: 20 66 6f 72 6d 61 74 20 66 6f 72 20 65 76 65 72   format for ever
5220: 79 20 73 69 74 75 61 74 69 6f 6e 2e 0a 42 75 74  y situation..But
5230: 20 69 6e 20 6d 61 6e 79 20 63 61 73 65 73 2c 20   in many cases, 
5240: 53 51 4c 69 74 65 20 69 73 20 61 20 66 61 72 20  SQLite is a far 
5250: 62 65 74 74 65 72 20 63 68 6f 69 63 65 20 74 68  better choice th
5260: 61 6e 20 65 69 74 68 65 72 20 61 20 63 75 73 74  an either a cust
5270: 6f 6d 0a 66 69 6c 65 20 66 6f 72 6d 61 74 2c 20  om.file format, 
5280: 61 20 70 69 6c 65 2d 6f 66 2d 66 69 6c 65 73 2c  a pile-of-files,
5290: 20 6f 72 20 61 20 77 72 61 70 70 65 64 20 70 69   or a wrapped pi
52a0: 6c 65 2d 6f 66 2d 66 69 6c 65 73 2e 0a 53 51 4c  le-of-files..SQL
52b0: 69 74 65 20 69 73 20 61 20 68 69 67 68 2d 6c 65  ite is a high-le
52c0: 76 65 6c 2c 20 73 74 61 62 6c 65 2c 20 72 65 6c  vel, stable, rel
52d0: 69 61 62 6c 65 2c 20 63 72 6f 73 73 2d 70 6c 61  iable, cross-pla
52e0: 74 66 6f 72 6d 2c 20 77 69 64 65 6c 79 2d 64 65  tform, widely-de
52f0: 70 6c 6f 79 65 64 2c 0a 65 78 74 65 6e 73 69 62  ployed,.extensib
5300: 6c 65 2c 20 70 65 72 66 6f 72 6d 61 6e 74 2c 20  le, performant, 
5310: 61 63 63 65 73 73 69 62 6c 65 2c 20 63 6f 6e 63  accessible, conc
5320: 75 72 72 65 6e 74 20 66 69 6c 65 20 66 6f 72 6d  urrent file form
5330: 61 74 2e 20 20 49 74 20 64 65 73 65 72 76 65 73  at.  It deserves
5340: 0a 79 6f 75 72 20 63 6f 6e 73 69 64 65 72 61 74  .your considerat
5350: 69 6f 6e 20 61 73 20 74 68 65 20 73 74 61 6e 64  ion as the stand
5360: 61 72 64 20 66 69 6c 65 20 66 6f 72 6d 61 74 20  ard file format 
5370: 6f 6e 20 79 6f 75 72 20 6e 65 78 74 20 61 70 70  on your next app
5380: 6c 69 63 61 74 69 6f 6e 0a 64 65 73 69 67 6e 2e  lication.design.
5390: 0a                                               .