mirror of
https://github.com/knex/knex.git
synced 2025-06-26 22:00:25 +00:00
re-doccco
This commit is contained in:
parent
be2273d596
commit
75e658eaa9
168
docs/knex.html
168
docs/knex.html
@ -2914,8 +2914,7 @@ the blueprint element, so we'll just call that compilers function.</p>
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> increments: <span class="keyword">function</span>(column) {
|
||||
column || (column = <span class="string">'id'</span>);
|
||||
<span class="keyword">return</span> <span class="keyword">this</span>._addColumn(<span class="string">'integer'</span>, column, {autoIncrement: <span class="literal">true</span>});
|
||||
<span class="keyword">return</span> <span class="keyword">this</span>._addColumn(<span class="string">'integer'</span>, (column || <span class="string">'id'</span>), {autoIncrement: <span class="literal">true</span>});
|
||||
},</pre></div></div>
|
||||
|
||||
</li>
|
||||
@ -2944,12 +2943,12 @@ the blueprint element, so we'll just call that compilers function.</p>
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-149">¶</a>
|
||||
</div>
|
||||
<p>Create a new text column on the table.</p>
|
||||
<p>Alias varchar to string</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> text: <span class="keyword">function</span>(column) {
|
||||
<span class="keyword">return</span> <span class="keyword">this</span>._addColumn(<span class="string">'text'</span>, column);
|
||||
<div class="content"><div class='highlight'><pre> varchar: <span class="keyword">function</span>(column, length) {
|
||||
<span class="keyword">return</span> <span class="keyword">this</span>.string(column, length);
|
||||
},</pre></div></div>
|
||||
|
||||
</li>
|
||||
@ -2961,12 +2960,12 @@ the blueprint element, so we'll just call that compilers function.</p>
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-150">¶</a>
|
||||
</div>
|
||||
<p>Create a new integer column on the table.</p>
|
||||
<p>Create a new text column on the table.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> integer: <span class="keyword">function</span>(column) {
|
||||
<span class="keyword">return</span> <span class="keyword">this</span>._addColumn(<span class="string">'integer'</span>, column);
|
||||
<div class="content"><div class='highlight'><pre> text: <span class="keyword">function</span>(column, length) {
|
||||
<span class="keyword">return</span> <span class="keyword">this</span>._addColumn(<span class="string">'text'</span>, column, {length: (length || <span class="literal">false</span>)});
|
||||
},</pre></div></div>
|
||||
|
||||
</li>
|
||||
@ -2978,6 +2977,40 @@ the blueprint element, so we'll just call that compilers function.</p>
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-151">¶</a>
|
||||
</div>
|
||||
<p>Create a new integer column on the table.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> integer: <span class="keyword">function</span>(column, length) {
|
||||
<span class="keyword">return</span> <span class="keyword">this</span>._addColumn(<span class="string">'integer'</span>, column, {length: (length || <span class="number">11</span>)});
|
||||
},</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-152">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-152">¶</a>
|
||||
</div>
|
||||
<p>Create a new tinyinteger column on the table.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> tinyInteger: <span class="keyword">function</span>(column) {
|
||||
<span class="keyword">return</span> <span class="keyword">this</span>._addColumn(<span class="string">'tinyInteger'</span>, column);
|
||||
},</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-153">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-153">¶</a>
|
||||
</div>
|
||||
<p>Create a new float column on the table.</p>
|
||||
|
||||
</div>
|
||||
@ -2989,11 +3022,11 @@ the blueprint element, so we'll just call that compilers function.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-152">
|
||||
<li id="section-154">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-152">¶</a>
|
||||
<a class="pilcrow" href="#section-154">¶</a>
|
||||
</div>
|
||||
<p>Create a new decimal column on the table.</p>
|
||||
|
||||
@ -3006,28 +3039,28 @@ the blueprint element, so we'll just call that compilers function.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-153">
|
||||
<li id="section-155">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-153">¶</a>
|
||||
<a class="pilcrow" href="#section-155">¶</a>
|
||||
</div>
|
||||
<p>Create a new boolean column on the table.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> boolean: <span class="keyword">function</span>(column) {
|
||||
<span class="keyword">return</span> <span class="keyword">this</span>.bool(columns);
|
||||
<span class="keyword">return</span> <span class="keyword">this</span>._addColumn(<span class="string">'boolean'</span>, column);
|
||||
},</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-154">
|
||||
<li id="section-156">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-154">¶</a>
|
||||
<a class="pilcrow" href="#section-156">¶</a>
|
||||
</div>
|
||||
<p>Alias to "boolean".</p>
|
||||
|
||||
@ -3040,11 +3073,11 @@ the blueprint element, so we'll just call that compilers function.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-155">
|
||||
<li id="section-157">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-155">¶</a>
|
||||
<a class="pilcrow" href="#section-157">¶</a>
|
||||
</div>
|
||||
<p>Create a new date column on the table.</p>
|
||||
|
||||
@ -3057,11 +3090,11 @@ the blueprint element, so we'll just call that compilers function.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-156">
|
||||
<li id="section-158">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-156">¶</a>
|
||||
<a class="pilcrow" href="#section-158">¶</a>
|
||||
</div>
|
||||
<p>Create a new date-time column on the table.</p>
|
||||
|
||||
@ -3074,11 +3107,11 @@ the blueprint element, so we'll just call that compilers function.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-157">
|
||||
<li id="section-159">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-157">¶</a>
|
||||
<a class="pilcrow" href="#section-159">¶</a>
|
||||
</div>
|
||||
<p>Create a new time column on the table.</p>
|
||||
|
||||
@ -3091,11 +3124,11 @@ the blueprint element, so we'll just call that compilers function.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-158">
|
||||
<li id="section-160">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-158">¶</a>
|
||||
<a class="pilcrow" href="#section-160">¶</a>
|
||||
</div>
|
||||
<p>Create a new timestamp column on the table.</p>
|
||||
|
||||
@ -3108,11 +3141,11 @@ the blueprint element, so we'll just call that compilers function.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-159">
|
||||
<li id="section-161">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-159">¶</a>
|
||||
<a class="pilcrow" href="#section-161">¶</a>
|
||||
</div>
|
||||
<p>Add creation and update timestamps to the table.</p>
|
||||
|
||||
@ -3126,11 +3159,11 @@ the blueprint element, so we'll just call that compilers function.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-160">
|
||||
<li id="section-162">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-160">¶</a>
|
||||
<a class="pilcrow" href="#section-162">¶</a>
|
||||
</div>
|
||||
<p>Create a new enum column on the table.</p>
|
||||
|
||||
@ -3143,11 +3176,11 @@ the blueprint element, so we'll just call that compilers function.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-161">
|
||||
<li id="section-163">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-161">¶</a>
|
||||
<a class="pilcrow" href="#section-163">¶</a>
|
||||
</div>
|
||||
<p>Alias to enum.</p>
|
||||
|
||||
@ -3160,11 +3193,28 @@ the blueprint element, so we'll just call that compilers function.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-162">
|
||||
<li id="section-164">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-162">¶</a>
|
||||
<a class="pilcrow" href="#section-164">¶</a>
|
||||
</div>
|
||||
<p>Create a new bit column on the table.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="content"><div class='highlight'><pre> bit: <span class="keyword">function</span>(column, length) {
|
||||
<span class="keyword">return</span> <span class="keyword">this</span>._addColumn(<span class="string">'bit'</span>, column, {length: (length || <span class="literal">false</span>)});
|
||||
},</pre></div></div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-165">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-165">¶</a>
|
||||
</div>
|
||||
<p>Create a new binary column on the table.</p>
|
||||
|
||||
@ -3177,11 +3227,11 @@ the blueprint element, so we'll just call that compilers function.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-163">
|
||||
<li id="section-166">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-163">¶</a>
|
||||
<a class="pilcrow" href="#section-166">¶</a>
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
@ -3190,11 +3240,11 @@ the blueprint element, so we'll just call that compilers function.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-164">
|
||||
<li id="section-167">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-164">¶</a>
|
||||
<a class="pilcrow" href="#section-167">¶</a>
|
||||
</div>
|
||||
<p>Create a new drop index command on the blueprint.</p>
|
||||
|
||||
@ -3212,11 +3262,11 @@ the blueprint element, so we'll just call that compilers function.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-165">
|
||||
<li id="section-168">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-165">¶</a>
|
||||
<a class="pilcrow" href="#section-168">¶</a>
|
||||
</div>
|
||||
<p>Add a new index command to the blueprint.
|
||||
If no name was specified for this index, we will create one using a basic
|
||||
@ -3238,11 +3288,11 @@ index type, such as primary or index, which makes the index unique.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-166">
|
||||
<li id="section-169">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-166">¶</a>
|
||||
<a class="pilcrow" href="#section-169">¶</a>
|
||||
</div>
|
||||
<p>Add a new column to the blueprint.</p>
|
||||
|
||||
@ -3259,11 +3309,11 @@ index type, such as primary or index, which makes the index unique.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-167">
|
||||
<li id="section-170">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-167">¶</a>
|
||||
<a class="pilcrow" href="#section-170">¶</a>
|
||||
</div>
|
||||
<p>Add a new command to the blueprint.</p>
|
||||
|
||||
@ -3279,11 +3329,11 @@ index type, such as primary or index, which makes the index unique.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-168">
|
||||
<li id="section-171">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-168">¶</a>
|
||||
<a class="pilcrow" href="#section-171">¶</a>
|
||||
</div>
|
||||
<p>Chainable object used in creating SchemaBuilder commands.</p>
|
||||
|
||||
@ -3298,11 +3348,11 @@ index type, such as primary or index, which makes the index unique.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-169">
|
||||
<li id="section-172">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-169">¶</a>
|
||||
<a class="pilcrow" href="#section-172">¶</a>
|
||||
</div>
|
||||
<p>Sets the default value for a column.</p>
|
||||
|
||||
@ -3316,11 +3366,11 @@ index type, such as primary or index, which makes the index unique.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-170">
|
||||
<li id="section-173">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-170">¶</a>
|
||||
<a class="pilcrow" href="#section-173">¶</a>
|
||||
</div>
|
||||
<p>Sets an integer as unsigned, is a no-op
|
||||
if the column type is not an integer.</p>
|
||||
@ -3335,11 +3385,11 @@ if the column type is not an integer.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-171">
|
||||
<li id="section-174">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-171">¶</a>
|
||||
<a class="pilcrow" href="#section-174">¶</a>
|
||||
</div>
|
||||
<p>Allows the column to contain null values.</p>
|
||||
|
||||
@ -3374,11 +3424,11 @@ if the column type is not an integer.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-172">
|
||||
<li id="section-175">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap for-h2">
|
||||
<a class="pilcrow" href="#section-172">¶</a>
|
||||
<a class="pilcrow" href="#section-175">¶</a>
|
||||
</div>
|
||||
<h2>Knex.Raw</h2>
|
||||
|
||||
@ -3387,11 +3437,11 @@ if the column type is not an integer.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-173">
|
||||
<li id="section-176">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-173">¶</a>
|
||||
<a class="pilcrow" href="#section-176">¶</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@ -3403,11 +3453,11 @@ if the column type is not an integer.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-174">
|
||||
<li id="section-177">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap for-h2">
|
||||
<a class="pilcrow" href="#section-174">¶</a>
|
||||
<a class="pilcrow" href="#section-177">¶</a>
|
||||
</div>
|
||||
<h2>Knex.runQuery</h2>
|
||||
|
||||
@ -3416,11 +3466,11 @@ if the column type is not an integer.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-175">
|
||||
<li id="section-178">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-175">¶</a>
|
||||
<a class="pilcrow" href="#section-178">¶</a>
|
||||
</div>
|
||||
<p>Query runner, the context of this function is set to the caller,
|
||||
(either Builder or SchemaBuilder). Checks and fails on an already
|
||||
@ -3445,11 +3495,11 @@ and returns a deferred promise.</p>
|
||||
</li>
|
||||
|
||||
|
||||
<li id="section-176">
|
||||
<li id="section-179">
|
||||
<div class="annotation">
|
||||
|
||||
<div class="pilwrap ">
|
||||
<a class="pilcrow" href="#section-176">¶</a>
|
||||
<a class="pilcrow" href="#section-179">¶</a>
|
||||
</div>
|
||||
<p>Export the Knex module</p>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user