Documentation Source Text

Check-in [000660158c]
Login

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

Overview
Comment:Clarifications on INDEXED BY documentation. Syntax diagrams which are default visible are always requirements even if they occur multiple times, but syntax diagrams that are default hidden now have the "data-noreq" attribute which prevents them from being marked as requirements.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 000660158c03e567fccd7bc9138413e29f6c104b
User & Date: drh 2015-03-04 23:15:35
Context
2015-03-05
00:17
Only count duplicate requirements once when scoring, but show every usage in the matrix reports. check-in: 61f2878145 user: drh tags: trunk
2015-03-04
23:15
Clarifications on INDEXED BY documentation. Syntax diagrams which are default visible are always requirements even if they occur multiple times, but syntax diagrams that are default hidden now have the "data-noreq" attribute which prevents them from being marked as requirements. check-in: 000660158c user: drh tags: trunk
20:56
Clarification of the "INSERT OR" and "REPLACE" forms of the INSERT statement. check-in: 58895ad201 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to matrix.tcl.

321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
set total(any) 0
set total(all) 0

foreach srcfile $srclist {
  if {$rowcnt%20==0} {puts $out $column_titles}
  incr rowcnt
  db eval {
    CREATE TEMP TABLE IF NOT EXISTS srcreq(reqno TEXT PRIMARY KEY);
    DELETE FROM srcreq;
    INSERT INTO srcreq SELECT reqno FROM requirement WHERE srcfile=$srcfile;
  }
  set totalcnt [db one {SELECT count(*) FROM srcreq}]
  incr total(all) $totalcnt
  puts $out "<tr><td><a href=\"$srcfile\">$srcfile</a></td>"
  set ev(tcl) 0







|







321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
set total(any) 0
set total(all) 0

foreach srcfile $srclist {
  if {$rowcnt%20==0} {puts $out $column_titles}
  incr rowcnt
  db eval {
    CREATE TEMP TABLE IF NOT EXISTS srcreq(reqno TEXT PRIMARY KEY ON CONFLICT IGNORE);
    DELETE FROM srcreq;
    INSERT INTO srcreq SELECT reqno FROM requirement WHERE srcfile=$srcfile;
  }
  set totalcnt [db one {SELECT count(*) FROM srcreq}]
  incr total(all) $totalcnt
  puts $out "<tr><td><a href=\"$srcfile\">$srcfile</a></td>"
  set ev(tcl) 0

Changes to pages/lang.in.

4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
<tcl>
##############################################################################
Section {INDEXED BY} indexedby {{INDEXED BY} {NOT INDEXED}}

</tcl>
<p>^The INDEXED BY phrase forces the [SQLite query planner] to use a
particular named index on a [DELETE], [SELECT], or [UPDATE] statement.
The INDEXED BY phrase is an extension that is particular to SQLite and
is not portable to other SQL database engines.
The INDEXED BY phrase can be seen in the following syntax
diagrams:</p>

<tcl>
RecursiveBubbleDiagram qualified-table-name
</tcl>

<p>^The "INDEXED BY index-name" phrase specifies that the named index
must be used in order to look up values on the preceding table.
^If index-name does not exist or cannot be used for the query, then
the preparation of the SQL statement fails.
^(The "NOT INDEXED" clause specifies that no index shall be used when
accessing the preceding table, including implied indices create by
UNIQUE and PRIMARY KEY constraints.  However, the INTEGER PRIMARY KEY
can still be used to look up entries even when "NOT INDEXED" is specified.)^</p>

<p>Some SQL database engines provide non-standard "hint" mechanisms which
can be used to give the query optimizer clues about what indices it should
use for a particular statement.  The INDEX BY clause of SQLite is 
<em>not</em> a hinting mechanism and it should not be used as such.
^The INDEXED BY clause does not give the optimizer hints about which index







|
|
<
<











|







4509
4510
4511
4512
4513
4514
4515
4516
4517


4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
<tcl>
##############################################################################
Section {INDEXED BY} indexedby {{INDEXED BY} {NOT INDEXED}}

</tcl>
<p>^The INDEXED BY phrase forces the [SQLite query planner] to use a
particular named index on a [DELETE], [SELECT], or [UPDATE] statement.
The INDEXED BY phrase is an SQLite extension and
is not portable to other SQL database engines.</p>



<tcl>
RecursiveBubbleDiagram qualified-table-name
</tcl>

<p>^The "INDEXED BY index-name" phrase specifies that the named index
must be used in order to look up values on the preceding table.
^If index-name does not exist or cannot be used for the query, then
the preparation of the SQL statement fails.
^(The "NOT INDEXED" clause specifies that no index shall be used when
accessing the preceding table, including implied indices create by
UNIQUE and PRIMARY KEY constraints.  However, the [rowid]
can still be used to look up entries even when "NOT INDEXED" is specified.)^</p>

<p>Some SQL database engines provide non-standard "hint" mechanisms which
can be used to give the query optimizer clues about what indices it should
use for a particular statement.  The INDEX BY clause of SQLite is 
<em>not</em> a hinting mechanism and it should not be used as such.
^The INDEXED BY clause does not give the optimizer hints about which index

Changes to schema.tcl.

56
57
58
59
60
61
62
63
64
65
66
67
68
69
70

71
72
73
74
75
76
77
  
  /* Requirements or Testable Statements Of Truth (Tsots).
  ** These are extracts from the documentation that define what
  ** the product does and how it performs.
  */
  CREATE TABLE IF NOT EXISTS requirement(
    rid INTEGER PRIMARY KEY, -- Requirement ID for internal use only
    reqno TEXT UNIQUE,       -- Ex: R-12345-67890-...
    reqimage BOOLEAN,        -- True for an image requirement
    reqtext TEXT,            -- Normalized text of requirement or image filename
    origtext TEXT,           -- Original, unnormalized text
    srcfile TEXT,            -- Document from which extracted
    srcseq INTEGER,          -- Sequence within the same document
    UNIQUE(srcfile,srcseq)
  );

  
  /* Evidence of fulfillment of a requirement is recorded in this
  ** table.
  */
  CREATE TABLE IF NOT EXISTS evidence(
    reqno TEXT,              -- Prefix of a requirement number
    reqtext TEXT,            -- Normalized requirement text taken from source







|







>







56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
  
  /* Requirements or Testable Statements Of Truth (Tsots).
  ** These are extracts from the documentation that define what
  ** the product does and how it performs.
  */
  CREATE TABLE IF NOT EXISTS requirement(
    rid INTEGER PRIMARY KEY, -- Requirement ID for internal use only
    reqno TEXT,              -- Ex: R-12345-67890-...
    reqimage BOOLEAN,        -- True for an image requirement
    reqtext TEXT,            -- Normalized text of requirement or image filename
    origtext TEXT,           -- Original, unnormalized text
    srcfile TEXT,            -- Document from which extracted
    srcseq INTEGER,          -- Sequence within the same document
    UNIQUE(srcfile,srcseq)
  );
  CREATE INDEX IF NOT EXISTS reqno ON requirement(reqno);
  
  /* Evidence of fulfillment of a requirement is recorded in this
  ** table.
  */
  CREATE TABLE IF NOT EXISTS evidence(
    reqno TEXT,              -- Prefix of a requirement number
    reqtext TEXT,            -- Normalized requirement text taken from source

Changes to wrap.tcl.

617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
      "<button id='$a' onclick='hideorshow(\"$a\",\"$b\")'>hide</button></p>\n\
       <blockquote id='$b'>\n\
       <img $alt src=\"$hd(rootpath-$class)images/syntax/$name.gif\" />"
  } else {
    puts $hd($class) \
      "<button id='$a' onclick='hideorshow(\"$a\",\"$b\")'>show</button></p>\n\
       <blockquote id='$b' style='display:none;'>\n\
       <img $alt src=\"$hd(rootpath-$class)images/syntax/$name.gif\" />"
  }
  if {[info exists syntax_linkage($name)]} {
    foreach {cx px} $syntax_linkage($name) break
    foreach c $cx {
      if {[lsearch $exclude $c]>=0} continue
      RecursiveBubbleDiagram_helper $class $c $open2 [concat $exclude $cx]
    }  







|







617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
      "<button id='$a' onclick='hideorshow(\"$a\",\"$b\")'>hide</button></p>\n\
       <blockquote id='$b'>\n\
       <img $alt src=\"$hd(rootpath-$class)images/syntax/$name.gif\" />"
  } else {
    puts $hd($class) \
      "<button id='$a' onclick='hideorshow(\"$a\",\"$b\")'>show</button></p>\n\
       <blockquote id='$b' style='display:none;'>\n\
       <img $alt data-noreq src=\"$hd(rootpath-$class)images/syntax/$name.gif\" />"
  }
  if {[info exists syntax_linkage($name)]} {
    foreach {cx px} $syntax_linkage($name) break
    foreach c $cx {
      if {[lsearch $exclude $c]>=0} continue
      RecursiveBubbleDiagram_helper $class $c $open2 [concat $exclude $cx]
    }