Skip to content

Commit 3ceefa1

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 b57c46f commit 3ceefa1

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

0 commit comments

Comments
 (0)