Skip to content

Commit

Permalink
feat: added default schema sql server db settings (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosgoias authored Aug 30, 2023
1 parent 8f38d9c commit 8166355
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
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

Check warning on line 3 in src/KafkaFlow.Retry.SqlServer/RetryDurableDefinitionBuilderExtension.cs

View workflow job for this annotation

GitHub Actions / release

Missing XML comment for publicly visible type or member 'RetryDurableDefinitionBuilderExtension'
{
private const string schemaDefault = "dbo";

public static RetryDurableDefinitionBuilder WithSqlServerDataProvider(

Check warning on line 5 in src/KafkaFlow.Retry.SqlServer/RetryDurableDefinitionBuilderExtension.cs

View workflow job for this annotation

GitHub Actions / release

Missing XML comment for publicly visible type or member 'RetryDurableDefinitionBuilderExtension.WithSqlServerDataProvider(RetryDurableDefinitionBuilder, string, string, string)'
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

0 comments on commit 8166355

Please sign in to comment.