Skip to content

Commit

Permalink
Update generated documentation for version 1.3.38
Browse files Browse the repository at this point in the history
  • Loading branch information
Thorium committed Jun 13, 2024
1 parent 94e3512 commit 678f005
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion core/querying.html
Original file line number Diff line number Diff line change
Expand Up @@ -1403,7 +1403,9 @@ <h3><a name="Using-booleans-and-simple-variables-from-outside-a-scope-in-where-c
<details>
<summary>Technical details</summary>
<p>This is what happens behind the scenes:</p>
<p><img src="https://raw.githubusercontent.com/fsprojects/SQLProvider/master/docs/files/where.png" alt="1. Evaluate what we can on .NET side to short-circuit the SQL, 2. Gather AST and translate to SQL, 3. Optimize with Boolean algebra what is not needed" title="1. Evaluate what we can on .NET side to short-circuit the SQL, 2. Gather AST and translate to SQL, 3. Optimize with Boolean algebra what is not needed" /></p>
<p><img src="https://raw.githubusercontent.com/fsprojects/SQLProvider/master/docs/files/where.png" alt="1. Evaluate what we can on .NET side to short-circuit the SQL, 2. Optimize with Boolean algebra what is not needed, 3. Gather AST and translate to SQL" title="1. Evaluate what we can on .NET side to short-circuit the SQL, 2. Optimize with Boolean algebra what is not needed, 3. Gather AST and translate to SQL" /></p>
<p>The F# query syntax is LINQ Abstract Syntax Tree (AST), and SQLProvider does process those on querying.</p>
<p><img src="https://raw.githubusercontent.com/fsprojects/SQLProvider/master/docs/files/linq-ast.png" alt="Operations that can be done on .NET side vs. Operations translated to SQL" title="Operations that can be done on .NET side vs. Operations translated to SQL" /></p>
</details>
<h3><a name="Don-t-select-all-the-fields-if-you-don-t-need-them" class="anchor" href="#Don-t-select-all-the-fields-if-you-don-t-need-them">Don't select all the fields if you don't need them</a></h3>
<p>In general you should select only columns you need
Expand Down
1 change: 1 addition & 0 deletions core/techdetails.html
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ <h3><a name="Parsing-the-LINQ-expression-tree" class="anchor" href="#Parsing-the
<p>because the LINQ-expression-tree has <code>ExpressionType.Call</code> named "Where" with source of IWithSqlService (which is the SqlQueryable<SqlEntity>).
What happens then is parsing of the Where-query. Where-queries are nested structures having known conditions (modelled with pattern <code>Condition</code>). If the conditions are having <code>SqlColumnGet</code>s, a pattern that says that it's <code>SqlEntity</code> with method <code>GetColumn</code>, we know that it has to be part of SQL-clause.</p>
<p>We collect all the known patterns to <code>IWithSqlService</code>s field SqlExpression, being a type <code>SqlExp</code>, our non-complete known recursive model-tree of SQL clauses.</p>
<p><img src="https://raw.githubusercontent.com/fsprojects/SQLProvider/master/docs/files/linq-ast.png" alt="Operations that can be done on .NET side vs. Operations translated to SQL" title="Operations that can be done on .NET side vs. Operations translated to SQL" /></p>
<h3><a name="Execution-of-the-query" class="anchor" href="#Execution-of-the-query">Execution of the query</a></h3>
<p>Eventually there also comes the call <code>executeQuery</code> (or <code>executeQueryScalar</code> for SQL-queries that will return a single value like count), either by enumeration of our IQueryable or at the end of LINQ-expression-tree. That will call <code>QueryExpressionTransformer.convertExpression</code>. What happens there (in
<a href="https://github.com/fsprojects/SQLProvider/blob/master/src/SQLProvider/SqlRuntime.Linq.fs">SqlRuntime.Linq.fs</a>):</p>
Expand Down
2 changes: 1 addition & 1 deletion index.json

Large diffs are not rendered by default.

0 comments on commit 678f005

Please sign in to comment.