Skip to content

Commit 9018714

Browse files
authored
Add XML documentation for all public members (#36)
1 parent 43552b1 commit 9018714

File tree

5 files changed

+50
-12
lines changed

5 files changed

+50
-12
lines changed

src/dbup-postgresql/PostgresqlExtensions.cs

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Data;
33
using System.Security.Cryptography.X509Certificates;
44
using System.Text.RegularExpressions;
@@ -165,6 +165,13 @@ public static void PostgresqlDatabase(this SupportedDatabasesForEnsureDatabase s
165165
PostgresqlDatabase(supported, connectionString, logger, new PostgresqlConnectionOptions());
166166
}
167167

168+
/// <summary>
169+
/// Ensures that the database specified in the connection string exists using SSL for the connection.
170+
/// </summary>
171+
/// <param name="supported">Fluent helper type.</param>
172+
/// <param name="connectionString">The connection string.</param>
173+
/// <param name="logger">The <see cref="DbUp.Engine.Output.IUpgradeLog"/> used to record actions.</param>
174+
/// <param name="certificate">Certificate for securing connection.</param>
168175
public static void PostgresqlDatabase(this SupportedDatabasesForEnsureDatabase supported, string connectionString, IUpgradeLog logger, X509Certificate2 certificate)
169176
{
170177
var options = new PostgresqlConnectionOptions
@@ -174,6 +181,13 @@ public static void PostgresqlDatabase(this SupportedDatabasesForEnsureDatabase s
174181
PostgresqlDatabase(supported, connectionString, logger, options);
175182
}
176183

184+
/// <summary>
185+
/// Ensures that the database specified in the connection string exists using SSL for the connection.
186+
/// </summary>
187+
/// <param name="supported">Fluent helper type.</param>
188+
/// <param name="connectionString">The connection string.</param>
189+
/// <param name="logger">The <see cref="DbUp.Engine.Output.IUpgradeLog"/> used to record actions.</param>
190+
/// <param name="connectionOptions">Connection options to set SSL parameters</param>
177191
public static void PostgresqlDatabase(
178192
this SupportedDatabasesForEnsureDatabase supported,
179193
string connectionString,
@@ -292,6 +306,13 @@ public static void PostgresqlDatabase(this SupportedDatabasesForDropDatabase sup
292306
PostgresqlDatabase(supported, connectionString, logger, new PostgresqlConnectionOptions());
293307
}
294308

309+
/// <summary>
310+
/// Drops the database specified in the connection string if it exists using SSL for the connection.
311+
/// </summary>
312+
/// <param name="supported">Fluent helper type.</param>
313+
/// <param name="connectionString">The connection string.</param>
314+
/// <param name="logger">The <see cref="DbUp.Engine.Output.IUpgradeLog"/> used to record actions.</param>
315+
/// <param name="certificate">Certificate for securing connection.</param>
295316
public static void PostgresqlDatabase(this SupportedDatabasesForDropDatabase supported, string connectionString, IUpgradeLog logger, X509Certificate2 certificate)
296317
{
297318
var options = new PostgresqlConnectionOptions
@@ -301,6 +322,13 @@ public static void PostgresqlDatabase(this SupportedDatabasesForDropDatabase sup
301322
PostgresqlDatabase(supported, connectionString, logger, options);
302323
}
303324

325+
/// <summary>
326+
/// Drops the database specified in the connection string if it exists using SSL for the connection.
327+
/// </summary>
328+
/// <param name="supported">Fluent helper type.</param>
329+
/// <param name="connectionString">The connection string.</param>
330+
/// <param name="logger">The <see cref="DbUp.Engine.Output.IUpgradeLog"/> used to record actions.</param>
331+
/// <param name="connectionOptions">Connection options to set SSL parameters</param>
304332
public static void PostgresqlDatabase(
305333
this SupportedDatabasesForDropDatabase supported,
306334
string connectionString,
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
using DbUp.Support;
1+
using DbUp.Support;
22

33
namespace DbUp.Postgresql;
44

55
/// <summary>
66
/// Parses Sql Objects and performs quoting functions.
77
/// </summary>
8+
/// <remarks>
9+
/// Initializes a new instance of the <see cref="PostgresqlObjectParser"/> class.
10+
/// </remarks>
811
public class PostgresqlObjectParser() : SqlObjectParser("\"", "\"");

src/dbup-postgresql/PostgresqlScriptExecutor.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using DbUp.Engine;
44
using DbUp.Engine.Output;
@@ -25,12 +25,14 @@ public class PostgresqlScriptExecutor : ScriptExecutor
2525
public PostgresqlScriptExecutor(Func<IConnectionManager> connectionManagerFactory, Func<IUpgradeLog> log, string schema, Func<bool> variablesEnabled,
2626
IEnumerable<IScriptPreprocessor> scriptPreprocessors, Func<IJournal> journalFactory)
2727
: base(connectionManagerFactory, new PostgresqlObjectParser(), log, schema, variablesEnabled, scriptPreprocessors, journalFactory)
28-
{
29-
}
28+
{
29+
}
3030

31-
protected override string GetVerifySchemaSql(string schema) => $"CREATE SCHEMA IF NOT EXISTS {schema}";
31+
/// <inheritdoc/>
32+
protected override string GetVerifySchemaSql(string schema) => $"CREATE SCHEMA IF NOT EXISTS {schema}";
3233

33-
protected override void ExecuteCommandsWithinExceptionHandler(int index, SqlScript script, Action executeCommand)
34+
/// <inheritdoc/>
35+
protected override void ExecuteCommandsWithinExceptionHandler(int index, SqlScript script, Action executeCommand)
3436
{
3537
try
3638
{

src/dbup-postgresql/PostgresqlTableJournal.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Data;
33
using DbUp.Engine;
44
using DbUp.Engine.Output;
@@ -22,10 +22,11 @@ public class PostgresqlTableJournal : TableJournal
2222
/// <param name="tableName">The name of the journal table.</param>
2323
public PostgresqlTableJournal(Func<IConnectionManager> connectionManager, Func<IUpgradeLog> logger, string schema, string tableName)
2424
: base(connectionManager, logger, new PostgresqlObjectParser(), schema, tableName)
25-
{
26-
}
25+
{
26+
}
2727

28-
protected override IDbCommand GetInsertScriptCommand(Func<IDbCommand> dbCommandFactory, SqlScript script)
28+
/// <inheritdoc/>
29+
protected override IDbCommand GetInsertScriptCommand(Func<IDbCommand> dbCommandFactory, SqlScript script)
2930
{
3031
// EnableSqlRewriting is enabled by default, and needs to be explicitly disabled
3132
bool enableSqlRewriting = !AppContext.TryGetSwitch("Npgsql.EnableSqlRewriting", out bool enabled) || enabled;
@@ -49,16 +50,19 @@ protected override IDbCommand GetInsertScriptCommand(Func<IDbCommand> dbCommandF
4950
return command;
5051
}
5152

53+
/// <inheritdoc/>
5254
protected override string GetInsertJournalEntrySql(string scriptName, string applied)
5355
{
5456
return $"insert into {FqSchemaTableName} (ScriptName, Applied) values ({scriptName}, {applied})";
5557
}
5658

59+
/// <inheritdoc/>
5760
protected override string GetJournalEntriesSql()
5861
{
5962
return $"select ScriptName from {FqSchemaTableName} order by ScriptName";
6063
}
6164

65+
/// <inheritdoc/>
6266
protected override string CreateSchemaTableSql(string quotedPrimaryKeyName)
6367
{
6468
return

src/dbup-postgresql/dbup-postgresql.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<Description>DbUp makes it easy to deploy and upgrade SQL Server databases. This package adds PostgreSQL support.</Description>
@@ -14,6 +14,7 @@
1414
<SignAssembly>true</SignAssembly>
1515
<RepositoryUrl>https://github.com/DbUp/dbup-postgresql.git</RepositoryUrl>
1616
<PackageIcon>dbup-icon.png</PackageIcon>
17+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1718
</PropertyGroup>
1819

1920
<PropertyGroup Condition="'$(CI)' == 'true'">

0 commit comments

Comments
 (0)