Skip to content

Commit

Permalink
change EnableCache default value
Browse files Browse the repository at this point in the history
  • Loading branch information
Nobuyuki Yoshimura committed May 6, 2019
1 parent 433f026 commit dcebc0e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 55 deletions.
56 changes: 1 addition & 55 deletions src/EasySqlParser/Configurations/ConfigContainer.cs
Expand Up @@ -26,33 +26,10 @@ static ConfigContainer()
/// </summary>
public static SqlParserConfig DefaultConfig { get; private set; }

private static bool? _enableCache;

/// <summary>
/// Gets or sets whether to cache sql nodes
/// </summary>
public static bool EnableCache
{
get
{
if (_enableCache.HasValue)
{
return _enableCache.Value;
}

return false;
}
set
{
if (_enableCache.HasValue)
{
//throw new InvalidSqlParserConfigException("Already enable cache set");
return;
}

_enableCache = value;
}
}
public static bool EnableCache { get; set; } = true;

// for unit test
internal static SqlParserConfig CreateConfigForTest(DbConnectionKind dbConnectionKind, string configName)
Expand Down Expand Up @@ -159,37 +136,6 @@ public static void AddDefault(DbConnectionKind dbConnectionKind, Func<IDbDataPar
return config;
}


///// <summary>
///// Register configuration.
///// If you use different connection implementation,call this method with name parameter.
///// </summary>
///// <param name="configCreator"></param>
///// <param name="name"></param>
//public static void RegisterConfig(Action<SqlParserConfig> configCreator, string name = null)
//{
// if (string.IsNullOrEmpty(name))
// {
// if (DefaultConfig != null)
// {
// //throw new InvalidSqlParserConfigException("Already default config registered");
// return;
// }
// var config = new SqlParserConfig();
// configCreator(config);
// DefaultConfig = config;
// return;
// }

// if (ConfigsFoo.ContainsKey(name))
// {
// //throw new InvalidSqlParserConfigException("Already additional config registered");
// return;
// }
// var additionalConfig = new SqlParserConfig();
// configCreator(additionalConfig);
// ConfigsFoo.Add(name, additionalConfig);
//}
}

}
3 changes: 3 additions & 0 deletions src/EasySqlParser/EasySqlParser.csproj
Expand Up @@ -13,6 +13,9 @@
<PackageTags>dotnet-standard;sql;sql-parser;parse</PackageTags>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<AssemblyVersion>1.1.0.0</AssemblyVersion>
<FileVersion>1.1.0.0</FileVersion>
<Version>1.1.0</Version>
</PropertyGroup>

</Project>

0 comments on commit dcebc0e

Please sign in to comment.