in MySQL.Data/src/MySqlConnectionStringBuilder.cs [44:245]
static MySqlConnectionStringBuilder()
{
// Add options shared between classic and X protocols from base class.
Options = MySqlBaseConnectionStringBuilder.Options.Clone();
#region ServerOptions
Options.Add(new MySqlConnectionStringOption("pipe", "pipe name,pipename", typeof(string), "MYSQL", false,
(msb, sender, value) =>
{
if (!Platform.IsWindows())
throw new PlatformNotSupportedException(string.Format(Resources.OptionNotCurrentlySupported, nameof(PipeName)));
else
msb.SetValue("pipe", value);
},
(msb, sender) => msb.PipeName));
Options.Add(new MySqlConnectionStringOption("compress", "use compression,usecompression", typeof(bool), false, false,
(msb, sender, value) => { msb.SetValue("compress", value); }, (msb, sender) => msb.UseCompression));
Options.Add(new MySqlConnectionStringOption("allowbatch", "allow batch", typeof(bool), true, false,
(msb, sender, value) => { msb.SetValue("allowbatch", value); }, (msb, sender) => msb.AllowBatch));
Options.Add(new MySqlConnectionStringOption("logging", null, typeof(bool), false, false,
(msb, sender, value) =>
{
msb.SetValue("logging", value);
},
(msb, sender) => msb.Logging));
Options.Add(new MySqlConnectionStringOption("sharedmemoryname", "shared memory name", typeof(string), "MYSQL", false,
(msb, sender, value) =>
{
if (!Platform.IsWindows())
throw new PlatformNotSupportedException(string.Format(Resources.OptionNotCurrentlySupported, nameof(SharedMemoryName)));
else
msb.SetValue("sharedmemoryname", value);
},
(msb, sender) => msb.SharedMemoryName));
Options.Add(new MySqlConnectionStringOption("defaultcommandtimeout", "command timeout,default command timeout", typeof(uint), (uint)30, false,
(msb, sender, value) => { msb.SetValue("defaultcommandtimeout", value); }, (msb, sender) => msb.DefaultCommandTimeout));
Options.Add(new MySqlConnectionStringOption("usedefaultcommandtimeoutforef", "use default command timeout for ef", typeof(bool), false, false,
(msb, sender, value) => { msb.SetValue("usedefaultcommandtimeoutforef", value); }, (msb, sender) => msb.UseDefaultCommandTimeoutForEF));
Options.Add(new MySqlConnectionStringOption("connectiontimeout", "connection timeout,connect timeout", typeof(uint), (uint)15, false,
delegate (MySqlConnectionStringBuilder msb, MySqlConnectionStringOption sender, object Value)
{
uint value = (uint)Convert.ChangeType(Value, sender.BaseType);
// Timeout in milliseconds should not exceed maximum for 32 bit
// signed integer (~24 days). We truncate the value if it exceeds
// maximum (MySqlCommand.CommandTimeout uses the same technique
uint timeout = Math.Min(value, Int32.MaxValue / 1000);
if (timeout != value)
{
MySqlTrace.LogWarning(-1, "Connection timeout value too large ("
+ value + " seconds). Changed to max. possible value" +
+timeout + " seconds)");
}
msb.SetValue("connectiontimeout", timeout);
},
(msb, sender) => (uint)msb.values["connectiontimeout"]
));
Options.Add(new MySqlConnectionStringOption("allowloadlocalinfile", "allow load local infile", typeof(bool), false, false));
Options.Add(new MySqlConnectionStringOption("allowloadlocalinfileinpath", "allow load local infile in path", typeof(string), string.Empty, false));
#endregion
#region AuthenticationOptions
Options.Add(new MySqlConnectionStringOption("persistsecurityinfo", "persist security info", typeof(bool), false, false,
(msb, sender, value) => { msb.SetValue("persistsecurityinfo", value); }, (msb, sender) => msb.PersistSecurityInfo));
Options.Add(new MySqlConnectionStringOption("integratedsecurity", "integrated security", typeof(bool), false, false,
delegate (MySqlConnectionStringBuilder msb, MySqlConnectionStringOption sender, object value)
{
if (!Platform.IsWindows())
throw new MySqlException("IntegratedSecurity is supported on Windows only");
#if !NETFRAMEWORK
throw new PlatformNotSupportedException(string.Format(Resources.OptionNotCurrentlySupported, nameof(IntegratedSecurity)));
#else
msb.SetValue("Integrated Security", value.ToString().Equals("SSPI", StringComparison.OrdinalIgnoreCase) ? true : value);
#endif
},
delegate (MySqlConnectionStringBuilder msb, MySqlConnectionStringOption sender)
{
object val = msb.values["integratedsecurity"];
return (bool)val;
}
));
Options.Add(new MySqlConnectionStringOption("allowpublickeyretrieval", null, typeof(bool), false, false,
(msb, sender, value) => { msb.SetValue("allowpublickeyretrieval", value); }, (msb, sender) => msb.AllowPublicKeyRetrieval));
Options.Add(new MySqlConnectionStringOption("defaultauthenticationplugin", null, typeof(string), string.Empty, false,
(msb, sender, value) =>
{
if (!string.IsNullOrWhiteSpace((string)value)) AuthenticationPluginManager.ValidateAuthenticationPlugin((string)value);
msb.SetValue("defaultauthenticationplugin", value);
},
(msb, sender) => msb.DefaultAuthenticationPlugin));
Options.Add(new MySqlConnectionStringOption("ociconfigfile", "oci config file", typeof(string), string.Empty, false));
Options.Add(new MySqlConnectionStringOption("ociconfigprofile", "oci config profile", typeof(string), "DEFAULT", false));
Options.Add(new MySqlConnectionStringOption("kerberosauthmode", "kerberos auth mode", typeof(KerberosAuthMode), Platform.IsWindows() ? KerberosAuthMode.AUTO : KerberosAuthMode.GSSAPI, false,
(msb, sender, value) =>
{
if (!Platform.IsWindows())
throw new PlatformNotSupportedException(string.Format(Resources.OptionNotCurrentlySupported, nameof(KerberosAuthMode)));
else
msb.SetValue("kerberosauthmode", value);
},
(msb, sender) => msb.KerberosAuthMode));
Options.Add(new MySqlConnectionStringOption("openididentitytoken", null, typeof(string), string.Empty, false));
#endregion
#region OtherProperties
Options.Add(new MySqlConnectionStringOption("autoenlist", "auto enlist", typeof(bool), true, false,
(msb, sender, value) => { msb.SetValue("autoenlist", value); }, (msb, sender) => msb.AutoEnlist));
Options.Add(new MySqlConnectionStringOption("includesecurityasserts", "include security asserts", typeof(bool), false, false,
(msb, sender, value) => { msb.SetValue("includesecurityasserts", value); }, (msb, sender) => msb.IncludeSecurityAsserts));
Options.Add(new MySqlConnectionStringOption("allowzerodatetime", "allow zero datetime", typeof(bool), false, false,
(msb, sender, value) => { msb.SetValue("allowzerodatetime", value); }, (msb, sender) => msb.AllowZeroDateTime));
Options.Add(new MySqlConnectionStringOption("convertzerodatetime", "convert zero datetime", typeof(bool), false, false,
(msb, sender, value) => { msb.SetValue("convertzerodatetime", value); }, (msb, sender) => msb.ConvertZeroDateTime));
Options.Add(new MySqlConnectionStringOption("useusageadvisor", "use usage advisor,usage advisor", typeof(bool), false, false,
(msb, sender, value) =>
{
msb.SetValue("useusageadvisor", value);
},
(msb, sender) => msb.UseUsageAdvisor));
Options.Add(new MySqlConnectionStringOption("procedurecachesize", "procedure cache size,procedure cache,procedurecache", typeof(uint), (uint)25, false,
(msb, sender, value) => { msb.SetValue("procedurecachesize", value); }, (msb, sender) => msb.ProcedureCacheSize));
Options.Add(new MySqlConnectionStringOption("useperformancemonitor", "use performance monitor,useperfmon,perfmon", typeof(bool), false, false,
(msb, sender, value) =>
{
#if !NETFRAMEWORK
throw new PlatformNotSupportedException(string.Format(Resources.OptionNotCurrentlySupported, nameof(UsePerformanceMonitor)));
#else
msb.SetValue("useperformancemonitor", value);
#endif
},
(msb, sender) => msb.UsePerformanceMonitor));
Options.Add(new MySqlConnectionStringOption("respectbinaryflags", "respect binary flags", typeof(bool), true, false,
(msb, sender, value) => { msb.SetValue("respectbinaryflags", value); }, (msb, sender) => msb.RespectBinaryFlags));
Options.Add(new MySqlConnectionStringOption("treattinyasboolean", "treat tiny as boolean", typeof(bool), true, false,
(msb, sender, value) => { msb.SetValue("treattinyasboolean", value); }, (msb, sender) => msb.TreatTinyAsBoolean));
Options.Add(new MySqlConnectionStringOption("allowuservariables", "allow user variables", typeof(bool), false, false,
(msb, sender, value) => { msb.SetValue("allowuservariables", value); }, (msb, sender) => msb.AllowUserVariables));
Options.Add(new MySqlConnectionStringOption("interactivesession", "interactive session,interactive", typeof(bool), false, false,
(msb, sender, value) =>
{
msb.SetValue("interactivesession", value);
},
(msb, sender) => msb.InteractiveSession));
Options.Add(new MySqlConnectionStringOption("functionsreturnstring", "functions return string", typeof(bool), false, false,
(msb, sender, value) => { msb.SetValue("functionsreturnstring", value); }, (msb, sender) => msb.FunctionsReturnString));
Options.Add(new MySqlConnectionStringOption("useaffectedrows", "use affected rows", typeof(bool), false, false,
(msb, sender, value) => { msb.SetValue("useaffectedrows", value); }, (msb, sender) => msb.UseAffectedRows));
Options.Add(new MySqlConnectionStringOption("oldguids", "old guids", typeof(bool), false, false,
(msb, sender, value) => { msb.SetValue("oldguids", value); }, (msb, sender) => msb.OldGuids));
Options.Add(new MySqlConnectionStringOption("sqlservermode", "sql server mode", typeof(bool), false, false,
(msb, sender, value) => { msb.SetValue("sqlservermode", value); }, (msb, sender) => msb.SqlServerMode));
Options.Add(new MySqlConnectionStringOption("tablecaching", "table cache,tablecache", typeof(bool), false, false,
(msb, sender, value) => { msb.SetValue("tablecaching", value); }, (msb, sender) => msb.TableCaching));
Options.Add(new MySqlConnectionStringOption("defaulttablecacheage", "default table cache age", typeof(int), (int)60, false,
(msb, sender, value) => { msb.SetValue("defaulttablecacheage", value); }, (msb, sender) => msb.DefaultTableCacheAge));
Options.Add(new MySqlConnectionStringOption("checkparameters", "check parameters", typeof(bool), true, false,
(msb, sender, value) => { msb.SetValue("checkparameters", value); }, (msb, sender) => msb.CheckParameters));
Options.Add(new MySqlConnectionStringOption("replication", null, typeof(bool), false, false,
(msb, sender, value) =>
{
msb.SetValue("replication", value);
},
(msb, sender) => msb.Replication));
Options.Add(new MySqlConnectionStringOption("exceptioninterceptors", "exception interceptors", typeof(string), null, false,
(msb, sender, value) => { msb.SetValue("exceptioninterceptors", value); }, (msb, sender) => msb.ExceptionInterceptors));
Options.Add(new MySqlConnectionStringOption("commandinterceptors", "command interceptors", typeof(string), null, false,
(msb, sender, value) => { msb.SetValue("commandinterceptors", value); }, (msb, sender) => msb.CommandInterceptors));
Options.Add(new MySqlConnectionStringOption("rewritebatchedstatements", null, typeof(bool), false, false));
#endregion
#region PoolingOptions
Options.Add(new MySqlConnectionStringOption("connectionlifetime", "connection lifetime", typeof(uint), (uint)0, false,
(msb, sender, value) => { msb.SetValue("connectionlifetime", value); }, (msb, sender) => msb.ConnectionLifeTime));
Options.Add(new MySqlConnectionStringOption("pooling", null, typeof(bool), true, false,
(msb, sender, value) => { msb.SetValue("pooling", value); }, (msb, sender) => msb.Pooling));
Options.Add(new MySqlConnectionStringOption("minpoolsize", "minimumpoolsize,min pool size,minimum pool size", typeof(uint), (uint)0, false,
(msb, sender, value) => { msb.SetValue("minpoolsize", value); }, (msb, sender) => msb.MinimumPoolSize));
Options.Add(new MySqlConnectionStringOption("maxpoolsize", "maximumpoolsize,max pool size,maximum pool size", typeof(uint), (uint)100, false,
(msb, sender, value) => { msb.SetValue("maxpoolsize", value); }, (msb, sender) => msb.MaximumPoolSize));
Options.Add(new MySqlConnectionStringOption("connectionreset", "connection reset", typeof(bool), false, false,
(msb, sender, value) => { msb.SetValue("connectionreset", value); }, (msb, sender) => msb.ConnectionReset));
Options.Add(new MySqlConnectionStringOption("cacheserverproperties", "cache server properties", typeof(bool), false, false,
(msb, sender, value) => { msb.SetValue("cacheserverproperties", value); }, (msb, sender) => msb.CacheServerProperties));
#endregion
#region LanguageCharsetOptions
Options.Add(new MySqlConnectionStringOption("treatblobsasutf8", "treat blobs as utf8", typeof(bool), false, false,
(msb, sender, value) => { msb.SetValue("treatblobsasutf8", value); }, (msb, sender) => msb.TreatBlobsAsUTF8));
Options.Add(new MySqlConnectionStringOption("blobasutf8includepattern", null, typeof(string), "", false,
(msb, sender, value) => { msb.SetValue("blobasutf8includepattern", value); }, (msb, sender) => msb.BlobAsUTF8IncludePattern));
Options.Add(new MySqlConnectionStringOption("blobasutf8excludepattern", null, typeof(string), "", false,
(msb, sender, value) => { msb.SetValue("blobasutf8excludepattern", value); }, (msb, sender) => msb.BlobAsUTF8ExcludePattern));
#endregion
}