Skip to content

Commit

Permalink
constraint pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Loiselle committed Nov 29, 2016
1 parent 0d0b73a commit 0db0c0e
Show file tree
Hide file tree
Showing 38 changed files with 1,457 additions and 318 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ generate/generate
Railroad.jar
.sass-cache
_site
.jekyll-metadata
27 changes: 24 additions & 3 deletions _data/sidebar_doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,15 +199,36 @@ entries:
url: /sql-grammar.html

thirdlevel:
- title: Constraints
thirdlevelitems:

- title: Overview
url: /constraints.html

- title: Check
url: /check.html

- title: Default Value
url: /default-value.html

- title: Foreign Keys
url: /foreign-key.html

- title: Not Null
url: /not-null.html

- title: Primary Key
url: /primary-key.html

- title: Unique
url: /unique.html

- title: Data Definition
thirdlevelitems:

- title: Keywords & Identifiers
url: /keywords-and-identifiers.html

- title: Constraints
url: /constraints.html

- title: Indexes
url: /indexes.html

Expand Down
70 changes: 70 additions & 0 deletions _includes/sql/diagrams/check_column_level.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<svg width="740" height="248">

<polygon points="9 17 1 13 1 21"></polygon>
<polygon points="17 17 9 13 9 21"></polygon>
<rect x="31" y="3" width="70" height="32" rx="10"></rect>
<rect x="29" y="1" width="70" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="39" y="21">CREATE</text>
<rect x="121" y="3" width="62" height="32" rx="10"></rect>
<rect x="119" y="1" width="62" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="129" y="21">TABLE</text>

<rect x="203" y="3" width="94" height="32"></rect>
<rect x="201" y="1" width="94" height="32" class="nonterminal"></rect>
<text class="nonterminal" x="211" y="21">table_name</text>

<rect x="317" y="3" width="26" height="32" rx="10"></rect>
<rect x="315" y="1" width="26" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="325" y="21">(</text>

<rect x="363" y="3" width="106" height="32"></rect>
<rect x="361" y="1" width="106" height="32" class="nonterminal"></rect>
<text class="nonterminal" x="371" y="21">column_name</text>


<rect x="489" y="3" width="100" height="32"></rect>
<rect x="487" y="1" width="100" height="32" class="nonterminal"></rect>
<text class="nonterminal" x="497" y="21">column_type</text>

<rect x="609" y="3" width="64" height="32" rx="10"></rect>
<rect x="607" y="1" width="64" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="617" y="21">CHECK</text>
<rect x="693" y="3" width="26" height="32" rx="10"></rect>
<rect x="691" y="1" width="26" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="701" y="21">(</text>

<rect x="85" y="85" width="90" height="32"></rect>
<rect x="83" y="83" width="90" height="32" class="nonterminal"></rect>
<text class="nonterminal" x="93" y="103">check_expr</text>

<rect x="195" y="85" width="26" height="32" rx="10"></rect>
<rect x="193" y="83" width="26" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="203" y="103">)</text>

<rect x="261" y="117" width="142" height="32"></rect>
<rect x="259" y="115" width="142" height="32" class="nonterminal"></rect>
<text class="nonterminal" x="269" y="135">column_constraints</text>

<rect x="483" y="85" width="24" height="32" rx="10"></rect>
<rect x="481" y="83" width="24" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="491" y="103">,</text>
<a xlink:href="sql-grammar.html#column_def" xlink:title="column_def">
<rect x="527" y="85" width="92" height="32"></rect>
<rect x="525" y="83" width="92" height="32" class="nonterminal"></rect>
<text class="nonterminal" x="535" y="103">column_def</text>
</a>

<rect x="471" y="215" width="130" height="32"></rect>
<rect x="469" y="213" width="130" height="32" class="nonterminal"></rect>
<text class="nonterminal" x="479" y="233">table_constraints</text>

<rect x="641" y="183" width="26" height="32" rx="10"></rect>
<rect x="639" y="181" width="26" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="649" y="201">)</text>
<rect x="687" y="183" width="26" height="32" rx="10"></rect>
<rect x="685" y="181" width="26" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="695" y="201">)</text>
<path class="line" d="m17 17 h2 m0 0 h10 m70 0 h10 m0 0 h10 m62 0 h10 m0 0 h10 m94 0 h10 m0 0 h10 m26 0 h10 m0 0 h10 m106 0 h10 m0 0 h10 m100 0 h10 m0 0 h10 m64 0 h10 m0 0 h10 m26 0 h10 m2 0 l2 0 m2 0 l2 0 m2 0 l2 0 m-678 82 l2 0 m2 0 l2 0 m2 0 l2 0 m2 0 h10 m90 0 h10 m0 0 h10 m26 0 h10 m20 0 h10 m0 0 h152 m-182 0 h20 m162 0 h20 m-202 0 q10 0 10 10 m182 0 q0 -10 10 -10 m-192 10 v12 m182 0 v-12 m-182 12 q0 10 10 10 m162 0 q10 0 10 -10 m-172 10 h10 m142 0 h10 m60 -32 h10 m24 0 h10 m0 0 h10 m92 0 h10 m-176 0 l20 0 m-1 0 q-9 0 -9 -10 l0 -12 q0 -10 10 -10 m156 32 l20 0 m-20 0 q10 0 10 -10 l0 -12 q0 -10 -10 -10 m-156 0 h10 m0 0 h146 m-196 32 h20 m196 0 h20 m-236 0 q10 0 10 10 m216 0 q0 -10 10 -10 m-226 10 v14 m216 0 v-14 m-216 14 q0 10 10 10 m196 0 q10 0 10 -10 m-206 10 h10 m0 0 h186 m22 -34 l2 0 m2 0 l2 0 m2 0 l2 0 m-252 98 l2 0 m2 0 l2 0 m2 0 l2 0 m22 0 h10 m0 0 h140 m-170 0 h20 m150 0 h20 m-190 0 q10 0 10 10 m170 0 q0 -10 10 -10 m-180 10 v12 m170 0 v-12 m-170 12 q0 10 10 10 m150 0 q10 0 10 -10 m-160 10 h10 m130 0 h10 m20 -32 h10 m26 0 h10 m0 0 h10 m26 0 h10 m3 0 h-3"></path>
<polygon points="731 197 739 193 739 201"></polygon>
<polygon points="731 197 723 193 723 201"></polygon>
</svg>
60 changes: 60 additions & 0 deletions _includes/sql/diagrams/check_table_level.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<svg width="758" height="210">

<polygon points="9 61 1 57 1 65"></polygon>
<polygon points="17 61 9 57 9 65"></polygon>
<rect x="31" y="47" width="70" height="32" rx="10"></rect>
<rect x="29" y="45" width="70" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="39" y="65">CREATE</text>
<rect x="121" y="47" width="62" height="32" rx="10"></rect>
<rect x="119" y="45" width="62" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="129" y="65">TABLE</text>

<rect x="203" y="47" width="94" height="32"></rect>
<rect x="201" y="45" width="94" height="32" class="nonterminal"></rect>
<text class="nonterminal" x="211" y="65">table_name</text>

<rect x="317" y="47" width="26" height="32" rx="10"></rect>
<rect x="315" y="45" width="26" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="325" y="65">(</text>
<a xlink:href="sql-grammar.html#column_def" xlink:title="column_def">
<rect x="383" y="47" width="92" height="32"></rect>
<rect x="381" y="45" width="92" height="32" class="nonterminal"></rect>
<text class="nonterminal" x="391" y="65">column_def</text>
</a>
<rect x="383" y="3" width="24" height="32" rx="10"></rect>
<rect x="381" y="1" width="24" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="391" y="21">,</text>
<rect x="535" y="79" width="108" height="32" rx="10"></rect>
<rect x="533" y="77" width="108" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="543" y="97">CONSTRAINT</text>
<a xlink:href="sql-grammar.html#name" xlink:title="name">
<rect x="663" y="79" width="54" height="32"></rect>
<rect x="661" y="77" width="54" height="32" class="nonterminal"></rect>
<text class="nonterminal" x="671" y="97">name</text>
</a>
<rect x="229" y="145" width="64" height="32" rx="10"></rect>
<rect x="227" y="143" width="64" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="237" y="163">CHECK</text>
<rect x="313" y="145" width="26" height="32" rx="10"></rect>
<rect x="311" y="143" width="26" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="321" y="163">(</text>

<rect x="359" y="145" width="90" height="32"></rect>
<rect x="357" y="143" width="90" height="32" class="nonterminal"></rect>
<text class="nonterminal" x="367" y="163">check_expr</text>

<rect x="469" y="145" width="26" height="32" rx="10"></rect>
<rect x="467" y="143" width="26" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="477" y="163">)</text>

<rect x="535" y="177" width="130" height="32"></rect>
<rect x="533" y="175" width="130" height="32" class="nonterminal"></rect>
<text class="nonterminal" x="543" y="195">table_constraints</text>

<rect x="705" y="145" width="26" height="32" rx="10"></rect>
<rect x="703" y="143" width="26" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="713" y="163">)</text>
<path class="line" d="m17 61 h2 m0 0 h10 m70 0 h10 m0 0 h10 m62 0 h10 m0 0 h10 m94 0 h10 m0 0 h10 m26 0 h10 m20 0 h10 m92 0 h10 m-132 0 l20 0 m-1 0 q-9 0 -9 -10 l0 -24 q0 -10 10 -10 m112 44 l20 0 m-20 0 q10 0 10 -10 l0 -24 q0 -10 -10 -10 m-112 0 h10 m24 0 h10 m0 0 h68 m40 44 h10 m0 0 h192 m-222 0 h20 m202 0 h20 m-242 0 q10 0 10 10 m222 0 q0 -10 10 -10 m-232 10 v12 m222 0 v-12 m-222 12 q0 10 10 10 m202 0 q10 0 10 -10 m-212 10 h10 m108 0 h10 m0 0 h10 m54 0 h10 m22 -32 l2 0 m2 0 l2 0 m2 0 l2 0 m-552 98 l2 0 m2 0 l2 0 m2 0 l2 0 m2 0 h10 m64 0 h10 m0 0 h10 m26 0 h10 m0 0 h10 m90 0 h10 m0 0 h10 m26 0 h10 m20 0 h10 m0 0 h140 m-170 0 h20 m150 0 h20 m-190 0 q10 0 10 10 m170 0 q0 -10 10 -10 m-180 10 v12 m170 0 v-12 m-170 12 q0 10 10 10 m150 0 q10 0 10 -10 m-160 10 h10 m130 0 h10 m20 -32 h10 m26 0 h10 m3 0 h-3"></path>
<polygon points="749 159 757 155 757 163"></polygon>
<polygon points="749 159 741 155 741 163"></polygon>
</svg>
64 changes: 64 additions & 0 deletions _includes/sql/diagrams/default_value_column_level.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<svg width="710" height="248">

<polygon points="9 17 1 13 1 21"></polygon>
<polygon points="17 17 9 13 9 21"></polygon>
<rect x="31" y="3" width="70" height="32" rx="10"></rect>
<rect x="29" y="1" width="70" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="39" y="21">CREATE</text>
<rect x="121" y="3" width="62" height="32" rx="10"></rect>
<rect x="119" y="1" width="62" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="129" y="21">TABLE</text>

<rect x="203" y="3" width="94" height="32"></rect>
<rect x="201" y="1" width="94" height="32" class="nonterminal"></rect>
<text class="nonterminal" x="211" y="21">table_name</text>

<rect x="317" y="3" width="26" height="32" rx="10"></rect>
<rect x="315" y="1" width="26" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="325" y="21">(</text>

<rect x="363" y="3" width="106" height="32"></rect>
<rect x="361" y="1" width="106" height="32" class="nonterminal"></rect>
<text class="nonterminal" x="371" y="21">column_name</text>


<rect x="489" y="3" width="100" height="32"></rect>
<rect x="487" y="1" width="100" height="32" class="nonterminal"></rect>
<text class="nonterminal" x="497" y="21">column_type</text>

<rect x="609" y="3" width="80" height="32" rx="10"></rect>
<rect x="607" y="1" width="80" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="617" y="21">DEFAULT</text>

<rect x="85" y="85" width="106" height="32"></rect>
<rect x="83" y="83" width="106" height="32" class="nonterminal"></rect>
<text class="nonterminal" x="93" y="103">default_value</text>

<a xlink:href="sql-grammar.html#column_constraints" xlink:title="column_constraints">
<rect x="231" y="117" width="142" height="32"></rect>
<rect x="229" y="115" width="142" height="32" class="nonterminal"></rect>
<text class="nonterminal" x="239" y="135">column_constraints</text>
</a>
<rect x="453" y="85" width="24" height="32" rx="10"></rect>
<rect x="451" y="83" width="24" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="461" y="103">,</text>
<a xlink:href="sql-grammar.html#column_def" xlink:title="column_def">
<rect x="497" y="85" width="92" height="32"></rect>
<rect x="495" y="83" width="92" height="32" class="nonterminal"></rect>
<text class="nonterminal" x="505" y="103">column_def</text>
</a>

<rect x="441" y="215" width="130" height="32"></rect>
<rect x="439" y="213" width="130" height="32" class="nonterminal"></rect>
<text class="nonterminal" x="449" y="233">table_constraints</text>

<rect x="611" y="183" width="26" height="32" rx="10"></rect>
<rect x="609" y="181" width="26" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="619" y="201">)</text>
<rect x="657" y="183" width="26" height="32" rx="10"></rect>
<rect x="655" y="181" width="26" height="32" class="terminal" rx="10"></rect>
<text class="terminal" x="665" y="201">)</text>
<path class="line" d="m17 17 h2 m0 0 h10 m70 0 h10 m0 0 h10 m62 0 h10 m0 0 h10 m94 0 h10 m0 0 h10 m26 0 h10 m0 0 h10 m106 0 h10 m0 0 h10 m100 0 h10 m0 0 h10 m80 0 h10 m2 0 l2 0 m2 0 l2 0 m2 0 l2 0 m-648 82 l2 0 m2 0 l2 0 m2 0 l2 0 m2 0 h10 m106 0 h10 m20 0 h10 m0 0 h152 m-182 0 h20 m162 0 h20 m-202 0 q10 0 10 10 m182 0 q0 -10 10 -10 m-192 10 v12 m182 0 v-12 m-182 12 q0 10 10 10 m162 0 q10 0 10 -10 m-172 10 h10 m142 0 h10 m60 -32 h10 m24 0 h10 m0 0 h10 m92 0 h10 m-176 0 l20 0 m-1 0 q-9 0 -9 -10 l0 -12 q0 -10 10 -10 m156 32 l20 0 m-20 0 q10 0 10 -10 l0 -12 q0 -10 -10 -10 m-156 0 h10 m0 0 h146 m-196 32 h20 m196 0 h20 m-236 0 q10 0 10 10 m216 0 q0 -10 10 -10 m-226 10 v14 m216 0 v-14 m-216 14 q0 10 10 10 m196 0 q10 0 10 -10 m-206 10 h10 m0 0 h186 m22 -34 l2 0 m2 0 l2 0 m2 0 l2 0 m-252 98 l2 0 m2 0 l2 0 m2 0 l2 0 m22 0 h10 m0 0 h140 m-170 0 h20 m150 0 h20 m-190 0 q10 0 10 10 m170 0 q0 -10 10 -10 m-180 10 v12 m170 0 v-12 m-170 12 q0 10 10 10 m150 0 q10 0 10 -10 m-160 10 h10 m130 0 h10 m20 -32 h10 m26 0 h10 m0 0 h10 m26 0 h10 m3 0 h-3"></path>
<polygon points="701 197 709 193 709 201"></polygon>
<polygon points="701 197 693 193 693 201"></polygon>
</svg>
Loading

0 comments on commit 0db0c0e

Please sign in to comment.