Skip to content

Commit

Permalink
update Sql Server client library and minor code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
gdivis committed Apr 7, 2021
1 parent 4155040 commit 865942f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion inedosql/EmbeddedScripts.cs
Expand Up @@ -7,7 +7,7 @@ namespace Inedo.DbUpdater
{
internal static class EmbeddedScripts
{
private static readonly Lazy<IReadOnlyCollection<Script>> scriptsIfAvailable = new Lazy<IReadOnlyCollection<Script>>(ReadScripts);
private static readonly Lazy<IReadOnlyCollection<Script>> scriptsIfAvailable = new(ReadScripts);

public static IReadOnlyCollection<Script> All => scriptsIfAvailable.Value;
public static bool Available => scriptsIfAvailable.Value != null;
Expand Down
2 changes: 1 addition & 1 deletion inedosql/Script.cs
Expand Up @@ -10,7 +10,7 @@ namespace Inedo.DbUpdater
{
internal sealed class Script : IComparable<Script>, IEquatable<Script>
{
private static readonly Regex ScriptIdRegex = new Regex(@"^--\s*AH:(?<1>.+)\n", RegexOptions.Compiled | RegexOptions.ExplicitCapture);
private static readonly Regex ScriptIdRegex = new(@"^--\s*AH:(?<1>.+)\n", RegexOptions.Compiled | RegexOptions.ExplicitCapture);

public Script(string fileName, string scriptText)
{
Expand Down
14 changes: 7 additions & 7 deletions inedosql/SqlServer/Scripts.cs
Expand Up @@ -6,13 +6,13 @@ namespace Inedo.DbUpdater.SqlServer
{
internal static class Scripts
{
private static readonly Lazy<string> initialize = new Lazy<string>(() => Read("Initialize.sql"));
private static readonly Lazy<string> recordExecution = new Lazy<string>(() => Read("RecordExecution.sql"));
private static readonly Lazy<string> updateExecution = new Lazy<string>(() => Read("UpdateExecution.sql"));
private static readonly Lazy<string> readV1Scripts = new Lazy<string>(() => Read("ReadV1Scripts.sql"));
private static readonly Lazy<string> migrateV2toV3 = new Lazy<string>(() => Read("MigrateV2toV3.sql"));
private static readonly Lazy<string> resolveError = new Lazy<string>(() => Read("ResolveError.sql"));
private static readonly Lazy<string> resolveAllErrors = new Lazy<string>(() => Read("ResolveAllErrors.sql"));
private static readonly Lazy<string> initialize = new(() => Read("Initialize.sql"));
private static readonly Lazy<string> recordExecution = new(() => Read("RecordExecution.sql"));
private static readonly Lazy<string> updateExecution = new(() => Read("UpdateExecution.sql"));
private static readonly Lazy<string> readV1Scripts = new(() => Read("ReadV1Scripts.sql"));
private static readonly Lazy<string> migrateV2toV3 = new(() => Read("MigrateV2toV3.sql"));
private static readonly Lazy<string> resolveError = new(() => Read("ResolveError.sql"));
private static readonly Lazy<string> resolveAllErrors = new(() => Read("ResolveAllErrors.sql"));

public static string Initialize => initialize.Value;
public static string RecordExecution => recordExecution.Value;
Expand Down
2 changes: 1 addition & 1 deletion inedosql/SqlServer/SqlSplitter.cs
Expand Up @@ -5,7 +5,7 @@ namespace Inedo.DbUpdater.SqlServer
{
internal static class SqlSplitter
{
private static readonly Regex GoRegex = new Regex(@"^\s*GO\s*$", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
private static readonly Regex GoRegex = new(@"^\s*GO\s*$", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);

/// <summary>
/// Returns a collection of the SQL scripts in a string separated by canonical GO statements.
Expand Down
2 changes: 1 addition & 1 deletion inedosql/inedosql.csproj
Expand Up @@ -11,7 +11,7 @@
<Reference Include="System.IO.Compression" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework)=='net5.0'">
<PackageReference Include="Microsoft.Data.SqlClient" Version="2.1.1" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="2.1.2" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="SqlServer\Scripts\*.sql" />
Expand Down

0 comments on commit 865942f

Please sign in to comment.