-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration Options
For a general sample how to call UseSingleStore(), see Services Configuration.
Provide a connection string for the database you want to connect to.
We use SingleStoreConnector underneath for all communication between SingleStore.EntityFrameworkCore and SingleStoreDB. For a complete list of all connection string options, see SingleStoreConnector Connection String Options.
The following settings can be used on demand, by calling their respective extension method in the UseSingleStore() call.
Configures the context to use the default retrying IExecutionStrategy.
Configures string escaping in SQL query generation to ignore backslashes, and assumes that sql_mode has been set to NO_BACKSLASH_ESCAPES. This applies to both constant and parameter values (i. e. user input, potentially).
When true, implicitly executes a SET SESSION sql_mode statement after opening a connection to the database server, adding the modes enabled by other options. When false, the sql_mode is not being set by the provider and has to be manually handled by the caller, to synchronize it with other options that have been set.
Skip replacing \r and \n with CHAR() calls in strings inside queries.
Configures default mappings between specific CLR and SingleStoreDB types.
- WithClrBoolean
- Default (same as
TinyInt1) - TinyInt1
- Bit1
- Default (same as
- WithClrDateTime and WithClrDateTimeOffset
- Default (highest
DATETIMEprecision supported by the current database server) - DateTime
- DateTime6
- Timestamp
- Timestamp6
- Default (highest
- WithClrTimeSpan
- Default (highest
TIMEprecision supported by the current database server) - Time
- Time6
- Default (highest
Configures the behavior for cases when a schema has been set for an entity. Because SingleStoreDB does not support the EF Core concept of schemas, the default is to throw an exception.
Configures the context to optimize System.Boolean mapped columns for index usage, by translating e.BoolColumn to BoolColumn = TRUE and !e.BoolColumn to BoolColumn = FALSE.
Configures the context to automatically limit the length of System.String mapped columns, that have not explicitly mapped to a store type (e.g. varchar(1024)), to ensure that at least two indexed columns will be allowed on a given table (this is the default if you don't configure this option). If you intend to use HasPrefixLength() for those kind of columns, set this option to false.
Configures the context to translate string related methods, containing a parameter of type StringComparison, to their SQL equivalent, even though SingleStoreDB might not be able to use indexes when executing the query, resulting in decreased performance. Whether SingleStoreDB is able to use indexes for the query, depends on the StringComparison option, the underlying collation and the scenario. It is also possible to just use EF.Functions.Collate(), possibly in addition to string.ToUpper() if needed, to achieve the same result but with full control over the SQL generation.