Documentation Source Text

Hex Artifact Content
Login

Artifact 5aa1d3fafd42c568f3df069f8cfe046006fe674d:


0000: 3c 74 69 74 6c 65 3e 44 69 73 74 69 6e 63 74 69  <title>Distincti
0010: 76 65 20 46 65 61 74 75 72 65 73 20 4f 66 20 53  ve Features Of S
0020: 51 4c 69 74 65 3c 2f 74 69 74 6c 65 3e 0a 3c 68  QLite</title>.<h
0030: 31 20 61 6c 69 67 6e 3d 63 65 6e 74 65 72 3e 44  1 align=center>D
0040: 69 73 74 69 6e 63 74 69 76 65 20 46 65 61 74 75  istinctive Featu
0050: 72 65 73 20 4f 66 20 53 51 4c 69 74 65 3c 2f 68  res Of SQLite</h
0060: 31 3e 0a 0a 3c 70 3e 0a 54 68 69 73 20 70 61 67  1>..<p>.This pag
0070: 65 20 68 69 67 68 6c 69 67 68 74 73 20 73 6f 6d  e highlights som
0080: 65 20 6f 66 20 74 68 65 20 63 68 61 72 61 63 74  e of the charact
0090: 65 72 69 73 74 69 63 73 20 6f 66 20 53 51 4c 69  eristics of SQLi
00a0: 74 65 20 74 68 61 74 20 61 72 65 0a 75 6e 75 73  te that are.unus
00b0: 75 61 6c 20 61 6e 64 20 77 68 69 63 68 20 6d 61  ual and which ma
00c0: 6b 65 20 53 51 4c 69 74 65 20 64 69 66 66 65 72  ke SQLite differ
00d0: 65 6e 74 20 66 72 6f 6d 20 6d 61 6e 79 20 6f 74  ent from many ot
00e0: 68 65 72 20 53 51 4c 0a 64 61 74 61 62 61 73 65  her SQL.database
00f0: 20 65 6e 67 69 6e 65 73 2e 0a 3c 2f 70 3e 0a 0a   engines..</p>..
0100: 3c 74 63 6c 3e 0a 70 72 6f 63 20 66 65 61 74 75  <tcl>.proc featu
0110: 72 65 20 7b 74 61 67 20 6e 61 6d 65 20 74 65 78  re {tag name tex
0120: 74 7d 20 7b 0a 20 20 68 64 5f 66 72 61 67 6d 65  t} {.  hd_fragme
0130: 6e 74 20 24 74 61 67 0a 20 20 68 64 5f 70 75 74  nt $tag.  hd_put
0140: 73 20 22 3c 70 3e 3c 62 3e 24 6e 61 6d 65 3c 2f  s "<p><b>$name</
0150: 62 3e 3c 2f 70 3e 5c 6e 22 0a 20 20 68 64 5f 70  b></p>\n".  hd_p
0160: 75 74 73 20 22 3c 62 6c 6f 63 6b 71 75 6f 74 65  uts "<blockquote
0170: 3e 24 74 65 78 74 3c 2f 62 6c 6f 63 6b 71 75 6f  >$text</blockquo
0180: 74 65 3e 5c 6e 22 0a 7d 0a 0a 66 65 61 74 75 72  te>\n".}..featur
0190: 65 20 7a 65 72 6f 63 6f 6e 66 69 67 20 7b 5a 65  e zeroconfig {Ze
01a0: 72 6f 2d 43 6f 6e 66 69 67 75 72 61 74 69 6f 6e  ro-Configuration
01b0: 7d 20 7b 0a 20 20 53 51 4c 69 74 65 20 64 6f 65  } {.  SQLite doe
01c0: 73 20 6e 6f 74 20 6e 65 65 64 20 74 6f 20 62 65  s not need to be
01d0: 20 22 69 6e 73 74 61 6c 6c 65 64 22 20 62 65 66   "installed" bef
01e0: 6f 72 65 20 69 74 20 69 73 20 75 73 65 64 2e 20  ore it is used. 
01f0: 0a 20 20 54 68 65 72 65 20 69 73 20 6e 6f 20 22  .  There is no "
0200: 73 65 74 75 70 22 20 70 72 6f 63 65 64 75 72 65  setup" procedure
0210: 2e 20 20 54 68 65 72 65 20 69 73 20 6e 6f 0a 20  .  There is no. 
0220: 20 73 65 72 76 65 72 20 70 72 6f 63 65 73 73 20   server process 
0230: 74 68 61 74 20 6e 65 65 64 73 20 74 6f 20 62 65  that needs to be
0240: 20 73 74 61 72 74 65 64 2c 20 73 74 6f 70 70 65   started, stoppe
0250: 64 2c 20 6f 72 20 63 6f 6e 66 69 67 75 72 65 64  d, or configured
0260: 2e 0a 20 20 54 68 65 72 65 20 69 73 0a 20 20 6e  ..  There is.  n
0270: 6f 20 6e 65 65 64 20 66 6f 72 20 61 6e 20 61 64  o need for an ad
0280: 6d 69 6e 69 73 74 72 61 74 6f 72 20 74 6f 20 63  ministrator to c
0290: 72 65 61 74 65 20 61 20 6e 65 77 20 64 61 74 61  reate a new data
02a0: 62 61 73 65 20 69 6e 73 74 61 6e 63 65 20 6f 72  base instance or
02b0: 20 61 73 73 69 67 6e 0a 20 20 61 63 63 65 73 73   assign.  access
02c0: 20 70 65 72 6d 69 73 73 69 6f 6e 73 20 74 6f 20   permissions to 
02d0: 75 73 65 72 73 2e 0a 20 20 53 51 4c 69 74 65 20  users..  SQLite 
02e0: 75 73 65 73 20 6e 6f 20 63 6f 6e 66 69 67 75 72  uses no configur
02f0: 61 74 69 6f 6e 20 66 69 6c 65 73 2e 0a 20 20 4e  ation files..  N
0300: 6f 74 68 69 6e 67 20 6e 65 65 64 73 20 74 6f 20  othing needs to 
0310: 62 65 20 64 6f 6e 65 20 74 6f 20 74 65 6c 6c 20  be done to tell 
0320: 74 68 65 20 73 79 73 74 65 6d 20 74 68 61 74 20  the system that 
0330: 53 51 4c 69 74 65 20 69 73 20 72 75 6e 6e 69 6e  SQLite is runnin
0340: 67 2e 0a 20 20 4e 6f 20 61 63 74 69 6f 6e 73 20  g..  No actions 
0350: 61 72 65 20 72 65 71 75 69 72 65 64 20 74 6f 20  are required to 
0360: 72 65 63 6f 76 65 72 20 61 66 74 65 72 20 61 20  recover after a 
0370: 73 79 73 74 65 6d 20 63 72 61 73 68 20 6f 72 20  system crash or 
0380: 70 6f 77 65 72 20 66 61 69 6c 75 72 65 2e 0a 20  power failure.. 
0390: 20 54 68 65 72 65 20 69 73 20 6e 6f 74 68 69 6e   There is nothin
03a0: 67 20 74 6f 20 74 72 6f 75 62 6c 65 73 68 6f 6f  g to troubleshoo
03b0: 74 2e 0a 20 20 3c 70 3e 0a 20 20 53 51 4c 69 74  t..  <p>.  SQLit
03c0: 65 20 6a 75 73 74 20 77 6f 72 6b 73 2e 0a 20 20  e just works..  
03d0: 3c 70 3e 0a 20 20 4f 74 68 65 72 20 6d 6f 72 65  <p>.  Other more
03e0: 20 66 61 6d 69 6c 69 61 72 20 64 61 74 61 62 61   familiar databa
03f0: 73 65 20 65 6e 67 69 6e 65 73 20 72 75 6e 20 67  se engines run g
0400: 72 65 61 74 20 6f 6e 63 65 20 79 6f 75 20 67 65  reat once you ge
0410: 74 20 74 68 65 6d 20 67 6f 69 6e 67 2e 0a 20 20  t them going..  
0420: 42 75 74 20 64 6f 69 6e 67 20 74 68 65 20 69 6e  But doing the in
0430: 69 74 69 61 6c 20 69 6e 73 74 61 6c 6c 61 74 69  itial installati
0440: 6f 6e 20 61 6e 64 20 63 6f 6e 66 69 67 75 72 61  on and configura
0450: 74 69 6f 6e 20 63 61 6e 20 62 65 0a 20 20 69 6e  tion can be.  in
0460: 74 69 6d 69 64 61 74 69 6e 67 6c 79 20 63 6f 6d  timidatingly com
0470: 70 6c 65 78 2e 0a 7d 0a 0a 66 65 61 74 75 72 65  plex..}..feature
0480: 20 73 65 72 76 65 72 6c 65 73 73 20 7b 53 65 72   serverless {Ser
0490: 76 65 72 6c 65 73 73 7d 20 7b 0a 20 20 4d 6f 73  verless} {.  Mos
04a0: 74 20 53 51 4c 20 64 61 74 61 62 61 73 65 20 65  t SQL database e
04b0: 6e 67 69 6e 65 73 20 61 72 65 20 69 6d 70 6c 65  ngines are imple
04c0: 6d 65 6e 74 65 64 20 61 73 20 61 20 73 65 70 61  mented as a sepa
04d0: 72 61 74 65 20 73 65 72 76 65 72 0a 20 20 70 72  rate server.  pr
04e0: 6f 63 65 73 73 2e 20 20 50 72 6f 67 72 61 6d 73  ocess.  Programs
04f0: 20 74 68 61 74 20 77 61 6e 74 20 74 6f 20 61 63   that want to ac
0500: 63 65 73 73 20 74 68 65 20 64 61 74 61 62 61 73  cess the databas
0510: 65 20 63 6f 6d 6d 75 6e 69 63 61 74 65 0a 20 20  e communicate.  
0520: 77 69 74 68 20 74 68 65 20 73 65 72 76 65 72 20  with the server 
0530: 75 73 69 6e 67 20 73 6f 6d 65 20 6b 69 6e 64 20  using some kind 
0540: 6f 66 20 69 6e 74 65 72 70 72 6f 63 65 73 73 20  of interprocess 
0550: 63 6f 6d 6d 75 6e 69 63 61 74 69 6f 6e 0a 20 20  communication.  
0560: 28 74 79 70 69 63 61 6c 6c 79 20 54 43 50 2f 49  (typically TCP/I
0570: 50 29 20 74 6f 20 73 65 6e 64 20 72 65 71 75 65  P) to send reque
0580: 73 74 73 20 74 6f 20 74 68 65 20 73 65 72 76 65  sts to the serve
0590: 72 20 61 6e 64 20 74 6f 20 72 65 63 65 69 76 65  r and to receive
05a0: 0a 20 20 62 61 63 6b 20 72 65 73 75 6c 74 73 2e  .  back results.
05b0: 20 20 53 51 4c 69 74 65 20 64 6f 65 73 20 6e 6f    SQLite does no
05c0: 74 20 77 6f 72 6b 20 74 68 69 73 20 77 61 79 2e  t work this way.
05d0: 20 20 57 69 74 68 20 53 51 4c 69 74 65 2c 20 74    With SQLite, t
05e0: 68 65 0a 20 20 70 72 6f 63 65 73 73 20 74 68 61  he.  process tha
05f0: 74 20 77 61 6e 74 73 20 74 6f 20 61 63 63 65 73  t wants to acces
0600: 73 20 74 68 65 20 64 61 74 61 62 61 73 65 20 72  s the database r
0610: 65 61 64 73 20 61 6e 64 20 77 72 69 74 65 73 0a  eads and writes.
0620: 20 20 64 69 72 65 63 74 6c 79 20 66 72 6f 6d 20    directly from 
0630: 74 68 65 20 64 61 74 61 62 61 73 65 20 66 69 6c  the database fil
0640: 65 73 20 6f 6e 20 64 69 73 6b 2e 20 20 54 68 65  es on disk.  The
0650: 72 65 20 69 73 20 6e 6f 20 69 6e 74 65 72 6d 65  re is no interme
0660: 64 69 61 72 79 0a 20 20 73 65 72 76 65 72 20 70  diary.  server p
0670: 72 6f 63 65 73 73 2e 0a 20 20 3c 70 3e 0a 20 20  rocess..  <p>.  
0680: 54 68 65 72 65 20 61 72 65 20 61 64 76 61 6e 74  There are advant
0690: 61 67 65 73 20 61 6e 64 20 64 69 73 61 64 76 61  ages and disadva
06a0: 6e 74 61 67 65 73 20 74 6f 20 62 65 69 6e 67 20  ntages to being 
06b0: 73 65 72 76 65 72 6c 65 73 73 2e 20 20 54 68 65  serverless.  The
06c0: 0a 20 20 6d 61 69 6e 20 61 64 76 61 6e 74 61 67  .  main advantag
06d0: 65 20 69 73 20 74 68 61 74 20 74 68 65 72 65 20  e is that there 
06e0: 69 73 20 6e 6f 20 73 65 70 61 72 61 74 65 20 73  is no separate s
06f0: 65 72 76 65 72 20 70 72 6f 63 65 73 73 0a 20 20  erver process.  
0700: 74 6f 20 69 6e 73 74 61 6c 6c 2c 20 73 65 74 75  to install, setu
0710: 70 2c 20 63 6f 6e 66 69 67 75 72 65 2c 20 69 6e  p, configure, in
0720: 69 74 69 61 6c 69 7a 65 2c 20 6d 61 6e 61 67 65  itialize, manage
0730: 2c 20 61 6e 64 20 74 72 6f 75 62 6c 65 73 68 6f  , and troublesho
0740: 6f 74 2e 0a 20 20 54 68 69 73 20 69 73 20 6f 6e  ot..  This is on
0750: 65 20 72 65 61 73 6f 6e 20 77 68 79 20 53 51 4c  e reason why SQL
0760: 69 74 65 20 69 73 20 61 20 22 7a 65 72 6f 2d 63  ite is a "zero-c
0770: 6f 6e 66 69 67 75 72 61 74 69 6f 6e 22 20 64 61  onfiguration" da
0780: 74 61 62 61 73 65 0a 20 20 65 6e 67 69 6e 65 2e  tabase.  engine.
0790: 20 20 50 72 6f 67 72 61 6d 73 20 74 68 61 74 20    Programs that 
07a0: 75 73 65 20 53 51 4c 69 74 65 20 72 65 71 75 69  use SQLite requi
07b0: 72 65 20 6e 6f 20 61 64 6d 69 6e 69 73 74 72 61  re no administra
07c0: 74 69 76 65 20 73 75 70 70 6f 72 74 0a 20 20 66  tive support.  f
07d0: 6f 72 20 73 65 74 74 69 6e 67 20 75 70 20 74 68  or setting up th
07e0: 65 20 64 61 74 61 62 61 73 65 20 65 6e 67 69 6e  e database engin
07f0: 65 20 62 65 66 6f 72 65 20 74 68 65 79 20 61 72  e before they ar
0800: 65 20 72 75 6e 2e 20 20 41 6e 79 20 70 72 6f 67  e run.  Any prog
0810: 72 61 6d 0a 20 20 74 68 61 74 20 69 73 20 61 62  ram.  that is ab
0820: 6c 65 20 74 6f 20 61 63 63 65 73 73 20 74 68 65  le to access the
0830: 20 64 69 73 6b 20 69 73 20 61 62 6c 65 20 74 6f   disk is able to
0840: 20 75 73 65 20 61 6e 20 53 51 4c 69 74 65 20 64   use an SQLite d
0850: 61 74 61 62 61 73 65 2e 0a 20 20 3c 70 3e 0a 20  atabase..  <p>. 
0860: 20 4f 6e 20 74 68 65 20 6f 74 68 65 72 20 68 61   On the other ha
0870: 6e 64 2c 20 61 20 64 61 74 61 62 61 73 65 20 65  nd, a database e
0880: 6e 67 69 6e 65 20 74 68 61 74 20 75 73 65 73 20  ngine that uses 
0890: 61 20 73 65 72 76 65 72 20 63 61 6e 20 70 72 6f  a server can pro
08a0: 76 69 64 65 0a 20 20 62 65 74 74 65 72 20 70 72  vide.  better pr
08b0: 6f 74 65 63 74 69 6f 6e 20 66 72 6f 6d 20 62 75  otection from bu
08c0: 67 73 20 69 6e 20 74 68 65 20 63 6c 69 65 6e 74  gs in the client
08d0: 20 61 70 70 6c 69 63 61 74 69 6f 6e 20 2d 20 73   application - s
08e0: 74 72 61 79 20 70 6f 69 6e 74 65 72 73 0a 20 20  tray pointers.  
08f0: 69 6e 20 61 20 63 6c 69 65 6e 74 20 63 61 6e 6e  in a client cann
0900: 6f 74 20 63 6f 72 72 75 70 74 20 6d 65 6d 6f 72  ot corrupt memor
0910: 79 20 6f 6e 20 74 68 65 20 73 65 72 76 65 72 2e  y on the server.
0920: 20 20 41 6e 64 20 62 65 63 61 75 73 65 20 61 20    And because a 
0930: 73 65 72 76 65 72 0a 20 20 69 73 20 61 20 73 69  server.  is a si
0940: 6e 67 6c 65 20 70 65 72 73 69 73 74 65 6e 74 20  ngle persistent 
0950: 70 72 6f 63 65 73 73 2c 20 69 74 20 69 73 20 61  process, it is a
0960: 62 6c 65 20 63 6f 6e 74 72 6f 6c 20 64 61 74 61  ble control data
0970: 62 61 73 65 20 61 63 63 65 73 73 20 77 69 74 68  base access with
0980: 0a 20 20 6d 6f 72 65 20 70 72 65 63 69 73 69 6f  .  more precisio
0990: 6e 2c 20 61 6c 6c 6f 77 69 6e 67 20 66 6f 72 20  n, allowing for 
09a0: 66 69 6e 65 72 20 67 72 61 69 6e 20 6c 6f 63 6b  finer grain lock
09b0: 69 6e 67 20 61 6e 64 20 62 65 74 74 65 72 20 63  ing and better c
09c0: 6f 6e 63 75 72 72 65 6e 63 79 2e 0a 20 20 3c 70  oncurrency..  <p
09d0: 3e 0a 20 20 4d 6f 73 74 20 53 51 4c 20 64 61 74  >.  Most SQL dat
09e0: 61 62 61 73 65 20 65 6e 67 69 6e 65 73 20 61 72  abase engines ar
09f0: 65 20 63 6c 69 65 6e 74 2f 73 65 72 76 65 72 20  e client/server 
0a00: 62 61 73 65 64 2e 20 20 4f 66 20 74 68 6f 73 65  based.  Of those
0a10: 20 74 68 61 74 20 61 72 65 0a 20 20 73 65 72 76   that are.  serv
0a20: 65 72 6c 65 73 73 2c 20 53 51 4c 69 74 65 20 69  erless, SQLite i
0a30: 73 20 74 68 65 20 6f 6e 6c 79 20 6f 6e 65 20 74  s the only one t
0a40: 68 61 74 20 74 68 69 73 20 61 75 74 68 6f 72 20  hat this author 
0a50: 6b 6e 6f 77 73 20 6f 66 20 74 68 61 74 0a 20 20  knows of that.  
0a60: 61 6c 6c 6f 77 73 20 6d 75 6c 74 69 70 6c 65 20  allows multiple 
0a70: 61 70 70 6c 69 63 61 74 69 6f 6e 73 20 74 6f 20  applications to 
0a80: 61 63 63 65 73 73 20 74 68 65 20 73 61 6d 65 20  access the same 
0a90: 64 61 74 61 62 61 73 65 20 61 74 20 74 68 65 20  database at the 
0aa0: 73 61 6d 65 20 74 69 6d 65 2e 0a 7d 0a 0a 66 65  same time..}..fe
0ab0: 61 74 75 72 65 20 6f 6e 65 66 69 6c 65 20 7b 53  ature onefile {S
0ac0: 69 6e 67 6c 65 20 44 61 74 61 62 61 73 65 20 46  ingle Database F
0ad0: 69 6c 65 7d 20 7b 0a 20 20 41 6e 20 53 51 4c 69  ile} {.  An SQLi
0ae0: 74 65 20 64 61 74 61 62 61 73 65 20 69 73 20 61  te database is a
0af0: 20 73 69 6e 67 6c 65 20 6f 72 64 69 6e 61 72 79   single ordinary
0b00: 20 64 69 73 6b 20 66 69 6c 65 20 74 68 61 74 20   disk file that 
0b10: 63 61 6e 20 62 65 20 6c 6f 63 61 74 65 64 0a 20  can be located. 
0b20: 20 61 6e 79 77 68 65 72 65 20 69 6e 20 74 68 65   anywhere in the
0b30: 20 64 69 72 65 63 74 6f 72 79 20 68 69 65 72 61   directory hiera
0b40: 72 63 68 79 2e 20 20 49 66 20 53 51 4c 69 74 65  rchy.  If SQLite
0b50: 20 63 61 6e 20 72 65 61 64 0a 20 20 74 68 65 20   can read.  the 
0b60: 64 69 73 6b 20 66 69 6c 65 20 74 68 65 6e 20 69  disk file then i
0b70: 74 20 63 61 6e 20 72 65 61 64 20 61 6e 79 74 68  t can read anyth
0b80: 69 6e 67 20 69 6e 20 74 68 65 20 64 61 74 61 62  ing in the datab
0b90: 61 73 65 2e 20 20 49 66 20 74 68 65 20 64 69 73  ase.  If the dis
0ba0: 6b 0a 20 20 66 69 6c 65 20 61 6e 64 20 69 74 73  k.  file and its
0bb0: 20 64 69 72 65 63 74 6f 72 79 20 61 72 65 20 77   directory are w
0bc0: 72 69 74 61 62 6c 65 2c 20 74 68 65 6e 20 53 51  ritable, then SQ
0bd0: 4c 69 74 65 20 63 61 6e 20 63 68 61 6e 67 65 20  Lite can change 
0be0: 61 6e 79 74 68 69 6e 67 0a 20 20 69 6e 20 74 68  anything.  in th
0bf0: 65 20 64 61 74 61 62 61 73 65 2e 20 20 20 44 61  e database.   Da
0c00: 74 61 62 61 73 65 20 66 69 6c 65 73 20 63 61 6e  tabase files can
0c10: 20 65 61 73 69 6c 79 20 62 65 20 63 6f 70 69 65   easily be copie
0c20: 64 20 6f 6e 74 6f 20 61 20 55 53 42 0a 20 20 6d  d onto a USB.  m
0c30: 65 6d 6f 72 79 20 73 74 69 63 6b 20 6f 72 20 65  emory stick or e
0c40: 6d 61 69 6c 65 64 20 66 6f 72 20 73 68 61 72 69  mailed for shari
0c50: 6e 67 2e 0a 20 20 3c 70 3e 0a 20 20 4f 74 68 65  ng..  <p>.  Othe
0c60: 72 20 53 51 4c 20 64 61 74 61 62 61 73 65 20 65  r SQL database e
0c70: 6e 67 69 6e 65 73 20 74 65 6e 64 20 74 6f 20 73  ngines tend to s
0c80: 74 6f 72 65 20 64 61 74 61 20 61 73 20 61 20 6c  tore data as a l
0c90: 61 72 67 65 20 63 6f 6c 6c 65 63 74 69 6f 6e 20  arge collection 
0ca0: 6f 66 0a 20 20 66 69 6c 65 73 2e 20 20 4f 66 74  of.  files.  Oft
0cb0: 65 6e 20 74 68 65 73 65 20 66 69 6c 65 73 20 61  en these files a
0cc0: 72 65 20 69 6e 20 61 20 73 74 61 6e 64 61 72 64  re in a standard
0cd0: 20 6c 6f 63 61 74 69 6f 6e 20 74 68 61 74 20 6f   location that o
0ce0: 6e 6c 79 20 74 68 65 0a 20 20 64 61 74 61 62 61  nly the.  databa
0cf0: 73 65 20 65 6e 67 69 6e 65 20 69 74 73 65 6c 66  se engine itself
0d00: 20 63 61 6e 20 61 63 63 65 73 73 2e 20 20 54 68   can access.  Th
0d10: 69 73 20 6d 61 6b 65 73 20 74 68 65 20 64 61 74  is makes the dat
0d20: 61 20 6d 6f 72 65 20 73 65 63 75 72 65 2c 0a 20  a more secure,. 
0d30: 20 62 75 74 20 61 6c 73 6f 20 6d 61 6b 65 73 20   but also makes 
0d40: 69 74 20 68 61 72 64 65 72 20 74 6f 20 61 63 63  it harder to acc
0d50: 65 73 73 2e 20 20 53 6f 6d 65 20 53 51 4c 20 64  ess.  Some SQL d
0d60: 61 74 61 62 61 73 65 20 65 6e 67 69 6e 65 73 20  atabase engines 
0d70: 70 72 6f 76 69 64 65 0a 20 20 74 68 65 20 6f 70  provide.  the op
0d80: 74 69 6f 6e 20 6f 66 20 77 72 69 74 69 6e 67 20  tion of writing 
0d90: 64 69 72 65 63 74 6c 79 20 74 6f 20 64 69 73 6b  directly to disk
0da0: 20 61 6e 64 20 62 79 70 61 73 73 69 6e 67 20 74   and bypassing t
0db0: 68 65 20 66 69 6c 65 73 79 73 74 65 6d 0a 20 20  he filesystem.  
0dc0: 61 6c 6c 20 74 6f 67 65 74 68 65 72 2e 20 20 54  all together.  T
0dd0: 68 69 73 20 70 72 6f 76 69 64 65 73 20 61 64 64  his provides add
0de0: 65 64 20 70 65 72 66 6f 72 6d 61 6e 63 65 2c 20  ed performance, 
0df0: 62 75 74 20 61 74 20 74 68 65 20 63 6f 73 74 20  but at the cost 
0e00: 6f 66 0a 20 20 63 6f 6e 73 69 64 65 72 61 62 6c  of.  considerabl
0e10: 65 20 73 65 74 75 70 20 61 6e 64 20 6d 61 69 6e  e setup and main
0e20: 74 65 6e 61 6e 63 65 20 63 6f 6d 70 6c 65 78 69  tenance complexi
0e30: 74 79 2e 0a 7d 0a 0a 66 65 61 74 75 72 65 20 6f  ty..}..feature o
0e40: 6e 65 66 69 6c 65 20 7b 53 74 61 62 6c 65 20 43  nefile {Stable C
0e50: 72 6f 73 73 2d 50 6c 61 74 66 6f 72 6d 20 44 61  ross-Platform Da
0e60: 74 61 62 61 73 65 20 46 69 6c 65 7d 20 7b 0a 20  tabase File} {. 
0e70: 20 54 68 65 20 53 51 4c 69 74 65 20 66 69 6c 65   The SQLite file
0e80: 20 66 6f 72 6d 61 74 20 69 73 20 63 72 6f 73 73   format is cross
0e90: 2d 70 6c 61 74 66 6f 72 6d 2e 20 20 41 20 64 61  -platform.  A da
0ea0: 74 61 62 61 73 65 20 66 69 6c 65 20 77 72 69 74  tabase file writ
0eb0: 74 65 6e 0a 20 20 6f 6e 20 6f 6e 65 20 6d 61 63  ten.  on one mac
0ec0: 68 69 6e 65 20 63 61 6e 20 62 65 20 63 6f 70 69  hine can be copi
0ed0: 65 64 20 74 6f 20 61 6e 64 20 75 73 65 64 20 6f  ed to and used o
0ee0: 6e 20 61 20 64 69 66 66 65 72 65 6e 74 20 6d 61  n a different ma
0ef0: 63 68 69 6e 65 20 77 69 74 68 0a 20 20 61 20 64  chine with.  a d
0f00: 69 66 66 65 72 65 6e 74 20 61 72 63 68 69 74 65  ifferent archite
0f10: 63 74 75 72 65 2e 20 20 42 69 67 2d 65 6e 64 69  cture.  Big-endi
0f20: 61 6e 20 6f 72 20 6c 69 74 74 6c 65 2d 65 6e 64  an or little-end
0f30: 69 61 6e 2c 20 33 32 2d 62 69 74 20 6f 72 0a 20  ian, 32-bit or. 
0f40: 20 36 34 2d 62 69 74 20 64 6f 65 73 20 6e 6f 74   64-bit does not
0f50: 20 6d 61 74 74 65 72 2e 20 20 41 6c 6c 20 6d 61   matter.  All ma
0f60: 63 68 69 6e 65 73 20 75 73 65 20 74 68 65 20 73  chines use the s
0f70: 61 6d 65 20 66 69 6c 65 20 66 6f 72 6d 61 74 2e  ame file format.
0f80: 0a 20 20 46 75 72 74 68 65 72 6d 6f 72 65 2c 20  .  Furthermore, 
0f90: 74 68 65 20 64 65 76 65 6c 6f 70 65 72 73 20 68  the developers h
0fa0: 61 76 65 20 70 6c 65 64 67 65 64 20 74 6f 20 6b  ave pledged to k
0fb0: 65 65 70 20 74 68 65 20 66 69 6c 65 20 66 6f 72  eep the file for
0fc0: 6d 61 74 0a 20 20 73 74 61 62 6c 65 20 61 6e 64  mat.  stable and
0fd0: 20 62 61 63 6b 77 61 72 64 73 20 63 6f 6d 70 61   backwards compa
0fe0: 74 69 62 6c 65 2c 20 73 6f 20 6e 65 77 65 72 20  tible, so newer 
0ff0: 76 65 72 73 69 6f 6e 73 20 6f 66 20 53 51 4c 69  versions of SQLi
1000: 74 65 20 63 61 6e 0a 20 20 72 65 61 64 20 61 6e  te can.  read an
1010: 64 20 77 72 69 74 65 20 6f 6c 64 65 72 20 64 61  d write older da
1020: 74 61 62 61 73 65 20 66 69 6c 65 73 2e 0a 20 20  tabase files..  
1030: 3c 70 3e 0a 20 20 4d 6f 73 74 20 6f 74 68 65 72  <p>.  Most other
1040: 20 53 51 4c 20 64 61 74 61 62 61 73 65 20 65 6e   SQL database en
1050: 67 69 6e 65 73 20 72 65 71 75 69 72 65 20 79 6f  gines require yo
1060: 75 20 74 6f 20 64 75 6d 70 20 61 6e 64 20 72 65  u to dump and re
1070: 73 74 6f 72 65 0a 20 20 74 68 65 20 64 61 74 61  store.  the data
1080: 62 61 73 65 20 77 68 65 6e 20 6d 6f 76 69 6e 67  base when moving
1090: 20 66 72 6f 6d 20 6f 6e 65 20 70 6c 61 74 66 6f   from one platfo
10a0: 72 6d 20 74 6f 20 61 6e 6f 74 68 65 72 20 61 6e  rm to another an
10b0: 64 20 6f 66 74 65 6e 0a 20 20 77 68 65 6e 20 75  d often.  when u
10c0: 70 67 72 61 64 69 6e 67 20 74 6f 20 61 20 6e 65  pgrading to a ne
10d0: 77 65 72 20 76 65 72 73 69 6f 6e 20 6f 66 20 74  wer version of t
10e0: 68 65 20 73 6f 66 74 77 61 72 65 2e 0a 7d 0a 0a  he software..}..
10f0: 66 65 61 74 75 72 65 20 73 6d 61 6c 6c 20 7b 43  feature small {C
1100: 6f 6d 70 61 63 74 7d 20 7b 0a 20 20 57 68 65 6e  ompact} {.  When
1110: 20 6f 70 74 69 6d 69 7a 65 64 20 66 6f 72 20 73   optimized for s
1120: 69 7a 65 2c 20 74 68 65 20 77 68 6f 6c 65 20 53  ize, the whole S
1130: 51 4c 69 74 65 20 6c 69 62 72 61 72 79 20 77 69  QLite library wi
1140: 74 68 20 65 76 65 72 79 74 68 69 6e 67 20 65 6e  th everything en
1150: 61 62 6c 65 64 0a 20 20 69 73 20 6c 65 73 73 20  abled.  is less 
1160: 74 68 61 6e 20 32 37 35 4b 69 42 20 69 6e 20 73  than 275KiB in s
1170: 69 7a 65 20 28 61 73 20 6d 65 61 73 75 72 65 64  ize (as measured
1180: 20 6f 6e 20 61 6e 20 69 78 38 36 20 75 73 69 6e   on an ix86 usin
1190: 67 20 74 68 65 20 22 73 69 7a 65 22 0a 20 20 75  g the "size".  u
11a0: 74 69 6c 69 74 79 20 66 72 6f 6d 20 74 68 65 20  tility from the 
11b0: 47 4e 55 20 63 6f 6d 70 69 6c 65 72 20 73 75 69  GNU compiler sui
11c0: 74 65 2e 29 20 20 55 6e 6e 65 65 64 65 64 20 66  te.)  Unneeded f
11d0: 65 61 74 75 72 65 73 20 63 61 6e 20 62 65 20 64  eatures can be d
11e0: 69 73 61 62 6c 65 64 0a 20 20 61 74 20 63 6f 6d  isabled.  at com
11f0: 70 69 6c 65 2d 74 69 6d 65 20 74 6f 20 66 75 72  pile-time to fur
1200: 74 68 65 72 20 72 65 64 75 63 65 20 74 68 65 20  ther reduce the 
1210: 73 69 7a 65 20 6f 66 20 74 68 65 20 6c 69 62 72  size of the libr
1220: 61 72 79 20 74 6f 20 75 6e 64 65 72 0a 20 20 31  ary to under.  1
1230: 39 30 4b 69 42 20 69 66 20 64 65 73 69 72 65 64  90KiB if desired
1240: 2e 0a 20 20 3c 70 3e 0a 20 20 4d 6f 73 74 20 6f  ..  <p>.  Most o
1250: 74 68 65 72 20 53 51 4c 20 64 61 74 61 62 61 73  ther SQL databas
1260: 65 20 65 6e 67 69 6e 65 73 20 61 72 65 20 6d 75  e engines are mu
1270: 63 68 20 6c 61 72 67 65 72 20 74 68 61 6e 20 74  ch larger than t
1280: 68 69 73 2e 20 20 49 42 4d 20 62 6f 61 73 74 73  his.  IBM boasts
1290: 0a 20 20 74 68 61 74 20 69 74 73 20 72 65 63 65  .  that its rece
12a0: 6e 74 6c 79 20 72 65 6c 65 61 73 65 64 20 43 6c  ntly released Cl
12b0: 6f 75 64 53 63 61 70 65 20 64 61 74 61 62 61 73  oudScape databas
12c0: 65 20 65 6e 67 69 6e 65 20 69 73 20 22 6f 6e 6c  e engine is "onl
12d0: 79 22 20 61 20 32 4d 69 42 0a 20 20 6a 61 72 20  y" a 2MiB.  jar 
12e0: 66 69 6c 65 20 2d 20 61 6e 20 6f 72 64 65 72 20  file - an order 
12f0: 6f 66 20 6d 61 67 6e 69 74 75 64 65 20 6c 61 72  of magnitude lar
1300: 67 65 72 20 74 68 61 6e 20 53 51 4c 69 74 65 20  ger than SQLite 
1310: 65 76 65 6e 20 61 66 74 65 72 20 69 74 20 69 73  even after it is
1320: 0a 20 20 63 6f 6d 70 72 65 73 73 65 64 21 0a 20  .  compressed!. 
1330: 20 46 69 72 65 62 69 72 64 20 62 6f 61 73 74 73   Firebird boasts
1340: 20 74 68 61 74 20 69 74 73 20 63 6c 69 65 6e 74   that its client
1350: 2d 73 69 64 65 20 6c 69 62 72 61 72 79 20 69 73  -side library is
1360: 20 6f 6e 6c 79 20 33 35 30 4b 69 42 2e 20 20 54   only 350KiB.  T
1370: 68 61 74 27 73 0a 20 20 35 30 25 20 6c 61 72 67  hat's.  50% larg
1380: 65 72 20 74 68 61 6e 20 53 51 4c 69 74 65 20 61  er than SQLite a
1390: 6e 64 20 64 6f 65 73 20 6e 6f 74 20 65 76 65 6e  nd does not even
13a0: 20 63 6f 6e 74 61 69 6e 20 74 68 65 20 64 61 74   contain the dat
13b0: 61 62 61 73 65 20 65 6e 67 69 6e 65 2e 0a 20 20  abase engine..  
13c0: 54 68 65 20 42 65 72 6b 65 6c 65 79 20 44 42 20  The Berkeley DB 
13d0: 6c 69 62 72 61 72 79 20 66 72 6f 6d 20 4f 72 61  library from Ora
13e0: 63 6c 65 20 69 73 20 34 35 30 4b 69 42 20 61 6e  cle is 450KiB an
13f0: 64 20 69 74 20 6f 6d 69 74 73 20 53 51 4c 0a 20  d it omits SQL. 
1400: 20 73 75 70 70 6f 72 74 2c 20 70 72 6f 76 69 64   support, provid
1410: 69 6e 67 20 74 68 65 20 70 72 6f 67 72 61 6d 6d  ing the programm
1420: 65 72 20 77 69 74 68 20 6f 6e 6c 79 20 73 69 6d  er with only sim
1430: 70 6c 65 20 6b 65 79 2f 76 61 6c 75 65 20 70 61  ple key/value pa
1440: 69 72 73 2e 0a 7d 0a 0a 66 65 61 74 75 72 65 20  irs..}..feature 
1450: 74 79 70 69 6e 67 20 7b 4d 61 6e 69 66 65 73 74  typing {Manifest
1460: 20 74 79 70 69 6e 67 7d 20 7b 0a 20 20 4d 6f 73   typing} {.  Mos
1470: 74 20 53 51 4c 20 64 61 74 61 62 61 73 65 20 65  t SQL database e
1480: 6e 67 69 6e 65 73 20 75 73 65 20 73 74 61 74 69  ngines use stati
1490: 63 20 74 79 70 69 6e 67 2e 20 20 41 20 64 61 74  c typing.  A dat
14a0: 61 74 79 70 65 20 69 73 20 61 73 73 6f 63 69 61  atype is associa
14b0: 74 65 64 0a 20 20 77 69 74 68 20 65 61 63 68 20  ted.  with each 
14c0: 63 6f 6c 75 6d 6e 20 69 6e 20 61 20 74 61 62 6c  column in a tabl
14d0: 65 20 61 6e 64 20 6f 6e 6c 79 20 76 61 6c 75 65  e and only value
14e0: 73 20 6f 66 20 74 68 61 74 20 70 61 72 74 69 63  s of that partic
14f0: 75 6c 61 72 20 64 61 74 61 74 79 70 65 0a 20 20  ular datatype.  
1500: 61 72 65 20 61 6c 6c 6f 77 65 64 20 74 6f 20 62  are allowed to b
1510: 65 20 73 74 6f 72 65 64 20 69 6e 20 74 68 61 74  e stored in that
1520: 20 63 6f 6c 75 6d 6e 2e 20 20 53 51 4c 69 74 65   column.  SQLite
1530: 20 72 65 6c 61 78 65 73 20 74 68 69 73 20 72 65   relaxes this re
1540: 73 74 72 69 63 74 69 6f 6e 0a 20 20 62 79 20 75  striction.  by u
1550: 73 69 6e 67 20 6d 61 6e 69 66 65 73 74 20 74 79  sing manifest ty
1560: 70 69 6e 67 2e 0a 20 20 49 6e 20 6d 61 6e 69 66  ping..  In manif
1570: 65 73 74 20 74 79 70 69 6e 67 2c 20 74 68 65 20  est typing, the 
1580: 64 61 74 61 74 79 70 65 20 69 73 20 61 20 70 72  datatype is a pr
1590: 6f 70 65 72 74 79 20 6f 66 20 74 68 65 20 76 61  operty of the va
15a0: 6c 75 65 20 69 74 73 65 6c 66 2c 20 6e 6f 74 20  lue itself, not 
15b0: 0a 20 20 6f 66 20 74 68 65 20 63 6f 6c 75 6d 6e  .  of the column
15c0: 20 69 6e 20 77 68 69 63 68 20 74 68 65 20 76 61   in which the va
15d0: 6c 75 65 20 69 73 20 73 74 6f 72 65 64 2e 0a 20  lue is stored.. 
15e0: 20 53 51 4c 69 74 65 20 74 68 75 73 20 61 6c 6c   SQLite thus all
15f0: 6f 77 73 20 74 68 65 20 75 73 65 72 20 74 6f 20  ows the user to 
1600: 73 74 6f 72 65 0a 20 20 61 6e 79 20 76 61 6c 75  store.  any valu
1610: 65 20 6f 66 20 61 6e 79 20 64 61 74 61 74 79 70  e of any datatyp
1620: 65 20 69 6e 74 6f 20 61 6e 79 20 63 6f 6c 75 6d  e into any colum
1630: 6e 20 72 65 67 61 72 64 6c 65 73 73 20 6f 66 20  n regardless of 
1640: 74 68 65 20 64 65 63 6c 61 72 65 64 20 74 79 70  the declared typ
1650: 65 0a 20 20 6f 66 20 74 68 61 74 20 63 6f 6c 75  e.  of that colu
1660: 6d 6e 2e 20 20 28 54 68 65 72 65 20 61 72 65 20  mn.  (There are 
1670: 73 6f 6d 65 20 65 78 63 65 70 74 69 6f 6e 73 20  some exceptions 
1680: 74 6f 20 74 68 69 73 20 72 75 6c 65 3a 20 41 6e  to this rule: An
1690: 20 49 4e 54 45 47 45 52 0a 20 20 50 52 49 4d 41   INTEGER.  PRIMA
16a0: 52 59 20 4b 45 59 20 63 6f 6c 75 6d 6e 20 6d 61  RY KEY column ma
16b0: 79 20 6f 6e 6c 79 20 73 74 6f 72 65 20 69 6e 74  y only store int
16c0: 65 67 65 72 73 2e 20 20 41 6e 64 20 53 51 4c 69  egers.  And SQLi
16d0: 74 65 20 61 74 74 65 6d 70 74 73 20 74 6f 20 63  te attempts to c
16e0: 6f 65 72 63 65 0a 20 20 76 61 6c 75 65 73 20 69  oerce.  values i
16f0: 6e 74 6f 20 74 68 65 20 64 65 63 6c 61 72 65 64  nto the declared
1700: 20 64 61 74 61 74 79 70 65 20 6f 66 20 74 68 65   datatype of the
1710: 20 63 6f 6c 75 6d 6e 20 77 68 65 6e 20 69 74 20   column when it 
1720: 63 61 6e 2e 29 0a 20 20 3c 70 3e 0a 20 20 41 73  can.).  <p>.  As
1730: 20 66 61 72 20 61 73 20 77 65 20 63 61 6e 20 74   far as we can t
1740: 65 6c 6c 2c 20 74 68 65 20 53 51 4c 20 6c 61 6e  ell, the SQL lan
1750: 67 75 61 67 65 20 73 70 65 63 69 66 69 63 61 74  guage specificat
1760: 69 6f 6e 20 61 6c 6c 6f 77 73 20 74 68 65 20 75  ion allows the u
1770: 73 65 0a 20 20 6f 66 20 6d 61 6e 69 66 65 73 74  se.  of manifest
1780: 20 74 79 70 69 6e 67 2e 20 20 20 4e 65 76 65 72   typing.   Never
1790: 74 68 65 6c 65 73 73 2c 20 6d 6f 73 74 20 6f 74  theless, most ot
17a0: 68 65 72 20 53 51 4c 20 64 61 74 61 62 61 73 65  her SQL database
17b0: 20 65 6e 67 69 6e 65 73 20 61 72 65 0a 20 20 73   engines are.  s
17c0: 74 61 74 69 63 61 6c 6c 79 20 74 79 70 65 64 20  tatically typed 
17d0: 61 6e 64 20 73 6f 20 73 6f 6d 65 20 70 65 6f 70  and so some peop
17e0: 6c 65 0a 20 20 66 65 65 6c 20 74 68 61 74 20 74  le.  feel that t
17f0: 68 65 20 75 73 65 20 6f 66 20 6d 61 6e 69 66 65  he use of manife
1800: 73 74 20 74 79 70 69 6e 67 20 69 73 20 61 20 62  st typing is a b
1810: 75 67 20 69 6e 20 53 51 4c 69 74 65 2e 20 20 42  ug in SQLite.  B
1820: 75 74 20 74 68 65 20 61 75 74 68 6f 72 73 0a 20  ut the authors. 
1830: 20 6f 66 20 53 51 4c 69 74 65 20 66 65 65 6c 20   of SQLite feel 
1840: 76 65 72 79 20 73 74 72 6f 6e 67 6c 79 20 74 68  very strongly th
1850: 61 74 20 74 68 69 73 20 69 73 20 61 20 66 65 61  at this is a fea
1860: 74 75 72 65 2e 20 20 54 68 65 20 75 73 65 20 6f  ture.  The use o
1870: 66 20 6d 61 6e 69 66 65 73 74 0a 20 20 74 79 70  f manifest.  typ
1880: 69 6e 67 20 69 6e 20 53 51 4c 69 74 65 20 69 73  ing in SQLite is
1890: 20 61 20 64 65 6c 69 62 65 72 61 74 65 20 64 65   a deliberate de
18a0: 73 69 67 6e 20 64 65 63 69 73 69 6f 6e 20 77 68  sign decision wh
18b0: 69 63 68 20 68 61 73 20 70 72 6f 76 65 6e 20 69  ich has proven i
18c0: 6e 20 70 72 61 63 74 69 63 65 0a 20 20 74 6f 20  n practice.  to 
18d0: 6d 61 6b 65 20 53 51 4c 69 74 65 20 6d 6f 72 65  make SQLite more
18e0: 20 72 65 6c 69 61 62 6c 65 20 61 6e 64 20 65 61   reliable and ea
18f0: 73 69 65 72 20 74 6f 20 75 73 65 2c 20 65 73 70  sier to use, esp
1900: 65 63 69 61 6c 6c 79 20 77 68 65 6e 20 75 73 65  ecially when use
1910: 64 20 69 6e 0a 20 20 63 6f 6d 62 69 6e 61 74 69  d in.  combinati
1920: 6f 6e 20 77 69 74 68 20 64 79 6e 61 6d 69 63 61  on with dynamica
1930: 6c 6c 79 20 74 79 70 65 64 20 70 72 6f 67 72 61  lly typed progra
1940: 6d 6d 69 6e 67 20 6c 61 6e 67 75 61 67 65 73 20  mming languages 
1950: 73 75 63 68 20 61 73 20 54 63 6c 20 61 6e 64 0a  such as Tcl and.
1960: 20 20 50 79 74 68 6f 6e 2e 0a 7d 0a 0a 66 65 61    Python..}..fea
1970: 74 75 72 65 20 66 6c 65 78 20 7b 56 61 72 69 61  ture flex {Varia
1980: 62 6c 65 2d 6c 65 6e 67 74 68 20 72 65 63 6f 72  ble-length recor
1990: 64 73 7d 20 7b 0a 20 20 4d 6f 73 74 20 6f 74 68  ds} {.  Most oth
19a0: 65 72 20 53 51 4c 20 64 61 74 61 62 61 73 65 20  er SQL database 
19b0: 65 6e 67 69 6e 65 73 20 61 6c 6c 6f 63 61 74 65  engines allocate
19c0: 64 20 61 20 66 69 78 65 64 20 61 6d 6f 75 6e 74  d a fixed amount
19d0: 20 6f 66 20 64 69 73 6b 20 73 70 61 63 65 0a 20   of disk space. 
19e0: 20 66 6f 72 20 65 61 63 68 20 72 6f 77 20 69 6e   for each row in
19f0: 20 6d 6f 73 74 20 74 61 62 6c 65 73 2e 20 20 54   most tables.  T
1a00: 68 65 79 20 70 6c 61 79 20 73 70 65 63 69 61 6c  hey play special
1a10: 20 74 72 69 63 6b 73 20 66 6f 72 20 68 61 6e 64   tricks for hand
1a20: 6c 69 6e 67 0a 20 20 42 4c 4f 42 73 20 61 6e 64  ling.  BLOBs and
1a30: 20 43 4c 4f 42 73 20 77 68 69 63 68 20 63 61 6e   CLOBs which can
1a40: 20 62 65 20 6f 66 20 77 69 6c 64 6c 79 20 76 61   be of wildly va
1a50: 72 79 69 6e 67 20 6c 65 6e 67 74 68 2e 20 20 42  rying length.  B
1a60: 75 74 20 66 6f 72 20 6d 6f 73 74 0a 20 20 74 61  ut for most.  ta
1a70: 62 6c 65 73 2c 20 69 66 20 79 6f 75 20 64 65 63  bles, if you dec
1a80: 6c 61 72 65 20 61 20 63 6f 6c 75 6d 6e 20 74 6f  lare a column to
1a90: 20 62 65 20 61 20 56 41 52 43 48 41 52 28 31 30   be a VARCHAR(10
1aa0: 30 29 20 74 68 65 6e 20 74 68 65 20 64 61 74 61  0) then the data
1ab0: 62 61 73 65 0a 20 20 65 6e 67 69 6e 65 20 77 69  base.  engine wi
1ac0: 6c 6c 20 61 6c 6c 6f 63 61 74 65 0a 20 20 31 30  ll allocate.  10
1ad0: 30 20 62 79 74 65 73 20 6f 66 20 64 69 73 6b 20  0 bytes of disk 
1ae0: 73 70 61 63 65 20 72 65 67 61 72 64 6c 65 73 73  space regardless
1af0: 20 6f 66 20 68 6f 77 20 6d 75 63 68 20 69 6e 66   of how much inf
1b00: 6f 72 6d 61 74 69 6f 6e 20 79 6f 75 20 61 63 74  ormation you act
1b10: 75 61 6c 6c 79 0a 20 20 73 74 6f 72 65 20 69 6e  ually.  store in
1b20: 20 74 68 61 74 20 63 6f 6c 75 6d 6e 2e 0a 20 20   that column..  
1b30: 3c 70 3e 0a 20 20 53 51 4c 69 74 65 2c 20 69 6e  <p>.  SQLite, in
1b40: 20 63 6f 6e 74 72 61 73 74 2c 20 75 73 65 20 6f   contrast, use o
1b50: 6e 6c 79 20 74 68 65 20 61 6d 6f 75 6e 74 20 6f  nly the amount o
1b60: 66 20 64 69 73 6b 20 73 70 61 63 65 20 61 63 74  f disk space act
1b70: 75 61 6c 6c 79 0a 20 20 6e 65 65 64 65 64 20 74  ually.  needed t
1b80: 6f 20 73 74 6f 72 65 20 74 68 65 20 69 6e 66 6f  o store the info
1b90: 72 6d 61 74 69 6f 6e 20 69 6e 20 61 20 72 6f 77  rmation in a row
1ba0: 2e 20 20 49 66 20 79 6f 75 20 73 74 6f 72 65 20  .  If you store 
1bb0: 61 20 73 69 6e 67 6c 65 0a 20 20 63 68 61 72 61  a single.  chara
1bc0: 63 74 65 72 20 69 6e 20 61 20 56 41 52 43 48 41  cter in a VARCHA
1bd0: 52 28 31 30 30 29 20 63 6f 6c 75 6d 6e 2c 20 74  R(100) column, t
1be0: 68 65 6e 20 6f 6e 6c 79 20 61 20 73 69 6e 67 6c  hen only a singl
1bf0: 65 20 62 79 74 65 20 6f 66 20 64 69 73 6b 0a 20  e byte of disk. 
1c00: 20 73 70 61 63 65 20 69 73 20 63 6f 6e 73 75 6d   space is consum
1c10: 65 64 2e 20 20 28 41 63 74 75 61 6c 6c 79 20 74  ed.  (Actually t
1c20: 77 6f 20 62 79 74 65 73 20 2d 20 74 68 65 72 65  wo bytes - there
1c30: 20 69 73 20 73 6f 6d 65 20 6f 76 65 72 68 65 61   is some overhea
1c40: 64 20 61 74 0a 20 20 74 68 65 20 62 65 67 69 6e  d at.  the begin
1c50: 6e 69 6e 67 20 6f 66 20 65 61 63 68 20 63 6f 6c  ning of each col
1c60: 75 6d 6e 20 74 6f 20 72 65 63 6f 72 64 20 69 74  umn to record it
1c70: 73 20 64 61 74 61 74 79 70 65 20 61 6e 64 20 6c  s datatype and l
1c80: 65 6e 67 74 68 2e 29 0a 20 20 3c 70 3e 0a 20 20  ength.).  <p>.  
1c90: 54 68 65 20 75 73 65 20 6f 66 20 76 61 72 69 61  The use of varia
1ca0: 62 6c 65 2d 6c 65 6e 67 74 68 20 72 65 63 6f 72  ble-length recor
1cb0: 64 73 20 62 79 20 53 51 4c 69 74 65 20 68 61 73  ds by SQLite has
1cc0: 20 61 20 6e 75 6d 62 65 72 20 6f 66 20 61 64 76   a number of adv
1cd0: 61 6e 74 61 67 65 73 2e 0a 20 20 49 74 20 72 65  antages..  It re
1ce0: 73 75 6c 74 73 20 69 6e 20 73 6d 61 6c 6c 65 72  sults in smaller
1cf0: 20 64 61 74 61 62 61 73 65 20 66 69 6c 65 73 2c   database files,
1d00: 20 6f 62 76 69 6f 75 73 6c 79 2e 20 20 49 74 20   obviously.  It 
1d10: 61 6c 73 6f 20 6d 61 6b 65 73 20 74 68 65 0a 20  also makes the. 
1d20: 20 64 61 74 61 62 61 73 65 20 72 75 6e 20 66 61   database run fa
1d30: 73 74 65 72 2c 20 73 69 6e 63 65 20 74 68 65 72  ster, since ther
1d40: 65 20 69 73 20 6c 65 73 73 20 69 6e 66 6f 72 6d  e is less inform
1d50: 61 74 69 6f 6e 20 74 6f 20 6d 6f 76 65 20 74 6f  ation to move to
1d60: 20 61 6e 64 20 66 72 6f 6d 0a 20 20 64 69 73 6b   and from.  disk
1d70: 2e 20 20 41 6e 64 2c 20 74 68 65 20 75 73 65 20  .  And, the use 
1d80: 6f 66 20 76 61 72 69 61 62 6c 65 2d 6c 65 6e 67  of variable-leng
1d90: 74 68 20 72 65 63 6f 72 64 73 20 6d 61 6b 65 73  th records makes
1da0: 20 69 74 20 70 6f 73 73 69 62 6c 65 20 66 6f 72   it possible for
1db0: 0a 20 20 53 51 4c 69 74 65 20 74 6f 20 65 6d 70  .  SQLite to emp
1dc0: 6c 6f 79 20 6d 61 6e 69 66 65 73 74 20 74 79 70  loy manifest typ
1dd0: 69 6e 67 20 69 6e 73 74 65 61 64 20 6f 66 20 73  ing instead of s
1de0: 74 61 74 69 63 20 74 79 70 69 6e 67 2e 0a 7d 0a  tatic typing..}.
1df0: 0a 66 65 61 74 75 72 65 20 72 65 61 64 61 62 6c  .feature readabl
1e00: 65 20 7b 52 65 61 64 61 62 6c 65 20 73 6f 75 72  e {Readable sour
1e10: 63 65 20 63 6f 64 65 7d 20 7b 0a 20 20 54 68 65  ce code} {.  The
1e20: 20 73 6f 75 72 63 65 20 63 6f 64 65 20 74 6f 20   source code to 
1e30: 53 51 4c 69 74 65 20 69 73 20 64 65 73 69 67 6e  SQLite is design
1e40: 65 64 20 74 6f 20 62 65 20 72 65 61 64 61 62 6c  ed to be readabl
1e50: 65 20 61 6e 64 20 61 63 63 65 73 73 69 62 6c 65  e and accessible
1e60: 20 74 6f 0a 20 20 74 68 65 20 61 76 65 72 61 67   to.  the averag
1e70: 65 20 70 72 6f 67 72 61 6d 6d 65 72 2e 20 20 41  e programmer.  A
1e80: 6c 6c 20 70 72 6f 63 65 64 75 72 65 73 20 61 6e  ll procedures an
1e90: 64 20 64 61 74 61 20 73 74 72 75 63 74 75 72 65  d data structure
1ea0: 73 20 61 6e 64 20 6d 61 6e 79 0a 20 20 61 75 74  s and many.  aut
1eb0: 6f 6d 61 74 69 63 20 76 61 72 69 61 62 6c 65 73  omatic variables
1ec0: 20 61 72 65 20 63 61 72 65 66 75 6c 6c 79 20 63   are carefully c
1ed0: 6f 6d 6d 65 6e 74 65 64 20 77 69 74 68 20 75 73  ommented with us
1ee0: 65 66 75 6c 20 69 6e 66 6f 72 6d 61 74 69 6f 6e  eful information
1ef0: 20 61 62 6f 75 74 0a 20 20 77 68 61 74 20 74 68   about.  what th
1f00: 65 79 20 64 6f 2e 20 20 42 6f 69 6c 65 72 70 6c  ey do.  Boilerpl
1f10: 61 74 65 20 63 6f 6d 6d 65 6e 74 69 6e 67 20 69  ate commenting i
1f20: 73 20 6f 6d 69 74 74 65 64 2e 0a 7d 0a 0a 66 65  s omitted..}..fe
1f30: 61 74 75 72 65 20 76 64 62 65 20 7b 53 51 4c 20  ature vdbe {SQL 
1f40: 73 74 61 74 65 6d 65 6e 74 73 20 63 6f 6d 70 69  statements compi
1f50: 6c 65 20 69 6e 74 6f 20 76 69 72 74 75 61 6c 20  le into virtual 
1f60: 6d 61 63 68 69 6e 65 20 63 6f 64 65 7d 20 7b 0a  machine code} {.
1f70: 20 20 45 76 65 72 79 20 53 51 4c 20 64 61 74 61    Every SQL data
1f80: 62 61 73 65 20 65 6e 67 69 6e 65 20 63 6f 6d 70  base engine comp
1f90: 69 6c 65 73 20 65 61 63 68 20 53 51 4c 20 73 74  iles each SQL st
1fa0: 61 74 65 6d 65 6e 74 20 69 6e 74 6f 20 73 6f 6d  atement into som
1fb0: 65 20 6b 69 6e 64 20 6f 66 0a 20 20 69 6e 74 65  e kind of.  inte
1fc0: 72 6e 61 6c 20 64 61 74 61 20 73 74 72 75 63 74  rnal data struct
1fd0: 75 72 65 20 77 68 69 63 68 20 69 73 20 74 68 65  ure which is the
1fe0: 6e 20 75 73 65 64 20 74 6f 20 63 61 72 72 79 20  n used to carry 
1ff0: 6f 75 74 20 74 68 65 20 77 6f 72 6b 20 6f 66 20  out the work of 
2000: 74 68 65 0a 20 20 73 74 61 74 65 6d 65 6e 74 2e  the.  statement.
2010: 20 20 42 75 74 20 69 6e 20 6d 6f 73 74 20 53 51    But in most SQ
2020: 4c 20 65 6e 67 69 6e 65 73 20 74 68 61 74 20 69  L engines that i
2030: 6e 74 65 72 6e 61 6c 20 64 61 74 61 20 73 74 72  nternal data str
2040: 75 63 74 75 72 65 20 69 73 20 61 0a 20 20 63 6f  ucture is a.  co
2050: 6d 70 6c 65 78 20 77 65 62 20 6f 66 20 69 6e 74  mplex web of int
2060: 65 72 6c 69 6e 6b 65 64 20 73 74 72 75 63 74 75  erlinked structu
2070: 72 65 73 20 61 6e 64 20 6f 62 6a 65 63 74 73 2e  res and objects.
2080: 20 20 49 6e 20 53 51 4c 69 74 65 2c 20 74 68 65    In SQLite, the
2090: 20 63 6f 6d 70 69 6c 65 64 0a 20 20 66 6f 72 6d   compiled.  form
20a0: 20 6f 66 20 73 74 61 74 65 6d 65 6e 74 73 20 69   of statements i
20b0: 73 20 61 20 73 68 6f 72 74 20 70 72 6f 67 72 61  s a short progra
20c0: 6d 20 69 6e 20 61 20 6d 61 63 68 69 6e 65 2d 6c  m in a machine-l
20d0: 61 6e 67 75 61 67 65 20 6c 69 6b 65 0a 20 20 72  anguage like.  r
20e0: 65 70 72 65 73 65 6e 74 61 74 69 6f 6e 2e 20 20  epresentation.  
20f0: 55 73 65 72 73 20 6f 66 20 74 68 65 20 64 61 74  Users of the dat
2100: 61 62 61 73 65 20 63 61 6e 20 76 69 65 77 20 74  abase can view t
2110: 68 69 73 20 0a 20 20 3c 61 20 68 72 65 66 3d 22  his .  <a href="
2120: 6f 70 63 6f 64 65 2e 68 74 6d 6c 22 3e 76 69 72  opcode.html">vir
2130: 74 75 61 6c 20 6d 61 63 68 69 6e 65 20 6c 61 6e  tual machine lan
2140: 67 75 61 67 65 3c 2f 61 3e 0a 20 20 62 79 20 70  guage</a>.  by p
2150: 72 65 70 65 6e 64 69 6e 67 20 74 68 65 20 3c 61  repending the <a
2160: 20 68 72 65 66 3d 22 6c 61 6e 67 5f 65 78 70 6c   href="lang_expl
2170: 61 69 6e 2e 68 74 6d 6c 22 3e 45 58 50 4c 41 49  ain.html">EXPLAI
2180: 4e 3c 2f 61 3e 20 6b 65 79 77 6f 72 64 0a 20 20  N</a> keyword.  
2190: 74 6f 20 61 20 71 75 65 72 79 2e 0a 20 20 3c 70  to a query..  <p
21a0: 3e 0a 20 20 54 68 65 20 75 73 65 20 6f 66 20 61  >.  The use of a
21b0: 20 76 69 72 74 75 61 6c 20 6d 61 63 68 69 6e 65   virtual machine
21c0: 20 69 6e 20 53 51 4c 69 74 65 20 68 61 73 20 62   in SQLite has b
21d0: 65 65 6e 20 61 20 67 72 65 61 74 20 62 65 6e 65  een a great bene
21e0: 66 69 74 20 74 6f 20 74 68 65 0a 20 20 6c 69 62  fit to the.  lib
21f0: 72 61 72 79 27 73 20 64 65 76 65 6c 6f 70 6d 65  rary's developme
2200: 6e 74 2e 20 20 54 68 65 20 76 69 72 74 75 61 6c  nt.  The virtual
2210: 20 6d 61 63 68 69 6e 65 20 70 72 6f 76 69 64 65   machine provide
2220: 73 20 61 20 63 72 69 73 70 2c 20 77 65 6c 6c 2d  s a crisp, well-
2230: 64 65 66 69 6e 65 64 0a 20 20 6a 75 6e 63 74 69  defined.  juncti
2240: 6f 6e 20 62 65 74 77 65 65 6e 20 74 68 65 20 66  on between the f
2250: 72 6f 6e 74 2d 65 6e 64 20 6f 66 20 53 51 4c 69  ront-end of SQLi
2260: 74 65 20 28 74 68 65 20 70 61 72 74 20 74 68 61  te (the part tha
2270: 74 20 70 61 72 73 65 73 20 53 51 4c 0a 20 20 73  t parses SQL.  s
2280: 74 61 74 65 6d 65 6e 74 73 20 61 6e 64 20 67 65  tatements and ge
2290: 6e 65 72 61 74 65 73 20 76 69 72 74 75 61 6c 20  nerates virtual 
22a0: 6d 61 63 68 69 6e 65 20 63 6f 64 65 29 20 61 6e  machine code) an
22b0: 64 20 74 68 65 20 62 61 63 6b 2d 65 6e 64 20 28  d the back-end (
22c0: 74 68 65 0a 20 20 70 61 72 74 20 74 68 61 74 20  the.  part that 
22d0: 65 78 65 63 75 74 65 73 20 74 68 65 20 76 69 72  executes the vir
22e0: 74 75 61 6c 20 6d 61 63 68 69 6e 65 20 63 6f 64  tual machine cod
22f0: 65 20 61 6e 64 20 63 6f 6d 70 75 74 65 73 20 61  e and computes a
2300: 20 72 65 73 75 6c 74 2e 29 0a 20 20 54 68 65 20   result.).  The 
2310: 76 69 72 74 75 61 6c 20 6d 61 63 68 69 6e 65 20  virtual machine 
2320: 61 6c 6c 6f 77 73 20 74 68 65 20 64 65 76 65 6c  allows the devel
2330: 6f 70 65 72 73 20 74 6f 20 73 65 65 20 63 6c 65  opers to see cle
2340: 61 72 6c 79 20 61 6e 64 20 69 6e 20 61 6e 0a 20  arly and in an. 
2350: 20 65 61 73 69 6c 79 20 72 65 61 64 61 62 6c 65   easily readable
2360: 20 66 6f 72 6d 20 77 68 61 74 20 53 51 4c 69 74   form what SQLit
2370: 65 20 69 73 20 74 72 79 69 6e 67 20 74 6f 20 64  e is trying to d
2380: 6f 20 77 69 74 68 20 65 61 63 68 20 73 74 61 74  o with each stat
2390: 65 6d 65 6e 74 0a 20 20 69 74 20 63 6f 6d 70 69  ement.  it compi
23a0: 6c 65 73 2c 20 77 68 69 63 68 20 69 73 20 61 20  les, which is a 
23b0: 74 72 65 6d 65 6e 64 6f 75 73 20 68 65 6c 70 20  tremendous help 
23c0: 69 6e 20 64 65 62 75 67 67 69 6e 67 2e 0a 20 20  in debugging..  
23d0: 44 65 70 65 6e 64 69 6e 67 20 6f 6e 20 68 6f 77  Depending on how
23e0: 20 69 74 20 69 73 20 63 6f 6d 70 69 6c 65 64 2c   it is compiled,
23f0: 20 53 51 4c 69 74 65 20 61 6c 73 6f 20 68 61 73   SQLite also has
2400: 20 74 68 65 20 63 61 70 61 62 69 6c 69 74 79 20   the capability 
2410: 6f 66 0a 20 20 74 72 61 63 69 6e 67 20 74 68 65  of.  tracing the
2420: 20 65 78 65 63 75 74 69 6f 6e 20 6f 66 20 74 68   execution of th
2430: 65 20 76 69 72 74 75 61 6c 20 6d 61 63 68 69 6e  e virtual machin
2440: 65 20 2d 20 70 72 69 6e 74 69 6e 67 20 65 61 63  e - printing eac
2450: 68 0a 20 20 76 69 72 74 75 61 6c 20 6d 61 63 68  h.  virtual mach
2460: 69 6e 65 20 69 6e 73 74 72 75 63 74 69 6f 6e 20  ine instruction 
2470: 61 6e 64 20 69 74 73 20 72 65 73 75 6c 74 20 61  and its result a
2480: 73 20 69 74 20 65 78 65 63 75 74 65 73 2e 0a 7d  s it executes..}
2490: 0a 0a 23 66 65 61 74 75 72 65 20 62 69 6e 64 69  ..#feature bindi
24a0: 6e 67 20 7b 54 69 67 68 74 20 62 69 6e 64 69 6e  ng {Tight bindin
24b0: 67 73 20 74 6f 20 64 79 6e 61 6d 69 63 20 6c 61  gs to dynamic la
24c0: 6e 67 75 61 67 65 73 7d 20 7b 0a 23 20 20 42 65  nguages} {.#  Be
24d0: 63 61 75 73 65 20 69 74 20 69 73 20 65 6d 62 65  cause it is embe
24e0: 64 64 65 64 2c 20 53 51 4c 69 74 65 20 63 61 6e  dded, SQLite can
24f0: 20 68 61 76 65 20 61 20 6d 75 63 68 20 74 69 67   have a much tig
2500: 68 74 65 72 20 61 6e 64 20 6d 6f 72 65 20 6e 61  hter and more na
2510: 74 75 72 61 6c 0a 23 20 20 62 69 6e 64 69 6e 67  tural.#  binding
2520: 20 74 6f 20 68 69 67 68 2d 6c 65 76 65 6c 20 64   to high-level d
2530: 79 6e 61 6d 69 63 20 6c 61 6e 67 75 61 67 65 73  ynamic languages
2540: 20 73 75 63 68 20 61 73 20 54 63 6c 2c 20 50 65   such as Tcl, Pe
2550: 72 6c 2c 20 50 79 74 68 6f 6e 2c 0a 23 20 20 50  rl, Python,.#  P
2560: 48 50 2c 20 61 6e 64 20 52 75 62 79 2e 0a 23 20  HP, and Ruby..# 
2570: 20 46 6f 72 20 65 78 61 6d 70 6c 65 2c 20 0a 23   For example, .#
2580: 7d 0a 0a 66 65 61 74 75 72 65 20 6c 69 63 65 6e  }..feature licen
2590: 73 65 20 7b 50 75 62 6c 69 63 20 64 6f 6d 61 69  se {Public domai
25a0: 6e 7d 20 7b 0a 20 20 54 68 65 20 73 6f 75 72 63  n} {.  The sourc
25b0: 65 20 63 6f 64 65 20 66 6f 72 20 53 51 4c 69 74  e code for SQLit
25c0: 65 20 69 73 20 69 6e 20 74 68 65 20 70 75 62 6c  e is in the publ
25d0: 69 63 20 64 6f 6d 61 69 6e 2e 20 20 4e 6f 20 63  ic domain.  No c
25e0: 6c 61 69 6d 20 6f 66 20 63 6f 70 79 72 69 67 68  laim of copyrigh
25f0: 74 0a 20 20 69 73 20 6d 61 64 65 20 6f 6e 20 61  t.  is made on a
2600: 6e 79 20 70 61 72 74 20 6f 66 20 74 68 65 20 63  ny part of the c
2610: 6f 72 65 20 73 6f 75 72 63 65 20 63 6f 64 65 2e  ore source code.
2620: 20 20 28 54 68 65 20 64 6f 63 75 6d 65 6e 74 61    (The documenta
2630: 74 69 6f 6e 20 61 6e 64 20 74 65 73 74 0a 20 20  tion and test.  
2640: 63 6f 64 65 20 69 73 20 61 20 64 69 66 66 65 72  code is a differ
2650: 65 6e 74 20 6d 61 74 74 65 72 20 2d 20 73 6f 6d  ent matter - som
2660: 65 20 73 65 63 74 69 6f 6e 73 20 6f 66 20 64 6f  e sections of do
2670: 63 75 6d 65 6e 74 61 74 69 6f 6e 20 61 6e 64 20  cumentation and 
2680: 74 65 73 74 20 6c 6f 67 69 63 0a 20 20 61 72 65  test logic.  are
2690: 20 67 6f 76 65 72 6e 65 64 20 62 79 20 6f 70 65   governed by ope
26a0: 6e 2d 73 6f 75 72 63 65 20 6c 69 63 65 6e 73 65  n-source license
26b0: 73 2e 29 20 20 41 6c 6c 20 63 6f 6e 74 72 69 62  s.)  All contrib
26c0: 75 74 6f 72 73 20 74 6f 20 74 68 65 0a 20 20 53  utors to the.  S
26d0: 51 4c 69 74 65 20 63 6f 72 65 20 73 6f 66 74 77  QLite core softw
26e0: 61 72 65 20 68 61 76 65 20 73 69 67 6e 65 64 20  are have signed 
26f0: 61 66 66 69 64 61 76 69 74 73 20 73 70 65 63 69  affidavits speci
2700: 66 69 63 61 6c 6c 79 20 64 69 73 61 76 6f 77 69  fically disavowi
2710: 6e 67 20 61 6e 79 0a 20 20 63 6f 70 79 72 69 67  ng any.  copyrig
2720: 68 74 20 69 6e 74 65 72 65 73 74 20 69 6e 20 74  ht interest in t
2730: 68 65 20 63 6f 64 65 2e 20 20 54 68 69 73 20 6d  he code.  This m
2740: 65 61 6e 73 20 74 68 61 74 20 61 6e 79 62 6f 64  eans that anybod
2750: 79 20 69 73 20 61 62 6c 65 20 74 6f 20 6c 65 67  y is able to leg
2760: 61 6c 6c 79 0a 20 20 64 6f 20 61 6e 79 74 68 69  ally.  do anythi
2770: 6e 67 20 74 68 65 79 20 77 61 6e 74 20 77 69 74  ng they want wit
2780: 68 20 74 68 65 20 53 51 4c 69 74 65 20 73 6f 75  h the SQLite sou
2790: 72 63 65 20 63 6f 64 65 2e 0a 20 20 3c 70 3e 0a  rce code..  <p>.
27a0: 20 20 54 68 65 72 65 20 61 72 65 20 6f 74 68 65    There are othe
27b0: 72 20 53 51 4c 20 64 61 74 61 62 61 73 65 20 65  r SQL database e
27c0: 6e 67 69 6e 65 73 20 77 69 74 68 20 6c 69 62 65  ngines with libe
27d0: 72 61 6c 20 6c 69 63 65 6e 73 65 73 20 74 68 61  ral licenses tha
27e0: 74 20 61 6c 6c 6f 77 0a 20 20 74 68 65 20 63 6f  t allow.  the co
27f0: 64 65 20 74 6f 20 62 65 20 62 72 6f 61 64 6c 79  de to be broadly
2800: 20 61 6e 64 20 66 72 65 65 6c 79 20 75 73 65 64   and freely used
2810: 2e 20 20 42 75 74 20 74 68 6f 73 65 20 6f 74 68  .  But those oth
2820: 65 72 20 65 6e 67 69 6e 65 73 20 61 72 65 0a 20  er engines are. 
2830: 20 73 74 69 6c 6c 20 67 6f 76 65 72 6e 65 64 20   still governed 
2840: 62 79 20 63 6f 70 79 72 69 67 68 74 20 6c 61 77  by copyright law
2850: 2e 20 20 53 51 4c 69 74 65 20 69 73 20 64 69 66  .  SQLite is dif
2860: 66 65 72 65 6e 74 20 69 6e 20 74 68 61 74 20 63  ferent in that c
2870: 6f 70 79 72 69 67 68 74 0a 20 20 6c 61 77 20 73  opyright.  law s
2880: 69 6d 70 6c 79 20 64 6f 65 73 20 6e 6f 74 20 61  imply does not a
2890: 70 70 6c 79 2e 20 20 0a 20 20 3c 70 3e 0a 20 20  pply.  .  <p>.  
28a0: 54 68 65 20 73 6f 75 72 63 65 20 63 6f 64 65 20  The source code 
28b0: 66 69 6c 65 73 20 66 6f 72 20 6f 74 68 65 72 20  files for other 
28c0: 53 51 4c 20 64 61 74 61 62 61 73 65 20 65 6e 67  SQL database eng
28d0: 69 6e 65 73 20 74 79 70 69 63 61 6c 6c 79 20 62  ines typically b
28e0: 65 67 69 6e 0a 20 20 77 69 74 68 20 61 20 63 6f  egin.  with a co
28f0: 6d 6d 65 6e 74 20 64 65 73 63 72 69 62 69 6e 67  mment describing
2900: 20 79 6f 75 72 20 6c 69 63 65 6e 73 65 20 72 69   your license ri
2910: 67 68 74 73 20 74 6f 20 76 69 65 77 20 61 6e 64  ghts to view and
2920: 20 63 6f 70 79 20 74 68 61 74 20 66 69 6c 65 2e   copy that file.
2930: 0a 20 20 54 68 65 20 53 51 4c 69 74 65 20 73 6f  .  The SQLite so
2940: 75 72 63 65 20 63 6f 64 65 20 63 6f 6e 74 61 69  urce code contai
2950: 6e 73 20 6e 6f 20 6c 69 63 65 6e 73 65 20 73 69  ns no license si
2960: 6e 63 65 20 69 74 20 69 73 20 6e 6f 74 20 67 6f  nce it is not go
2970: 76 65 72 6e 65 64 20 62 79 0a 20 20 63 6f 70 79  verned by.  copy
2980: 72 69 67 68 74 2e 20 20 49 6e 73 74 65 61 64 20  right.  Instead 
2990: 6f 66 20 61 20 6c 69 63 65 6e 73 65 2c 20 74 68  of a license, th
29a0: 65 20 53 51 4c 69 74 65 20 73 6f 75 72 63 65 20  e SQLite source 
29b0: 63 6f 64 65 20 6f 66 66 65 72 73 20 61 20 62 6c  code offers a bl
29c0: 65 73 73 69 6e 67 3a 0a 20 20 3c 62 6c 6f 63 6b  essing:.  <block
29d0: 71 75 6f 74 65 3e 0a 20 20 3c 69 3e 4d 61 79 20  quote>.  <i>May 
29e0: 79 6f 75 20 64 6f 20 67 6f 6f 64 20 61 6e 64 20  you do good and 
29f0: 6e 6f 74 20 65 76 69 6c 3c 62 72 3e 0a 20 20 4d  not evil<br>.  M
2a00: 61 79 20 79 6f 75 20 66 69 6e 64 20 66 6f 72 67  ay you find forg
2a10: 69 76 65 6e 65 73 73 20 66 6f 72 20 79 6f 75 72  iveness for your
2a20: 73 65 6c 66 20 61 6e 64 20 66 6f 72 67 69 76 65  self and forgive
2a30: 20 6f 74 68 65 72 73 3c 62 72 3e 0a 20 20 4d 61   others<br>.  Ma
2a40: 79 20 79 6f 75 20 73 68 61 72 65 20 66 72 65 65  y you share free
2a50: 6c 79 2c 20 6e 65 76 65 72 20 74 61 6b 69 6e 67  ly, never taking
2a60: 20 6d 6f 72 65 20 74 68 61 6e 20 79 6f 75 20 67   more than you g
2a70: 69 76 65 2e 3c 2f 69 3e 0a 20 20 3c 2f 62 6c 6f  ive.</i>.  </blo
2a80: 63 6b 71 75 6f 74 65 3e 0a 7d 0a 0a 66 65 61 74  ckquote>.}..feat
2a90: 75 72 65 20 65 78 74 65 6e 73 69 6f 6e 73 20 7b  ure extensions {
2aa0: 53 51 4c 20 6c 61 6e 67 75 61 67 65 20 65 78 74  SQL language ext
2ab0: 65 6e 73 69 6f 6e 73 7d 20 7b 0a 20 20 53 51 4c  ensions} {.  SQL
2ac0: 69 74 65 20 70 72 6f 76 69 64 65 73 20 61 20 6e  ite provides a n
2ad0: 75 6d 62 65 72 20 6f 66 20 65 6e 68 61 6e 63 65  umber of enhance
2ae0: 6d 65 6e 74 73 20 74 6f 20 74 68 65 20 53 51 4c  ments to the SQL
2af0: 20 6c 61 6e 67 75 61 67 65 20 0a 20 20 6e 6f 74   language .  not
2b00: 20 6e 6f 72 6d 61 6c 6c 79 20 66 6f 75 6e 64 20   normally found 
2b10: 69 6e 20 6f 74 68 65 72 20 64 61 74 61 62 61 73  in other databas
2b20: 65 20 65 6e 67 69 6e 65 73 2e 0a 20 20 54 68 65  e engines..  The
2b30: 20 45 58 50 4c 41 49 4e 20 6b 65 79 77 6f 72 64   EXPLAIN keyword
2b40: 20 61 6e 64 20 6d 61 6e 69 66 65 73 74 20 74 79   and manifest ty
2b50: 70 69 6e 67 20 68 61 76 65 20 61 6c 72 65 61 64  ping have alread
2b60: 79 20 62 65 65 6e 20 6d 65 6e 74 69 6f 6e 65 64  y been mentioned
2b70: 0a 20 20 61 62 6f 76 65 2e 20 20 53 51 4c 69 74  .  above.  SQLit
2b80: 65 20 61 6c 73 6f 20 70 72 6f 76 69 64 65 73 20  e also provides 
2b90: 73 74 61 74 65 6d 65 6e 74 73 20 73 75 63 68 20  statements such 
2ba0: 61 73 20 0a 20 20 3c 61 20 68 72 65 66 3d 22 6c  as .  <a href="l
2bb0: 61 6e 67 5f 72 65 70 6c 61 63 65 2e 68 74 6d 6c  ang_replace.html
2bc0: 22 3e 52 45 50 4c 41 43 45 3c 2f 61 3e 20 61 6e  ">REPLACE</a> an
2bd0: 64 20 74 68 65 0a 20 20 3c 61 20 68 72 65 66 3d  d the.  <a href=
2be0: 22 6c 61 6e 67 5f 63 6f 6e 66 6c 69 63 74 2e 68  "lang_conflict.h
2bf0: 74 6d 6c 22 3e 4f 4e 20 43 4f 4e 46 4c 49 43 54  tml">ON CONFLICT
2c00: 3c 2f 61 3e 20 63 6c 61 75 73 65 20 74 68 61 74  </a> clause that
2c10: 20 61 6c 6c 6f 77 20 66 6f 72 0a 20 20 61 64 64   allow for.  add
2c20: 65 64 20 63 6f 6e 74 72 6f 6c 20 6f 76 65 72 20  ed control over 
2c30: 74 68 65 20 72 65 73 6f 6c 75 74 69 6f 6e 20 6f  the resolution o
2c40: 66 20 63 6f 6e 73 74 72 61 69 6e 74 20 63 6f 6e  f constraint con
2c50: 66 6c 69 63 74 73 2e 0a 20 20 53 51 4c 69 74 65  flicts..  SQLite
2c60: 20 73 75 70 70 6f 72 74 73 20 3c 61 20 68 72 65   supports <a hre
2c70: 66 3d 22 6c 61 6e 67 5f 61 74 74 61 63 68 2e 68  f="lang_attach.h
2c80: 74 6d 6c 22 3e 41 54 54 41 43 48 3c 2f 61 3e 20  tml">ATTACH</a> 
2c90: 61 6e 64 0a 20 20 3c 61 20 68 72 65 66 3d 22 6c  and.  <a href="l
2ca0: 61 6e 67 5f 64 65 74 61 63 68 2e 68 74 6d 6c 22  ang_detach.html"
2cb0: 3e 44 45 54 41 43 48 3c 2f 61 3e 20 63 6f 6d 6d  >DETACH</a> comm
2cc0: 61 6e 64 73 20 74 68 61 74 20 61 6c 6c 6f 77 20  ands that allow 
2cd0: 6d 75 6c 74 69 70 6c 65 0a 20 20 69 6e 64 65 70  multiple.  indep
2ce0: 65 6e 64 65 6e 74 20 64 61 74 61 62 61 73 65 73  endent databases
2cf0: 20 74 6f 20 62 65 20 75 73 65 64 20 74 6f 67 65   to be used toge
2d00: 74 68 65 72 20 69 6e 20 74 68 65 20 73 61 6d 65  ther in the same
2d10: 20 71 75 65 72 79 2e 0a 20 20 41 6e 64 20 53 51   query..  And SQ
2d20: 4c 69 74 65 20 64 65 66 69 6e 65 73 20 41 50 49  Lite defines API
2d30: 73 20 74 68 61 74 20 61 6c 6c 6f 77 73 20 74 68  s that allows th
2d40: 65 20 75 73 65 72 20 74 6f 20 61 64 64 20 6e 65  e user to add ne
2d50: 77 0a 20 20 3c 61 20 68 72 65 66 3d 22 63 33 72  w.  <a href="c3r
2d60: 65 66 2f 63 72 65 61 74 65 5f 66 75 6e 63 74 69  ef/create_functi
2d70: 6f 6e 2e 68 74 6d 6c 22 3e 53 51 4c 20 66 75 6e  on.html">SQL fun
2d80: 63 74 69 6f 6e 73 3c 2f 61 3e 0a 20 20 61 6e 64  ctions</a>.  and
2d90: 20 3c 61 20 68 72 65 66 3d 22 63 33 72 65 66 2f   <a href="c3ref/
2da0: 63 72 65 61 74 65 5f 63 6f 6c 6c 61 74 69 6f 6e  create_collation
2db0: 2e 68 74 6d 6c 22 3e 63 6f 6c 6c 61 74 69 6e 67  .html">collating
2dc0: 20 73 65 71 75 65 6e 63 65 73 3c 2f 61 3e 2e 0a   sequences</a>..
2dd0: 7d 0a 0a 3c 2f 74 63 6c 3e 0a                    }..</tcl>.