Skip to content

Commit

Permalink
Deploying to gh-pages from @ bca6bd0 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonShin committed Nov 5, 2023
1 parent faa49fd commit dbf0d6e
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 38 deletions.
59 changes: 41 additions & 18 deletions print.html
Original file line number Diff line number Diff line change
Expand Up @@ -399,28 +399,35 @@ <h3 id="3-file-based-config"><a class="header" href="#3-file-based-config">3. Fi
</code></pre>
<p>Example <code>sqlxrc.json</code></p>
<pre><code class="language-json">{
&quot;default&quot;: {
&quot;DB_TYPE&quot;: &quot;mysql&quot;,
&quot;DB_USER&quot;: &quot;root&quot;,
&quot;DB_HOST&quot;: &quot;127.0.0.1&quot;,
&quot;DB_PORT&quot;: 3306
&quot;generate_types&quot;: {
&quot;enabled&quot;: true,
&quot;convertToCamelCaseColumnName&quot;: true
},
&quot;postgres&quot;: {
&quot;DB_TYPE&quot;: &quot;postgres&quot;,
&quot;DB_USER&quot;: &quot;postgres&quot;,
&quot;DB_PASS&quot;: &quot;postgres&quot;,
&quot;DB_HOST&quot;: &quot;127.0.0.1&quot;,
&quot;DB_PORT&quot;: 4321
},
&quot;some_other_db&quot;: {
&quot;DB_TYPE&quot;: &quot;mysql&quot;,
&quot;DB_USER&quot;: &quot;app_user&quot;,
&quot;DB_PASS&quot;: &quot;password&quot;,
&quot;DB_HOST&quot;: &quot;127.0.0.1&quot;,
&quot;DB_PORT&quot;: 3307
&quot;connections&quot;: {
&quot;default&quot;: {
&quot;DB_TYPE&quot;: &quot;mysql&quot;,
&quot;DB_USER&quot;: &quot;root&quot;,
&quot;DB_HOST&quot;: &quot;127.0.0.1&quot;,
&quot;DB_PORT&quot;: 3306
},
&quot;postgres&quot;: {
&quot;DB_TYPE&quot;: &quot;postgres&quot;,
&quot;DB_USER&quot;: &quot;postgres&quot;,
&quot;DB_PASS&quot;: &quot;postgres&quot;,
&quot;DB_HOST&quot;: &quot;127.0.0.1&quot;,
&quot;DB_PORT&quot;: 4321
},
&quot;some_other_db&quot;: {
&quot;DB_TYPE&quot;: &quot;mysql&quot;,
&quot;DB_USER&quot;: &quot;app_user&quot;,
&quot;DB_PASS&quot;: &quot;password&quot;,
&quot;DB_HOST&quot;: &quot;127.0.0.1&quot;,
&quot;DB_PORT&quot;: 3307
}
}
}
</code></pre>
<h3 id="required-connections"><a class="header" href="#required-connections">(required) &quot;connections&quot;</a></h3>
<p>For default database, you must call it <code>default</code> like example above. Any extra DB connections
should have its own unique name such as <code>postgres</code> or <code>some_other_db</code></p>
<p>Along with the configuration above, when writing SQLs in your codebase, you need to provide
Expand All @@ -435,6 +442,22 @@ <h3 id="3-file-based-config"><a class="header" href="#3-file-based-config">3. Fi
`
</code></pre>
<p>Then running <code>sqlx-ts</code> compile time query checker along with the </p>
<h3 id="generate_types"><a class="header" href="#generate_types">generate_types</a></h3>
<pre><code class="language-json">{
&quot;generateTypes: {
enabled: true|false,
convertToCamelCaseColumnName: true|false
},
&quot;connections&quot;: {
...
}
}
</code></pre>
<p>Support for configuration of generate types operations.</p>
<ul>
<li><code>enabled</code> (default: false): enables type generation via config</li>
<li><code>convertToCamelCaseColumnName</code> (default: true): when generating field name based on table's column name, it will automatically cast to camelCase in TypeScript</li>
</ul>
<div style="break-before: page; page-break-before: always;"></div><h1 id="environment-variables"><a class="header" href="#environment-variables">Environment variables</a></h1>
<div class="table-wrapper"><table><thead><tr><th>Environment variables</th><th>Description</th></tr></thead><tbody>
<tr><td>DB_HOST</td><td>Primary DB host</td></tr>
Expand Down
59 changes: 41 additions & 18 deletions reference-guide/2.1.configs-file-based.html
Original file line number Diff line number Diff line change
Expand Up @@ -180,28 +180,35 @@ <h1 id="file-base-configuration-for-connecting-to-multiple-db"><a class="header"
</code></pre>
<p>Example <code>sqlxrc.json</code></p>
<pre><code class="language-json">{
&quot;default&quot;: {
&quot;DB_TYPE&quot;: &quot;mysql&quot;,
&quot;DB_USER&quot;: &quot;root&quot;,
&quot;DB_HOST&quot;: &quot;127.0.0.1&quot;,
&quot;DB_PORT&quot;: 3306
&quot;generate_types&quot;: {
&quot;enabled&quot;: true,
&quot;convertToCamelCaseColumnName&quot;: true
},
&quot;postgres&quot;: {
&quot;DB_TYPE&quot;: &quot;postgres&quot;,
&quot;DB_USER&quot;: &quot;postgres&quot;,
&quot;DB_PASS&quot;: &quot;postgres&quot;,
&quot;DB_HOST&quot;: &quot;127.0.0.1&quot;,
&quot;DB_PORT&quot;: 4321
},
&quot;some_other_db&quot;: {
&quot;DB_TYPE&quot;: &quot;mysql&quot;,
&quot;DB_USER&quot;: &quot;app_user&quot;,
&quot;DB_PASS&quot;: &quot;password&quot;,
&quot;DB_HOST&quot;: &quot;127.0.0.1&quot;,
&quot;DB_PORT&quot;: 3307
&quot;connections&quot;: {
&quot;default&quot;: {
&quot;DB_TYPE&quot;: &quot;mysql&quot;,
&quot;DB_USER&quot;: &quot;root&quot;,
&quot;DB_HOST&quot;: &quot;127.0.0.1&quot;,
&quot;DB_PORT&quot;: 3306
},
&quot;postgres&quot;: {
&quot;DB_TYPE&quot;: &quot;postgres&quot;,
&quot;DB_USER&quot;: &quot;postgres&quot;,
&quot;DB_PASS&quot;: &quot;postgres&quot;,
&quot;DB_HOST&quot;: &quot;127.0.0.1&quot;,
&quot;DB_PORT&quot;: 4321
},
&quot;some_other_db&quot;: {
&quot;DB_TYPE&quot;: &quot;mysql&quot;,
&quot;DB_USER&quot;: &quot;app_user&quot;,
&quot;DB_PASS&quot;: &quot;password&quot;,
&quot;DB_HOST&quot;: &quot;127.0.0.1&quot;,
&quot;DB_PORT&quot;: 3307
}
}
}
</code></pre>
<h3 id="required-connections"><a class="header" href="#required-connections">(required) &quot;connections&quot;</a></h3>
<p>For default database, you must call it <code>default</code> like example above. Any extra DB connections
should have its own unique name such as <code>postgres</code> or <code>some_other_db</code></p>
<p>Along with the configuration above, when writing SQLs in your codebase, you need to provide
Expand All @@ -216,6 +223,22 @@ <h1 id="file-base-configuration-for-connecting-to-multiple-db"><a class="header"
`
</code></pre>
<p>Then running <code>sqlx-ts</code> compile time query checker along with the </p>
<h3 id="generate_types"><a class="header" href="#generate_types">generate_types</a></h3>
<pre><code class="language-json">{
&quot;generateTypes: {
enabled: true|false,
convertToCamelCaseColumnName: true|false
},
&quot;connections&quot;: {
...
}
}
</code></pre>
<p>Support for configuration of generate types operations.</p>
<ul>
<li><code>enabled</code> (default: false): enables type generation via config</li>
<li><code>convertToCamelCaseColumnName</code> (default: true): when generating field name based on table's column name, it will automatically cast to camelCase in TypeScript</li>
</ul>

</main>

Expand Down
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion searchindex.json

Large diffs are not rendered by default.

0 comments on commit dbf0d6e

Please sign in to comment.