Hex Artifact Content
Not logged in

Artifact 43d2197f8089370f9f25e44e8e855014d0130e08:

Wiki page [TemporaryGeometries] by sandro 2020-04-08 12:13:32.
0000: 44 20 32 30 32 30 2d 30 34 2d 30 38 54 31 32 3a  D 2020-04-08T12:
0010: 31 33 3a 33 32 2e 35 36 31 0a 4c 20 54 65 6d 70  13:32.561.L Temp
0020: 6f 72 61 72 79 47 65 6f 6d 65 74 72 69 65 73 0a  oraryGeometries.
0030: 55 20 73 61 6e 64 72 6f 0a 57 20 37 31 37 36 0a  U sandro.W 7176.
0040: 42 61 63 6b 20 74 6f 20 3c 61 20 68 72 65 66 3d  Back to <a href=
0050: 22 68 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69  "https://www.gai
0060: 61 2d 67 69 73 2e 69 74 2f 66 6f 73 73 69 6c 2f  a-gis.it/fossil/
0070: 6c 69 62 73 70 61 74 69 61 6c 69 74 65 2f 77 69  libspatialite/wi
0080: 6b 69 3f 6e 61 6d 65 3d 35 2e 30 2e 30 2d 64 6f  ki?name=5.0.0-do
0090: 63 22 3e 35 2e 30 2e 30 2d 64 6f 63 20 6d 61 69  c">5.0.0-doc mai
00a0: 6e 20 70 61 67 65 3c 2f 61 3e 3c 68 72 3e 3c 62  n page</a><hr><b
00b0: 72 3e 0d 0a 3c 68 32 3e 41 62 6f 75 74 20 54 65  r>..<h2>About Te
00c0: 6d 70 6f 72 61 72 79 20 47 65 6f 6d 65 74 72 69  mporary Geometri
00d0: 65 73 3c 2f 68 32 3e 0d 0a 53 74 61 72 74 69 6e  es</h2>..Startin
00e0: 67 20 73 69 6e 63 65 20 76 65 72 73 69 6f 6e 20  g since version 
00f0: 3c 62 3e 35 2e 30 2e 30 3c 2f 62 3e 20 53 70 61  <b>5.0.0</b> Spa
0100: 74 69 61 4c 69 74 65 20 68 61 73 20 74 68 65 20  tiaLite has the 
0110: 63 61 70 61 62 69 6c 69 74 79 20 74 6f 20 66 75  capability to fu
0120: 6c 6c 79 20 73 75 70 70 6f 72 74 20 3c 69 3e 3c  lly support <i><
0130: 62 3e 72 65 61 64 2d 77 72 69 74 65 3c 2f 62 3e  b>read-write</b>
0140: 3c 2f 69 3e 20 3c 62 3e 47 65 6f 6d 65 74 72 79  </i> <b>Geometry
0150: 20 43 6f 6c 75 6d 6e 73 3c 2f 62 3e 20 73 74 6f   Columns</b> sto
0160: 72 65 64 20 6e 6f 74 20 6f 6e 6c 79 20 69 6e 74  red not only int
0170: 6f 20 74 68 65 20 3c 62 3e 4d 41 49 4e 20 44 41  o the <b>MAIN DA
0180: 54 41 42 41 53 45 3c 2f 62 3e 2c 20 62 75 74 20  TABASE</b>, but 
0190: 61 6c 73 6f 20 69 6e 74 6f 20 61 6e 79 20 6f 74  also into any ot
01a0: 68 65 72 20 3c 62 3e 41 54 54 41 43 48 45 44 20  her <b>ATTACHED 
01b0: 44 41 54 41 42 41 53 45 3c 2f 62 3e 20 62 61 73  DATABASE</b> bas
01c0: 65 64 20 6f 6e 20 73 74 6f 72 61 67 65 20 6f 66  ed on storage of
01d0: 20 74 68 65 20 73 70 65 63 69 61 6c 20 3c 62 3e   the special <b>
01e0: 3a 6d 65 6d 6f 72 79 3a 3c 2f 62 3e 20 74 79 70  :memory:</b> typ
01f0: 65 2e 0d 0a 3c 68 33 3e 51 75 69 63 6b 20 72 65  e...<h3>Quick re
0200: 63 61 6c 6c 3c 2f 68 33 3e 0d 0a 3c 76 65 72 62  call</h3>..<verb
0210: 61 74 69 6d 3e 0d 0a 41 54 54 41 43 48 20 44 41  atim>..ATTACH DA
0220: 54 41 42 41 53 45 20 27 2e 2f 6d 79 5f 64 61 74  TABASE './my_dat
0230: 61 62 61 73 65 73 2f 64 62 31 2e 73 71 6c 69 74  abases/db1.sqlit
0240: 65 27 20 41 53 20 61 3b 0d 0a 3c 2f 76 65 72 62  e' AS a;..</verb
0250: 61 74 69 6d 3e 0d 0a 41 20 73 74 61 74 65 6d 65  atim>..A stateme
0260: 6e 74 20 6c 69 6b 65 20 74 68 65 20 61 62 6f 76  nt like the abov
0270: 65 20 6f 6e 65 20 77 69 6c 6c 20 3c 62 3e 41 54  e one will <b>AT
0280: 54 41 43 48 3c 2f 62 3e 20 61 20 66 75 72 74 68  TACH</b> a furth
0290: 65 72 20 53 51 4c 69 74 65 20 64 61 74 61 62 61  er SQLite databa
02a0: 73 65 20 66 69 6c 65 20 74 6f 20 74 68 65 20 63  se file to the c
02b0: 75 72 72 65 6e 74 20 63 6f 6e 6e 65 63 74 69 6f  urrent connectio
02c0: 6e 2e 0d 0a 49 66 20 74 68 65 20 64 61 74 61 62  n...If the datab
02d0: 61 73 65 20 66 69 6c 65 20 64 6f 65 73 20 6e 6f  ase file does no
02e0: 74 20 79 65 74 20 61 6c 72 65 61 64 79 20 65 78  t yet already ex
02f0: 69 73 74 2c 20 69 74 20 77 69 6c 6c 20 62 65 20  ist, it will be 
0300: 63 72 65 61 74 65 64 20 6f 6e 2d 74 68 65 2d 66  created on-the-f
0310: 6c 79 2e 0d 0a 3c 76 65 72 62 61 74 69 6d 3e 0d  ly...<verbatim>.
0320: 0a 43 52 45 41 54 45 20 54 41 42 4c 45 20 6d 61  .CREATE TABLE ma
0330: 69 6e 2e 74 65 73 74 20 28 0d 0a 20 20 20 20 69  in.test (..    i
0340: 64 20 49 4e 54 45 47 45 52 20 50 52 49 4d 41 52  d INTEGER PRIMAR
0350: 59 20 4b 45 59 2c 0d 0a 20 20 20 20 6e 61 6d 65  Y KEY,..    name
0360: 20 54 45 58 54 20 4e 4f 54 20 4e 55 4c 4c 29 3b   TEXT NOT NULL);
0370: 0d 0a 49 4e 53 45 52 54 20 49 4e 54 4f 20 6d 61  ..INSERT INTO ma
0380: 69 6e 2e 74 65 73 74 20 56 41 4c 55 45 53 20 28  in.test VALUES (
0390: 20 31 2c 20 27 6f 6e 65 27 20 29 3b 0d 0a 53 45   1, 'one' );..SE
03a0: 4c 45 43 54 20 2a 20 46 52 4f 4d 20 6d 61 69 6e  LECT * FROM main
03b0: 2e 74 65 73 74 3b 0d 0a 2d 2d 2d 2d 2d 2d 2d 2d  .test;..--------
03c0: 2d 2d 2d 2d 0d 0a 31 20 20 20 20 6f 6e 65 0d 0a  ----..1    one..
03d0: 0d 0a 0d 0a 0d 0a 43 52 45 41 54 45 20 54 41 42  ......CREATE TAB
03e0: 4c 45 20 61 2e 74 65 73 74 20 28 0d 0a 20 20 20  LE a.test (..   
03f0: 20 69 64 20 49 4e 54 45 47 45 52 20 50 52 49 4d   id INTEGER PRIM
0400: 41 52 59 20 4b 45 59 2c 0d 0a 20 20 20 20 6e 61  ARY KEY,..    na
0410: 6d 65 20 54 45 58 54 20 4e 4f 54 20 4e 55 4c 4c  me TEXT NOT NULL
0420: 29 3b 0d 0a 49 4e 53 45 52 54 20 49 4e 54 4f 20  );..INSERT INTO 
0430: 61 2e 74 65 73 74 20 56 41 4c 55 45 53 20 28 20  a.test VALUES ( 
0440: 32 2c 20 27 74 77 6f 27 20 29 3b 0d 0a 53 45 4c  2, 'two' );..SEL
0450: 45 43 54 20 2a 20 46 52 4f 4d 20 61 2e 74 65 73  ECT * FROM a.tes
0460: 74 3b 0d 0a 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  t;..------------
0470: 0d 0a 32 20 20 20 20 74 77 6f 0d 0a 3c 2f 76 65  ..2    two..</ve
0480: 72 62 61 74 69 6d 3e 0d 0a 45 61 63 68 20 64 61  rbatim>..Each da
0490: 74 61 62 61 73 65 20 61 74 74 61 63 68 65 64 20  tabase attached 
04a0: 74 6f 20 74 68 65 20 73 61 6d 65 20 63 6f 6e 6e  to the same conn
04b0: 65 63 74 69 6f 6e 20 68 61 73 20 69 74 73 20 6f  ection has its o
04c0: 77 6e 20 69 6e 64 65 70 65 6e 64 65 6e 74 20 3c  wn independent <
04d0: 62 3e 6e 61 6d 65 73 70 61 63 65 3c 2f 62 3e 2c  b>namespace</b>,
04e0: 20 73 6f 20 74 68 65 20 73 61 6d 65 20 3c 62 3e   so the same <b>
04f0: 74 61 62 6c 65 2d 6e 61 6d 65 3c 2f 62 3e 20 63  table-name</b> c
0500: 61 6e 20 62 65 20 73 61 66 65 6c 79 20 75 73 65  an be safely use
0510: 64 20 6f 6e 20 64 69 66 66 65 72 65 6e 74 20 64  d on different d
0520: 61 74 61 62 61 73 65 73 2e 3c 62 72 3e 0d 0a 49  atabases.<br>..I
0530: 6e 20 74 68 69 73 20 63 61 73 65 2c 20 69 6e 20  n this case, in 
0540: 6f 72 64 65 72 20 74 6f 20 61 76 6f 69 64 20 61  order to avoid a
0550: 6e 79 20 70 6f 73 73 69 62 6c 65 20 61 6d 62 69  ny possible ambi
0560: 67 75 69 74 79 2c 20 74 68 65 20 3c 62 3e 66 75  guity, the <b>fu
0570: 6c 6c 79 20 71 75 61 6c 69 66 69 65 64 20 74 61  lly qualified ta
0580: 62 6c 65 2d 6e 61 6d 65 3c 2f 62 3e 20 6d 75 73  ble-name</b> mus
0590: 74 20 69 6e 63 6c 75 64 65 20 61 20 3c 62 3e 64  t include a <b>d
05a0: 62 2d 70 72 65 66 69 78 3c 2f 62 3e 2c 20 61 73  b-prefix</b>, as
05b0: 20 65 2e 67 2e 20 3c 62 3e 3c 69 3e 61 2e 74 65   e.g. <b><i>a.te
05c0: 73 74 3c 2f 69 3e 3c 2f 62 3e 20 6f 72 20 3c 62  st</i></b> or <b
05d0: 3e 3c 69 3e 6d 61 69 6e 2e 74 65 73 74 3c 2f 69  ><i>main.test</i
05e0: 3e 3c 2f 62 3e 3c 62 72 3e 3c 62 72 3e 0d 0a 3c  ></b><br><br>..<
05f0: 75 6c 3e 0d 0a 3c 6c 69 3e 3c 62 3e 4e 6f 74 65  ul>..<li><b>Note
0600: 73 3c 2f 62 3e 3a 20 74 68 65 20 64 61 74 61 62  s</b>: the datab
0610: 61 73 65 20 69 6e 69 74 69 61 6c 6c 79 20 63 6f  ase initially co
0620: 6e 6e 65 63 74 65 64 20 77 68 69 6c 65 20 6f 70  nnected while op
0630: 65 6e 69 6e 67 20 74 68 65 20 63 75 72 72 65 6e  ening the curren
0640: 74 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 77 69 6c  t connection wil
0650: 6c 20 62 65 20 61 6c 77 61 79 73 20 69 64 65 6e  l be always iden
0660: 74 69 66 69 65 64 20 62 79 20 74 68 65 20 3c 62  tified by the <b
0670: 3e 4d 41 49 4e 3c 2f 62 3e 20 64 62 2d 70 72 65  >MAIN</b> db-pre
0680: 66 69 78 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 45  fix.</li>..<li>E
0690: 78 70 6c 69 63 69 74 6c 79 20 64 65 63 6c 61 72  xplicitly declar
06a0: 69 6e 67 20 74 68 65 20 3c 62 3e 4d 41 49 4e 3c  ing the <b>MAIN<
06b0: 2f 62 3e 20 64 62 2d 70 72 65 66 69 78 20 69 73  /b> db-prefix is
06c0: 20 6e 65 76 65 72 20 73 74 72 69 63 74 6c 79 20   never strictly 
06d0: 72 65 71 75 69 72 65 64 2c 20 62 65 63 61 75 73  required, becaus
06e0: 65 20 53 51 4c 69 74 65 20 77 69 6c 6c 20 73 74  e SQLite will st
06f0: 61 72 74 20 66 69 72 73 74 20 66 72 6f 6d 20 74  art first from t
0700: 68 65 20 61 73 73 75 6d 70 74 69 6f 6e 20 74 68  he assumption th
0710: 61 74 20 61 6e 79 20 74 61 62 6c 65 20 69 64 65  at any table ide
0720: 6e 74 69 66 69 65 64 20 62 79 20 61 6e 20 3c 62  ntified by an <b
0730: 3e 75 6e 71 75 61 6c 69 66 69 65 64 20 74 61 62  >unqualified tab
0740: 6c 65 2d 6e 61 6d 65 3c 2f 62 3e 20 77 69 6c 6c  le-name</b> will
0750: 20 62 65 20 6c 6f 63 61 74 65 64 20 69 6e 74 6f   be located into
0760: 20 74 68 65 20 3c 62 3e 4d 41 49 4e 3c 2f 62 3e   the <b>MAIN</b>
0770: 20 64 61 74 61 62 61 73 65 2e 3c 2f 6c 69 3e 0d   database.</li>.
0780: 0a 3c 2f 75 6c 3e 0d 0a 3c 76 65 72 62 61 74 69  .</ul>..<verbati
0790: 6d 3e 0d 0a 41 54 54 41 43 48 20 44 41 54 41 42  m>..ATTACH DATAB
07a0: 41 53 45 20 27 3a 6d 65 6d 6f 72 79 3a 27 20 41  ASE ':memory:' A
07b0: 53 20 61 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d  S a;..</verbatim
07c0: 3e 0d 0a 53 51 4c 69 74 65 20 73 75 70 70 6f 72  >..SQLite suppor
07d0: 74 73 20 61 20 76 65 72 79 20 69 6e 74 65 72 65  ts a very intere
07e0: 73 74 69 6e 67 20 63 61 70 61 62 69 6c 69 74 79  sting capability
07f0: 3b 20 79 6f 75 20 63 61 6e 20 41 54 54 41 43 48  ; you can ATTACH
0800: 20 6f 6e 65 20 6f 72 20 6d 6f 72 65 20 64 61 74   one or more dat
0810: 61 62 61 73 65 73 20 62 61 73 65 64 20 6f 6e 20  abases based on 
0820: 74 68 65 20 73 70 65 63 69 61 6c 20 3c 62 3e 3a  the special <b>:
0830: 6d 65 6d 6f 72 79 3a 3c 2f 62 3e 20 73 74 6f 72  memory:</b> stor
0840: 61 67 65 2c 20 65 61 63 68 20 6f 6e 65 20 69 64  age, each one id
0850: 65 6e 74 69 66 69 65 64 20 62 79 20 69 74 73 20  entified by its 
0860: 6f 77 6e 20 64 62 2d 70 72 65 66 69 78 2e 3c 62  own db-prefix.<b
0870: 72 3e 0d 0a 49 6e 20 74 68 69 73 20 63 61 73 65  r>..In this case
0880: 20 61 20 6e 65 77 20 69 6e 64 65 70 65 6e 64 65   a new independe
0890: 6e 74 20 64 61 74 61 62 61 73 65 20 77 69 6c 6c  nt database will
08a0: 20 62 65 20 69 6d 6d 65 64 69 61 74 65 6c 79 20   be immediately 
08b0: 63 72 65 61 74 65 64 20 69 6e 20 52 41 4d 20 61  created in RAM a
08c0: 6e 64 20 69 74 20 77 69 6c 6c 20 62 65 20 69 6e  nd it will be in
08d0: 74 72 69 6e 73 69 63 61 6c 6c 79 20 6f 66 20 74  trinsically of t
08e0: 72 61 6e 73 69 65 6e 74 20 6e 61 74 75 72 65 2c  ransient nature,
08f0: 20 62 65 63 61 75 73 65 20 69 74 20 77 69 6c 6c   because it will
0900: 20 62 65 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c   be automaticall
0910: 79 20 64 65 73 74 72 6f 79 65 64 20 77 68 65 6e  y destroyed when
0920: 20 74 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 20   the connection 
0930: 77 69 6c 6c 20 74 65 72 6d 69 6e 61 74 65 2c 20  will terminate, 
0940: 6f 72 20 77 68 65 6e 20 74 68 65 20 64 61 74 61  or when the data
0950: 62 61 73 65 20 77 69 6c 6c 20 62 65 20 65 78 70  base will be exp
0960: 6c 69 63 69 74 6c 79 20 44 45 54 41 43 48 45 44  licitly DETACHED
0970: 2e 3c 62 72 3e 3c 62 72 3e 0d 0a 3c 74 61 62 6c  .<br><br>..<tabl
0980: 65 20 62 67 63 6f 6c 6f 72 3d 22 23 66 66 66 66  e bgcolor="#ffff
0990: 64 30 22 20 63 65 6c 6c 73 70 61 63 69 6e 67 3d  d0" cellspacing=
09a0: 22 34 22 20 63 65 6c 6c 70 61 64 64 69 6e 67 3d  "4" cellpadding=
09b0: 22 38 22 3e 0d 0a 3c 74 64 3e 0d 0a 3c 62 3e 4e  "8">..<td>..<b>N
09c0: 6f 74 65 3c 2f 62 3e 3a 20 62 65 69 6e 67 20 66  ote</b>: being f
09d0: 75 6c 6c 79 20 62 61 73 65 64 20 6f 6e 20 52 41  ully based on RA
09e0: 4d 2c 20 61 6c 6c 20 3c 62 3e 3a 6d 65 6d 6f 72  M, all <b>:memor
09f0: 79 3a 3c 2f 62 3e 20 64 61 74 61 62 61 73 65 73  y:</b> databases
0a00: 20 61 72 65 20 65 78 70 65 63 74 65 64 20 74 6f   are expected to
0a10: 20 62 65 20 66 61 73 74 20 61 73 20 68 65 6c 6c   be fast as hell
0a20: 2c 20 64 75 65 20 74 6f 20 71 75 69 63 6b 65 72  , due to quicker
0a30: 20 49 2f 4f 20 74 69 6d 69 6e 67 73 2e 3c 62 72   I/O timings.<br
0a40: 3e 3c 62 72 3e 0d 0a 48 6f 77 65 76 65 72 20 69  ><br>..However i
0a50: 74 20 73 68 6f 75 6c 64 20 61 6c 73 6f 20 62 65  t should also be
0a60: 20 63 61 72 65 66 75 6c 6c 79 20 63 6f 6e 73 69   carefully consi
0a70: 64 65 72 65 64 20 74 68 61 74 20 52 41 4d 20 69  dered that RAM i
0a80: 73 20 61 20 6c 69 6d 69 74 65 64 20 72 65 73 6f  s a limited reso
0a90: 75 72 63 65 20 74 6f 20 62 65 20 76 65 72 79 20  urce to be very 
0aa0: 77 69 73 65 6c 79 20 63 6f 6e 73 75 6d 65 64 2e  wisely consumed.
0ab0: 0d 0a 3c 2f 74 64 3e 0d 0a 3c 2f 74 61 62 6c 65  ..</td>..</table
0ac0: 3e 0d 0a 3c 68 33 3e 53 70 61 74 69 61 4c 69 74  >..<h3>SpatiaLit
0ad0: 65 20 61 6e 64 20 41 54 54 41 43 48 45 44 20 47  e and ATTACHED G
0ae0: 65 6f 6d 65 74 72 69 65 73 3c 2f 68 33 3e 0d 0a  eometries</h3>..
0af0: 41 6c 6c 20 70 72 65 76 69 6f 75 73 20 76 65 72  All previous ver
0b00: 73 69 6f 6e 73 20 6f 66 20 53 70 61 74 69 61 4c  sions of SpatiaL
0b10: 69 74 65 20 61 6c 77 61 79 73 20 63 6f 6e 73 69  ite always consi
0b20: 64 65 72 65 64 20 61 6c 6c 20 47 65 6f 6d 65 74  dered all Geomet
0b30: 72 79 20 43 6f 6c 75 6d 6e 73 20 73 74 6f 72 65  ry Columns store
0b40: 64 20 69 6e 74 6f 20 3c 62 3e 41 54 54 41 43 48  d into <b>ATTACH
0b50: 45 44 20 44 41 54 41 42 41 53 45 53 3c 2f 62 3e  ED DATABASES</b>
0b60: 20 61 73 20 69 6e 74 72 69 6e 73 69 63 61 6c 6c   as intrinsicall
0b70: 79 20 73 75 62 6a 65 63 74 20 74 6f 20 3c 62 3e  y subject to <b>
0b80: 3c 69 3e 72 65 61 64 2d 6f 6e 6c 79 3c 2f 69 3e  <i>read-only</i>
0b90: 3c 2f 62 3e 20 6c 69 6d 69 74 61 74 69 6f 6e 73  </b> limitations
0ba0: 2e 3c 62 72 3e 0d 0a 54 68 65 20 72 65 61 73 6f  .<br>..The reaso
0bb0: 6e 20 65 78 70 6c 61 69 6e 69 6e 67 20 66 6f 72  n explaining for
0bc0: 20 61 6c 6c 20 74 68 69 73 20 69 73 20 74 6f 20   all this is to 
0bd0: 62 65 20 66 6f 75 6e 64 20 69 6e 20 74 68 65 20  be found in the 
0be0: 6d 61 6e 79 20 3c 62 3e 54 72 69 67 67 65 72 73  many <b>Triggers
0bf0: 3c 2f 62 3e 20 72 65 71 75 69 72 65 64 20 62 79  </b> required by
0c00: 20 53 70 61 74 69 61 4c 69 74 65 20 66 6f 72 20   SpatiaLite for 
0c10: 63 68 65 63 6b 69 6e 67 20 47 65 6f 6d 65 74 72  checking Geometr
0c20: 79 20 63 6f 6e 73 74 72 61 69 6e 74 73 20 28 53  y constraints (S
0c30: 52 49 44 2c 20 47 65 6f 6d 65 74 72 79 20 54 79  RID, Geometry Ty
0c40: 70 65 20 61 6e 64 20 44 69 6d 65 6e 73 69 6f 6e  pe and Dimension
0c50: 29 20 61 6e 64 20 66 6f 72 20 63 6f 72 72 65 63  ) and for correc
0c60: 74 6c 79 20 75 70 64 61 74 69 6e 67 20 74 68 65  tly updating the
0c70: 20 3c 62 3e 53 70 61 74 69 61 6c 20 49 6e 64 65   <b>Spatial Inde
0c80: 78 3c 2f 62 3e 2e 3c 62 72 3e 0d 0a 41 6c 6c 20  x</b>.<br>..All 
0c90: 74 68 65 73 65 20 54 72 69 67 67 65 72 73 20 63  these Triggers c
0ca0: 61 6e 6e 6f 74 20 77 6f 72 6b 20 61 73 20 65 78  annot work as ex
0cb0: 70 65 63 74 65 64 20 6f 6e 20 62 65 68 61 6c 66  pected on behalf
0cc0: 20 6f 66 20 61 6e 79 20 3c 62 3e 41 54 54 41 43   of any <b>ATTAC
0cd0: 48 45 44 20 44 41 54 41 42 41 53 45 3c 2f 62 3e  HED DATABASE</b>
0ce0: 2c 20 74 68 75 73 20 63 61 75 73 69 6e 67 20 74  , thus causing t
0cf0: 68 65 20 61 62 6f 76 65 20 73 74 61 74 65 64 20  he above stated 
0d00: 72 65 61 64 2d 6f 6e 6c 79 20 6c 69 6d 69 74 61  read-only limita
0d10: 74 69 6f 6e 2e 3c 62 72 3e 0d 0a 42 75 74 20 73  tion.<br>..But s
0d20: 74 61 72 74 69 6e 67 20 73 69 6e 63 65 20 76 65  tarting since ve
0d30: 72 73 69 6f 6e 20 3c 62 3e 35 2e 30 2e 30 3c 2f  rsion <b>5.0.0</
0d40: 62 3e 20 53 70 61 74 69 61 4c 69 74 65 20 69 73  b> SpatiaLite is
0d50: 20 6e 6f 77 20 66 75 6c 6c 79 20 61 62 6c 65 20   now fully able 
0d60: 74 6f 20 73 61 66 65 6c 79 20 73 75 70 70 6f 72  to safely suppor
0d70: 74 20 72 65 61 6c 20 47 65 6f 6d 65 74 72 69 65  t real Geometrie
0d80: 73 20 65 76 65 6e 20 77 68 65 6e 20 73 74 6f 72  s even when stor
0d90: 65 64 20 69 6e 20 61 6e 79 20 3c 62 3e 3a 6d 65  ed in any <b>:me
0da0: 6d 6f 72 79 3a 3c 2f 62 3e 20 62 61 73 65 64 20  mory:</b> based 
0db0: 3c 62 3e 41 54 54 41 43 48 45 44 20 44 41 54 41  <b>ATTACHED DATA
0dc0: 42 41 53 45 3c 2f 62 3e 2c 20 74 68 61 6e 6b 73  BASE</b>, thanks
0dd0: 20 74 6f 20 61 20 62 72 61 6e 64 20 6e 65 77 20   to a brand new 
0de0: 73 65 74 20 6f 66 20 3c 62 3e 54 72 69 67 67 65  set of <b>Trigge
0df0: 72 73 3c 2f 62 3e 20 70 75 72 70 6f 73 65 6c 79  rs</b> purposely
0e00: 20 69 6e 74 65 6e 64 65 64 20 66 6f 72 20 74 65   intended for te
0e10: 6d 70 6f 72 61 72 79 20 73 74 6f 72 61 67 65 2e  mporary storage.
0e20: 3c 62 72 3e 3c 62 72 3e 0d 0a 3c 68 72 3e 0d 0a  <br><br>..<hr>..
0e30: 3c 68 32 3e 41 20 71 75 69 63 6b 20 70 72 61 63  <h2>A quick prac
0e40: 74 69 63 61 6c 20 65 78 61 6d 70 6c 65 3c 2f 68  tical example</h
0e50: 32 3e 0d 0a 3c 76 65 72 62 61 74 69 6d 3e 0d 0a  2>..<verbatim>..
0e60: 41 54 54 41 43 48 20 44 41 54 41 42 41 53 45 20  ATTACH DATABASE 
0e70: 27 3a 6d 65 6d 6f 72 79 3a 27 20 41 53 20 6d 65  ':memory:' AS me
0e80: 6d 5f 64 62 3b 0d 0a 0d 0a 43 52 45 41 54 45 20  m_db;....CREATE 
0e90: 54 41 42 4c 45 20 6d 65 6d 5f 64 62 2e 74 65 73  TABLE mem_db.tes
0ea0: 74 20 28 0d 0a 20 20 20 20 69 64 20 49 4e 54 45  t (..    id INTE
0eb0: 47 45 52 20 50 52 49 4d 41 52 59 20 4b 45 59 2c  GER PRIMARY KEY,
0ec0: 0d 0a 20 20 20 20 6e 61 6d 65 20 54 45 58 54 20  ..    name TEXT 
0ed0: 4e 4f 54 20 4e 55 4c 4c 29 3b 0d 0a 0d 0a 53 45  NOT NULL);....SE
0ee0: 4c 45 43 54 20 41 64 64 54 65 6d 70 6f 72 61 72  LECT AddTemporar
0ef0: 79 47 65 6f 6d 65 74 72 79 43 6f 6c 75 6d 6e 20  yGeometryColumn 
0f00: 28 20 27 6d 65 6d 5f 64 62 27 2c 20 27 74 65 73  ( 'mem_db', 'tes
0f10: 74 27 2c 20 27 67 65 6f 6d 27 2c 20 34 33 32 36  t', 'geom', 4326
0f20: 2c 20 27 50 4f 49 4e 54 27 2c 20 27 58 59 27 20  , 'POINT', 'XY' 
0f30: 29 3b 0d 0a 0d 0a 53 45 4c 45 43 54 20 43 72 65  );....SELECT Cre
0f40: 61 74 65 54 65 6d 70 6f 72 61 72 79 53 70 61 74  ateTemporarySpat
0f50: 69 61 6c 49 6e 64 65 78 20 28 20 27 6d 65 6d 5f  ialIndex ( 'mem_
0f60: 64 62 27 2c 20 27 74 65 73 74 27 2c 20 27 67 65  db', 'test', 'ge
0f70: 6f 6d 27 20 29 3b 0d 0a 0d 0a 49 4e 53 45 52 54  om' );....INSERT
0f80: 20 49 4e 54 4f 20 6d 65 6d 5f 64 62 2e 74 65 73   INTO mem_db.tes
0f90: 74 20 56 41 4c 55 45 53 20 28 20 4e 55 4c 4c 2c  t VALUES ( NULL,
0fa0: 20 27 6f 6e 65 27 2c 20 4d 61 6b 65 50 6f 69 6e   'one', MakePoin
0fb0: 74 28 20 31 2e 31 2c 20 31 2e 35 2c 20 34 33 32  t( 1.1, 1.5, 432
0fc0: 36 20 29 29 3b 0d 0a 49 4e 53 45 52 54 20 49 4e  6 ));..INSERT IN
0fd0: 54 4f 20 6d 65 6d 5f 64 62 2e 74 65 73 74 20 56  TO mem_db.test V
0fe0: 41 4c 55 45 53 20 28 20 4e 55 4c 4c 2c 20 27 74  ALUES ( NULL, 't
0ff0: 77 6f 27 2c 20 4d 61 6b 65 50 6f 69 6e 74 28 20  wo', MakePoint( 
1000: 31 2e 33 2c 20 32 2e 37 2c 20 34 33 32 36 20 29  1.3, 2.7, 4326 )
1010: 29 3b 0d 0a 2d 2d 20 61 73 20 6d 61 6e 79 20 6f  );..-- as many o
1020: 74 68 65 72 20 49 4e 53 45 52 54 73 20 61 73 20  ther INSERTs as 
1030: 72 65 71 75 69 72 65 64 20 0d 0a 49 4e 53 45 52  required ..INSER
1040: 54 20 49 4e 54 4f 20 6d 65 6d 5f 64 62 2e 74 65  T INTO mem_db.te
1050: 73 74 20 56 41 4c 55 45 53 20 28 20 4e 55 4c 4c  st VALUES ( NULL
1060: 2c 20 27 74 68 6f 75 73 61 6e 64 27 2c 20 4d 61  , 'thousand', Ma
1070: 6b 65 50 6f 69 6e 74 28 20 31 37 39 2e 39 2c 20  kePoint( 179.9, 
1080: 38 39 2e 37 2c 20 34 33 32 36 20 29 29 3b 0d 0a  89.7, 4326 ));..
1090: 0d 0a 53 45 4c 45 43 54 20 69 64 2c 20 6e 61 6d  ..SELECT id, nam
10a0: 65 2c 20 41 73 54 65 78 74 28 67 65 6f 6d 29 20  e, AsText(geom) 
10b0: 46 52 4f 4d 20 6d 65 6d 5f 64 62 2e 74 65 73 74  FROM mem_db.test
10c0: 0d 0a 57 48 45 52 45 20 69 64 20 49 4e 20 28 0d  ..WHERE id IN (.
10d0: 0a 20 20 20 20 53 45 4c 45 43 54 20 72 6f 77 69  .    SELECT rowi
10e0: 64 20 46 52 4f 4d 20 53 70 61 74 69 61 6c 49 6e  d FROM SpatialIn
10f0: 64 65 78 20 57 48 45 52 45 20 66 5f 74 61 62 6c  dex WHERE f_tabl
1100: 65 5f 6e 61 6d 65 20 3d 20 27 44 42 3d 6d 65 6d  e_name = 'DB=mem
1110: 5f 64 62 2e 74 65 73 74 27 20 41 4e 44 20 73 65  _db.test' AND se
1120: 61 72 63 68 5f 66 72 61 6d 65 20 3d 20 42 75 69  arch_frame = Bui
1130: 6c 64 4d 62 72 20 28 20 31 2e 32 2c 20 32 2e 35  ldMbr ( 1.2, 2.5
1140: 2c 20 31 2e 37 2c 20 32 2e 39 2c 20 34 33 32 36  , 1.7, 2.9, 4326
1150: 20 29 0d 0a 29 3b 0d 0a 2d 2d 2d 2d 2d 2d 2d 2d   )..);..--------
1160: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
1170: 2d 2d 2d 2d 0d 0a 32 20 20 20 20 74 77 6f 20 20  ----..2    two  
1180: 20 20 50 4f 49 4e 54 28 31 2e 33 20 32 2e 37 29    POINT(1.3 2.7)
1190: 0d 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 3c  ..</verbatim>..<
11a0: 75 6c 3e 0d 0a 3c 6c 69 3e 74 68 65 20 53 51 4c  ul>..<li>the SQL
11b0: 20 66 75 6e 63 74 69 6f 6e 20 3c 62 3e 41 64 64   function <b>Add
11c0: 54 65 6d 70 6f 72 61 72 79 47 65 6f 6d 65 74 72  TemporaryGeometr
11d0: 79 43 6f 6c 75 6d 6e 28 29 3c 2f 62 3e 20 70 6c  yColumn()</b> pl
11e0: 61 79 73 20 74 68 65 20 73 61 6d 65 20 69 64 65  ays the same ide
11f0: 6e 74 69 63 61 6c 20 72 6f 6c 65 20 61 73 20 74  ntical role as t
1200: 68 65 20 6d 6f 73 74 20 75 73 75 61 6c 20 3c 62  he most usual <b
1210: 3e 41 64 64 47 65 6f 6d 65 74 72 79 43 6f 6c 75  >AddGeometryColu
1220: 6d 6e 28 29 3c 2f 62 3e 2e 0d 0a 3c 75 6c 3e 0d  mn()</b>...<ul>.
1230: 0a 3c 6c 69 3e 74 68 65 20 6d 61 69 6e 20 64 69  .<li>the main di
1240: 66 66 65 72 65 6e 63 65 20 69 73 20 69 6e 20 74  fference is in t
1250: 68 61 74 20 69 74 20 72 65 71 75 69 72 65 73 20  hat it requires 
1260: 74 6f 20 73 70 65 63 69 66 79 20 73 6f 6d 65 20  to specify some 
1270: 3c 62 3e 64 62 2d 70 72 65 66 69 78 3c 2f 62 3e  <b>db-prefix</b>
1280: 20 61 73 20 69 74 73 20 66 69 72 73 74 20 61 72   as its first ar
1290: 67 75 6d 65 6e 74 2e 3c 2f 6c 69 3e 0d 0a 3c 6c  gument.</li>..<l
12a0: 69 3e 69 74 20 77 69 6c 6c 20 73 75 63 63 65 73  i>it will succes
12b0: 73 66 75 6c 6c 79 20 77 6f 72 6b 20 6f 6e 6c 79  sfully work only
12c0: 20 69 66 20 3c 62 3e 64 62 2d 70 72 65 66 69 78   if <b>db-prefix
12d0: 3c 2f 62 3e 20 69 64 65 6e 74 69 66 69 65 73 20  </b> identifies 
12e0: 73 6f 6d 65 20 41 54 54 41 43 48 45 44 20 44 41  some ATTACHED DA
12f0: 54 41 42 41 53 45 20 6f 66 20 74 68 65 20 3c 62  TABASE of the <b
1300: 3e 3a 6d 65 6d 6f 72 79 3a 3c 2f 62 3e 20 74 79  >:memory:</b> ty
1310: 70 65 3b 20 69 74 20 77 69 6c 6c 20 61 6c 77 61  pe; it will alwa
1320: 79 73 20 66 61 69 6c 20 69 6e 20 61 6e 79 20 6f  ys fail in any o
1330: 74 68 65 72 20 63 61 73 65 2e 3c 2f 6c 69 3e 0d  ther case.</li>.
1340: 0a 3c 6c 69 3e 74 68 69 73 20 66 75 6e 63 74 69  .<li>this functi
1350: 6f 6e 20 77 69 6c 6c 20 74 61 6b 65 20 63 61 72  on will take car
1360: 65 20 74 6f 20 69 6e 73 74 61 6c 6c 20 74 68 65  e to install the
1370: 20 73 70 65 63 69 61 6c 20 3c 62 3e 54 72 69 67   special <b>Trig
1380: 67 65 72 73 3c 2f 62 3e 20 73 61 66 65 6c 79 20  gers</b> safely 
1390: 73 75 70 70 6f 72 74 69 6e 67 20 54 65 6d 70 6f  supporting Tempo
13a0: 72 61 72 79 20 47 65 6f 6d 65 74 72 69 65 73 2e  rary Geometries.
13b0: 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e 3c 2f 6c 69  </li>..</ul></li
13c0: 3e 0d 0a 3c 6c 69 3e 74 68 65 20 53 51 4c 20 66  >..<li>the SQL f
13d0: 75 6e 63 74 69 6f 6e 20 3c 62 3e 43 72 65 61 74  unction <b>Creat
13e0: 65 54 65 6d 70 6f 72 61 72 79 53 70 61 74 69 61  eTemporarySpatia
13f0: 6c 49 6e 64 65 78 28 29 3c 2f 62 3e 20 69 73 20  lIndex()</b> is 
1400: 74 68 65 20 73 74 72 69 63 74 20 65 71 75 69 76  the strict equiv
1410: 61 6c 65 6e 74 20 6f 66 20 74 68 65 20 6d 6f 73  alent of the mos
1420: 74 20 75 73 75 61 6c 20 3c 62 3e 43 72 65 61 74  t usual <b>Creat
1430: 65 53 70 61 74 69 61 6c 49 6e 64 65 78 28 29 3c  eSpatialIndex()<
1440: 2f 62 3e 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 74  /b>..<ul>..<li>t
1450: 68 65 20 6d 61 69 6e 20 64 69 66 66 65 72 65 6e  he main differen
1460: 63 65 20 69 73 20 69 6e 20 74 68 61 74 20 69 74  ce is in that it
1470: 20 72 65 71 75 69 72 65 73 20 74 6f 20 73 70 65   requires to spe
1480: 63 69 66 79 20 73 6f 6d 65 20 3c 62 3e 64 62 2d  cify some <b>db-
1490: 70 72 65 66 69 78 3c 2f 62 3e 20 61 73 20 69 74  prefix</b> as it
14a0: 73 20 66 69 72 73 74 20 61 72 67 75 6d 65 6e 74  s first argument
14b0: 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 69 74 20 77  .</li>..<li>it w
14c0: 69 6c 6c 20 73 75 63 63 65 73 73 66 75 6c 6c 79  ill successfully
14d0: 20 77 6f 72 6b 20 6f 6e 6c 79 20 69 66 20 3c 62   work only if <b
14e0: 3e 64 62 2d 70 72 65 66 69 78 3c 2f 62 3e 20 69  >db-prefix</b> i
14f0: 64 65 6e 74 69 66 69 65 73 20 73 6f 6d 65 20 41  dentifies some A
1500: 54 54 41 43 48 45 44 20 44 41 54 41 42 41 53 45  TTACHED DATABASE
1510: 20 6f 66 20 74 68 65 20 3c 62 3e 3a 6d 65 6d 6f   of the <b>:memo
1520: 72 79 3a 3c 2f 62 3e 20 74 79 70 65 3b 20 69 74  ry:</b> type; it
1530: 20 77 69 6c 6c 20 61 6c 77 61 79 73 20 66 61 69   will always fai
1540: 6c 20 69 6e 20 61 6e 79 20 6f 74 68 65 72 20 63  l in any other c
1550: 61 73 65 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 74  ase.</li>..<li>t
1560: 68 69 73 20 66 75 6e 63 74 69 6f 6e 20 77 69 6c  his function wil
1570: 6c 20 74 61 6b 65 20 63 61 72 65 20 74 6f 20 69  l take care to i
1580: 6e 73 74 61 6c 6c 20 74 68 65 20 73 70 65 63 69  nstall the speci
1590: 61 6c 20 3c 62 3e 54 72 69 67 67 65 72 73 3c 2f  al <b>Triggers</
15a0: 62 3e 20 72 65 71 75 69 72 65 64 20 69 6e 20 6f  b> required in o
15b0: 72 64 65 72 20 74 6f 20 73 61 66 65 6c 79 20 73  rder to safely s
15c0: 79 6e 63 68 72 6f 6e 69 7a 65 20 61 20 3c 62 3e  ynchronize a <b>
15d0: 53 70 61 74 69 61 6c 20 49 6e 64 65 78 3c 2f 62  Spatial Index</b
15e0: 3e 20 73 75 70 70 6f 72 74 69 6e 67 20 73 6f 6d  > supporting som
15f0: 65 20 54 65 6d 70 6f 72 61 72 79 20 47 65 6f 6d  e Temporary Geom
1600: 65 74 72 79 20 43 6f 6c 75 6d 6e 2e 3c 2f 6c 69  etry Column.</li
1610: 3e 0d 0a 3c 2f 75 6c 3e 3c 2f 6c 69 3e 0d 0a 3c  >..</ul></li>..<
1620: 6c 69 3e 51 75 65 72 79 69 6e 67 20 74 68 65 20  li>Querying the 
1630: 3c 62 3e 53 70 61 74 69 61 6c 20 49 6e 64 65 78  <b>Spatial Index
1640: 3c 2f 62 3e 20 73 75 70 70 6f 72 74 69 6e 67 20  </b> supporting 
1650: 61 20 54 65 6d 70 6f 72 61 72 79 20 47 65 6f 6d  a Temporary Geom
1660: 65 74 72 79 20 43 6f 6c 75 6d 6e 20 64 6f 65 73  etry Column does
1670: 20 6e 6f 74 20 72 65 71 75 69 72 65 73 20 61 6e   not requires an
1680: 79 20 73 70 65 63 69 61 6c 20 61 74 74 65 6e 74  y special attent
1690: 69 6f 6e 3b 20 69 74 20 65 78 61 63 74 6c 79 20  ion; it exactly 
16a0: 77 6f 72 6b 73 20 69 6e 20 74 68 65 20 73 61 6d  works in the sam
16b0: 65 20 77 61 79 20 6f 66 20 61 6e 79 20 6f 74 68  e way of any oth
16c0: 65 72 20 53 70 61 74 69 61 6c 20 49 6e 64 65 78  er Spatial Index
16d0: 20 6c 6f 63 61 74 65 64 20 69 6e 74 6f 20 73 6f   located into so
16e0: 6d 65 20 41 54 54 41 43 48 45 44 20 44 41 54 41  me ATTACHED DATA
16f0: 42 41 53 45 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c  BASE.</li>..</ul
1700: 3e 0d 0a 3c 68 33 3e 42 65 68 69 6e 64 20 74 68  >..<h3>Behind th
1710: 65 20 73 63 65 6e 65 73 3c 2f 68 33 3e 0d 0a 3c  e scenes</h3>..<
1720: 6f 6c 3e 0d 0a 3c 6c 69 3e 53 70 61 74 69 61 4c  ol>..<li>SpatiaL
1730: 69 74 65 20 77 69 6c 6c 20 73 69 6c 65 6e 74 6c  ite will silentl
1740: 79 20 63 72 65 61 74 65 20 62 6f 74 68 20 3c 62  y create both <b
1750: 3e 67 65 6f 6d 65 74 72 79 5f 63 6f 6c 75 6d 6e  >geometry_column
1760: 73 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e 73 70 61  s</b> and <b>spa
1770: 74 69 61 6c 5f 72 65 66 5f 73 79 73 3c 2f 62 3e  tial_ref_sys</b>
1780: 20 6d 65 74 61 74 61 62 6c 65 73 20 69 6e 74 6f   metatables into
1790: 20 74 68 65 20 41 54 54 41 43 48 45 44 20 44 41   the ATTACHED DA
17a0: 54 41 42 41 53 45 20 77 68 65 6e 20 72 65 71 75  TABASE when requ
17b0: 69 72 65 64 2e 3c 62 72 3e 0d 0a 3c 62 3e 73 70  ired.<br>..<b>sp
17c0: 61 74 69 61 6c 5f 72 65 66 5f 73 79 73 3c 2f 62  atial_ref_sys</b
17d0: 3e 20 77 69 6c 6c 20 62 65 20 61 75 74 6f 6d 61  > will be automa
17e0: 74 69 63 61 6c 6c 79 20 62 65 20 70 6f 70 75 6c  tically be popul
17f0: 61 74 65 64 20 62 79 20 63 6f 70 79 69 6e 67 20  ated by copying 
1800: 74 68 65 20 77 68 6f 6c 65 20 63 6f 6e 74 65 6e  the whole conten
1810: 74 20 6f 66 20 74 68 65 20 73 61 6d 65 20 74 61  t of the same ta
1820: 62 6c 65 20 66 72 6f 6d 20 3c 62 3e 4d 41 49 4e  ble from <b>MAIN
1830: 3c 2f 62 3e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 74  </b></li>..<li>t
1840: 68 65 20 53 51 4c 20 66 75 6e 63 74 69 6f 6e 20  he SQL function 
1850: 3c 62 3e 54 65 6d 70 6f 72 61 72 79 52 54 72 65  <b>TemporaryRTre
1860: 65 41 6c 69 67 6e 28 29 3c 2f 62 3e 20 69 73 20  eAlign()</b> is 
1870: 6f 6e 6c 79 20 69 6e 74 65 6e 64 65 64 20 66 6f  only intended fo
1880: 72 20 73 75 70 70 6f 72 74 69 6e 67 20 74 68 65  r supporting the
1890: 20 3c 62 3e 54 72 69 67 67 65 72 73 3c 2f 62 3e   <b>Triggers</b>
18a0: 20 69 6e 73 74 61 6c 6c 65 64 20 62 79 20 53 70   installed by Sp
18b0: 61 74 69 61 4c 69 74 65 2c 20 61 6e 64 20 69 73  atiaLite, and is
18c0: 20 6e 65 76 65 72 20 69 6e 74 65 6e 64 65 64 20   never intended 
18d0: 74 6f 20 62 65 20 65 78 70 6c 69 63 69 74 6c 79  to be explicitly
18e0: 20 63 61 6c 6c 65 64 20 62 79 20 75 73 65 72 73   called by users
18f0: 2e 3c 2f 6c 69 3e 0d 0a 3c 2f 6f 6c 3e 0d 0a 3c  .</li>..</ol>..<
1900: 74 61 62 6c 65 20 62 67 63 6f 6c 6f 72 3d 22 23  table bgcolor="#
1910: 64 30 66 66 64 30 22 20 63 65 6c 6c 73 70 61 63  d0ffd0" cellspac
1920: 69 6e 67 3d 22 34 22 20 63 65 6c 6c 70 61 64 64  ing="4" cellpadd
1930: 69 6e 67 3d 22 38 22 3e 0d 0a 3c 74 64 3e 0d 0a  ing="8">..<td>..
1940: 3c 68 33 3e 46 69 6e 61 6c 20 68 69 6e 74 73 3c  <h3>Final hints<
1950: 2f 68 33 3e 0d 0a 41 6e 79 20 53 51 4c 69 74 65  /h3>..Any SQLite
1960: 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 61 6c 77 61   connection alwa
1970: 79 73 20 73 75 70 70 6f 72 74 73 20 69 74 73 20  ys supports its 
1980: 6f 77 6e 20 3c 62 3e 54 45 4d 50 4f 52 41 52 59  own <b>TEMPORARY
1990: 20 44 41 54 41 42 41 53 45 3c 2f 62 3e 20 69 64   DATABASE</b> id
19a0: 65 6e 74 69 66 69 65 64 20 62 79 20 74 68 65 20  entified by the 
19b0: 3c 62 3e 74 65 6d 70 3c 2f 62 3e 20 64 62 2d 70  <b>temp</b> db-p
19c0: 72 65 66 69 78 2e 3c 62 72 3e 3c 62 72 3e 0d 0a  refix.<br><br>..
19d0: 54 65 6d 70 6f 72 61 72 79 20 47 65 6f 6d 65 74  Temporary Geomet
19e0: 72 69 65 73 20 77 69 6c 6c 20 6e 69 63 65 6c 79  ries will nicely
19f0: 20 77 6f 72 6b 20 6f 6e 20 3c 62 3e 74 65 6d 70   work on <b>temp
1a00: 3c 2f 62 3e 2c 20 62 75 74 20 79 6f 75 20 61 72  </b>, but you ar
1a10: 65 20 73 74 72 6f 6e 67 6c 79 20 64 69 73 63 6f  e strongly disco
1a20: 75 72 61 67 65 64 20 66 72 6f 6d 20 64 6f 69 6e  uraged from doin
1a30: 67 20 73 75 63 68 20 61 20 74 68 69 6e 67 2c 20  g such a thing, 
1a40: 61 74 20 6c 65 61 73 74 20 69 66 20 79 6f 75 20  at least if you 
1a50: 61 72 65 20 70 6c 61 6e 6e 69 6e 67 20 74 6f 20  are planning to 
1a60: 75 73 65 20 62 65 66 6f 72 65 20 6f 72 20 61 66  use before or af
1a70: 74 65 72 20 74 68 65 20 3c 62 3e 53 70 61 74 69  ter the <b>Spati
1a80: 61 4c 69 74 65 20 47 55 49 20 74 6f 6f 6c 3c 2f  aLite GUI tool</
1a90: 62 3e 2e 3c 62 72 3e 0d 0a 54 68 65 20 47 55 49  b>.<br>..The GUI
1aa0: 20 74 6f 6f 6c 20 77 69 6c 6c 20 66 61 69 6c 20   tool will fail 
1ab0: 74 6f 20 63 6f 72 72 65 63 74 6c 79 20 69 64 65  to correctly ide
1ac0: 6e 74 69 66 79 20 54 65 6d 70 6f 72 61 72 79 20  ntify Temporary 
1ad0: 47 65 6f 6d 65 74 72 69 65 73 20 73 74 6f 72 65  Geometries store
1ae0: 64 20 69 6e 74 6f 20 3c 62 3e 74 65 6d 70 3c 2f  d into <b>temp</
1af0: 62 3e 2c 20 61 6e 64 20 77 69 6c 6c 20 63 6f 6e  b>, and will con
1b00: 73 65 71 75 65 6e 74 6c 79 20 73 68 6f 77 20 61  sequently show a
1b10: 20 6d 65 73 73 79 20 44 42 20 6c 61 79 6f 75 74   messy DB layout
1b20: 2e 0d 0a 41 6c 77 61 79 73 20 75 73 65 20 61 20  ...Always use a 
1b30: 70 75 72 70 6f 73 65 6c 79 20 63 72 65 61 74 65  purposely create
1b40: 64 20 41 54 54 41 43 48 45 44 20 44 41 54 41 42  d ATTACHED DATAB
1b50: 41 53 45 20 62 61 73 65 64 20 6f 6e 20 3c 62 3e  ASE based on <b>
1b60: 3a 6d 65 6d 6f 72 79 3a 3c 2f 62 3e 20 69 73 20  :memory:</b> is 
1b70: 74 68 65 20 73 75 67 67 65 73 74 65 64 20 62 65  the suggested be
1b80: 73 74 20 70 72 61 63 74 69 63 65 20 66 6f 72 20  st practice for 
1b90: 74 61 6b 69 6e 67 20 66 75 6c 6c 20 70 72 6f 66  taking full prof
1ba0: 69 74 20 66 72 6f 6d 20 54 65 6d 70 6f 72 61 72  it from Temporar
1bb0: 79 20 47 65 6f 6d 65 74 72 69 65 73 2e 0d 0a 3c  y Geometries...<
1bc0: 2f 74 64 3e 0d 0a 3c 2f 74 61 62 6c 65 3e 0d 0a  /td>..</table>..
1bd0: 3c 62 72 3e 3c 68 72 3e 3c 62 72 3e 0d 0a 42 61  <br><hr><br>..Ba
1be0: 63 6b 20 74 6f 20 3c 61 20 68 72 65 66 3d 22 68  ck to <a href="h
1bf0: 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61 2d  ttps://www.gaia-
1c00: 67 69 73 2e 69 74 2f 66 6f 73 73 69 6c 2f 6c 69  gis.it/fossil/li
1c10: 62 73 70 61 74 69 61 6c 69 74 65 2f 77 69 6b 69  bspatialite/wiki
1c20: 3f 6e 61 6d 65 3d 35 2e 30 2e 30 2d 64 6f 63 22  ?name=5.0.0-doc"
1c30: 3e 35 2e 30 2e 30 2d 64 6f 63 20 6d 61 69 6e 20  >5.0.0-doc main 
1c40: 70 61 67 65 3c 2f 61 3e 0a 5a 20 65 37 34 38 63  page</a>.Z e748c
1c50: 31 65 64 31 31 35 36 33 62 66 66 37 61 34 39 38  1ed11563bff7a498
1c60: 33 37 62 39 30 63 62 32 64 39 39 0a              37b90cb2d99.