Skip to content

Commit 2e60c18

Browse files
fixup! Support evaluation of DateTime.Now on db side
Add an option for failing or falling back in case of lack of dialect support
1 parent 49d364d commit 2e60c18

File tree

8 files changed

+495
-102
lines changed

8 files changed

+495
-102
lines changed

doc/reference/modules/configuration.xml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -734,14 +734,39 @@ var session = sessions.OpenSession(conn);
734734
<para>
735735
The new pre-evaluation allows them to be converted to HQL function calls which will be run on the db
736736
side. This allows by example to retrieve the server time instead of the client time, or to generate
737-
GUIDs for each row instead of an unique one for all rows. (This does not happen if the dialect does
738-
not support the required HQL function.)
737+
GUIDs for each row instead of an unique one for all rows.
739738
</para>
740739
<para>
741740
The new pre-evaluation will likely be enabled by default in the next major version (6.0).
742741
</para>
743742
</entry>
744743
</row>
744+
<row>
745+
<entry>
746+
<literal>linqtohql.fallback_on_preevaluation</literal>
747+
</entry>
748+
<entry>
749+
When the new pre-evaluation is enabled, should methods which translation is not supported by the current
750+
dialect fallback to pre-evaluation? Defaults to <literal>false</literal>.
751+
<para>
752+
<emphasis role="strong">eg.</emphasis>
753+
<literal>true</literal> | <literal>false</literal>
754+
</para>
755+
<para>
756+
When this fallback option is enabled while legacy pre-evaluation is disabled, properties or functions
757+
like <literal>DateTime.Now</literal> or <literal>Guid.NewGuid()</literal> used in Linq expressions
758+
will not fail when the dialect does not support them, but will instead be pre-evaluated.
759+
</para>
760+
<para>
761+
When this fallback option is disabled while legacy pre-evaluation is disabled, properties or functions
762+
like <literal>DateTime.Now</literal> or <literal>Guid.NewGuid()</literal> used in Linq expressions
763+
will fail when the dialect does not support them.
764+
</para>
765+
<para>
766+
This option has no effect if the legacy pre-evaluation is enabled.
767+
</para>
768+
</entry>
769+
</row>
745770
<row>
746771
<entry>
747772
<literal>sql_exception_converter</literal>

0 commit comments

Comments
 (0)