Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added default schema sql server db settings #138

Merged
merged 5 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public async Task<IList<RetryQueueItemMessageDbo>> GetMessagesOrderedAsync(IDbCo
entriesToLoad.Columns.Add("Id", typeof(int));
foreach (var retryQueueItemDbo in retryQueueItemsDbo)
{
System.Data.DataRow dr = entriesToLoad.NewRow();
var dr = entriesToLoad.NewRow();
dr["Id"] = retryQueueItemDbo.Id;
entriesToLoad.Rows.Add(dr);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
{
public static class RetryDurableDefinitionBuilderExtension
{
private const string schemaDefault = "dbo";

public static RetryDurableDefinitionBuilder WithSqlServerDataProvider(
this RetryDurableDefinitionBuilder retryDurableDefinitionBuilder,
string connectionString,
Expand Down Expand Up @@ -33,8 +31,7 @@ public static RetryDurableDefinitionBuilder WithSqlServerDataProvider(
.Create(
new SqlServerDbSettings(
connectionString,
databaseName,
schemaDefault)
databaseName)
)
);

Expand Down
20 changes: 19 additions & 1 deletion src/KafkaFlow.Retry.SqlServer/SqlServerDbSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
[ExcludeFromCodeCoverage]
public class SqlServerDbSettings
{
private const string schemaDefault = "dbo";

/// <summary>
/// Creates a Sql Server database settings
/// Creates a Sql Server database settings with schema
/// </summary>
/// <param name="connectionString">The connection string of the Sql Server.</param>
/// <param name="databaseName">The database name.</param>
Expand All @@ -27,6 +29,22 @@ public SqlServerDbSettings(string connectionString, string databaseName, string
Schema = schema;
}

/// <summary>
/// Creates a Sql Server database settings
/// </summary>
/// <param name="connectionString">The connection string of the Sql Server.</param>
/// <param name="databaseName">The database name.</param>

public SqlServerDbSettings(string connectionString, string databaseName)
{
Guard.Argument(connectionString).NotNull().NotEmpty();
Guard.Argument(databaseName).NotNull().NotEmpty();

ConnectionString = connectionString;
DatabaseName = databaseName;
Schema = schemaDefault;
}

/// <summary>
/// Gets the connection string of the Sql Server database.
/// </summary>
Expand Down
Loading