Skip to content

Commit aaa1872

Browse files
authored
Add XML documentation for all public members (#11)
1 parent e5670a5 commit aaa1872

10 files changed

+86
-10
lines changed

src/dbup-oracle/OracleCommandReader.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
using System;
1+
using System;
22
using System.Text;
33
using DbUp.Support;
44

55
namespace DbUp.Oracle
66
{
7+
/// <summary>
8+
/// Reads Oracle commands from an underlying text stream. Supports DELIMITER statements.
9+
/// </summary>
710
[Obsolete]
811
public class OracleCommandReader : SqlCommandReader
912
{
@@ -19,13 +22,15 @@ public class OracleCommandReader : SqlCommandReader
1922
/// <summary>
2023
/// Hook to support custom statements
2124
/// </summary>
25+
/// <inheritdoc/>
2226
protected override bool IsCustomStatement => TryPeek(DelimiterKeyword.Length, out var statement) &&
2327
string.Equals(DelimiterKeyword, statement, StringComparison.OrdinalIgnoreCase) &&
2428
string.IsNullOrEmpty(GetCurrentCommandTextFromBuffer());
2529

2630
/// <summary>
2731
/// Read a custom statement
2832
/// </summary>
33+
/// <inheritdoc/>
2934
protected override void ReadCustomStatement()
3035
{
3136
// Move past Delimiter keyword

src/dbup-oracle/OracleCommandSplitter.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,29 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using DbUp.Support;
44

55
namespace DbUp.Oracle
66
{
7+
/// <summary>
8+
/// Splits Oracle SQL scripts into individual commands using configurable delimiters.
9+
/// </summary>
710
public class OracleCommandSplitter
811
{
912
private readonly Func<string, SqlCommandReader> commandReaderFactory;
1013

14+
/// <summary>
15+
/// Initializes a new instance of the <see cref="OracleCommandSplitter"/> class using the default semicolon delimiter.
16+
/// </summary>
1117
[Obsolete]
1218
public OracleCommandSplitter()
1319
{
1420
this.commandReaderFactory = scriptContents => new OracleCommandReader(scriptContents);
1521
}
1622

23+
/// <summary>
24+
/// Initializes a new instance of the <see cref="OracleCommandSplitter"/> class using a custom delimiter.
25+
/// </summary>
26+
/// <param name="delimiter">The delimiter character to use for splitting commands.</param>
1727
public OracleCommandSplitter(char delimiter)
1828
{
1929
this.commandReaderFactory = scriptContents => new OracleCustomDelimiterCommandReader(scriptContents, delimiter);

src/dbup-oracle/OracleConnectionManager.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using DbUp.Engine.Transactions;
44
using Oracle.ManagedDataAccess.Client;
55

66
namespace DbUp.Oracle
77
{
8+
/// <summary>
9+
/// Manages Oracle database connections.
10+
/// </summary>
811
public class OracleConnectionManager : DatabaseConnectionManager
912
{
1013
private readonly OracleCommandSplitter commandSplitter;
@@ -31,6 +34,7 @@ public OracleConnectionManager(string connectionString, OracleCommandSplitter co
3134
this.commandSplitter = commandSplitter;
3235
}
3336

37+
/// <inheritdoc/>
3438
public override IEnumerable<string> SplitScriptIntoCommands(string scriptContents)
3539
{
3640
var scriptStatements = commandSplitter.SplitScriptIntoCommands(scriptContents);

src/dbup-oracle/OracleCustomDelimiterCommandReader.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
using System;
1+
using System;
22
using System.Text;
33
using DbUp.Support;
44

55
namespace DbUp.Oracle
66
{
7+
/// <summary>
8+
/// Reads Oracle commands from an underlying text stream using a custom delimiter. Supports DELIMITER statements.
9+
/// </summary>
710
public class OracleCustomDelimiterCommandReader : SqlCommandReader
811
{
912
const string DelimiterKeyword = "DELIMITER";
@@ -18,6 +21,7 @@ public OracleCustomDelimiterCommandReader(string sqlText, char delimiter) : base
1821
/// <summary>
1922
/// Hook to support custom statements
2023
/// </summary>
24+
/// <inheritdoc/>
2125
protected override bool IsCustomStatement
2226
=> TryPeek(DelimiterKeyword.Length - 1, out var statement) &&
2327
string.Equals(DelimiterKeyword, CurrentChar + statement, StringComparison.OrdinalIgnoreCase) &&
@@ -26,6 +30,7 @@ protected override bool IsCustomStatement
2630
/// <summary>
2731
/// Read a custom statement
2832
/// </summary>
33+
/// <inheritdoc/>
2934
protected override void ReadCustomStatement()
3035
{
3136
// Move past Delimiter keyword

src/dbup-oracle/OracleExtensions.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
using System;
1+
using System;
22
using System.Linq;
33
using DbUp.Builder;
44
using DbUp.Engine.Transactions;
55

66
namespace DbUp.Oracle
77
{
88
#pragma warning disable IDE0060 // Remove unused parameter - The "SupportedDatabases" parameter is never used.
9+
/// <summary>
10+
/// Configuration extension methods for Oracle.
11+
/// </summary>
912
public static class OracleExtensions
1013
{
1114
/// <summary>
@@ -81,6 +84,7 @@ public static UpgradeEngineBuilder OracleDatabase(this SupportedDatabases suppor
8184
/// </summary>
8285
/// <param name="supported">Fluent helper type.</param>
8386
/// <param name="connectionString">The connection string.</param>
87+
/// <param name="schema">Which Oracle schema to check for changes.</param>
8488
/// <param name="delimiter">Character to use as the delimiter between statements.</param>
8589
/// <returns>
8690
/// A builder for a database upgrader designed for Oracle databases.
@@ -111,6 +115,7 @@ public static UpgradeEngineBuilder OracleDatabase(this SupportedDatabases suppor
111115
/// <param name="supported">Fluent helper type.</param>
112116
/// <param name="connectionString">Oracle database connection string.</param>
113117
/// <param name="schema">Which Oracle schema to check for changes</param>
118+
/// <param name="delimiter">Character to use as the delimiter between statements.</param>
114119
/// <returns>
115120
/// A builder for a database upgrader designed for Oracle databases.
116121
/// </returns>

src/dbup-oracle/OracleObjectParser.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
using DbUp.Support;
1+
using DbUp.Support;
22

33
namespace DbUp.Oracle
44
{
5+
/// <summary>
6+
/// Parses Sql Objects and performs quoting functions.
7+
/// </summary>
58
public class OracleObjectParser : SqlObjectParser
69
{
10+
/// <summary>
11+
/// Initializes a new instance of the <see cref="OracleObjectParser"/> class.
12+
/// </summary>
713
public OracleObjectParser() : base("\"", "\"")
814
{
915
}
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
using DbUp.Engine;
1+
using DbUp.Engine;
22

33
namespace DbUp.Oracle
44
{
5+
/// <summary>
6+
/// This preprocessor makes adjustments to your sql to make it compatible with Oracle.
7+
/// </summary>
58
public class OraclePreprocessor : IScriptPreprocessor
69
{
10+
/// <inheritdoc/>
711
public string Process(string contents) => contents;
812
}
913
}

src/dbup-oracle/OracleScriptExecutor.cs

Lines changed: 6 additions & 1 deletion
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;
@@ -8,6 +8,9 @@
88

99
namespace DbUp.Oracle
1010
{
11+
/// <summary>
12+
/// An implementation of <see cref="ScriptExecutor"/> that executes against an Oracle database.
13+
/// </summary>
1114
public class OracleScriptExecutor : ScriptExecutor
1215
{
1316
/// <summary>
@@ -25,6 +28,7 @@ public OracleScriptExecutor(Func<IConnectionManager> connectionManagerFactory, F
2528
{
2629
}
2730

31+
/// <inheritdoc/>
2832
protected override string GetVerifySchemaSql(string schema)
2933
{
3034
throw new NotSupportedException();
@@ -39,6 +43,7 @@ public override void Execute(SqlScript script)
3943
Execute(script, null);
4044
}
4145

46+
/// <inheritdoc/>
4247
protected override void ExecuteCommandsWithinExceptionHandler(int index, SqlScript script, Action executeCommand)
4348
{
4449
try

src/dbup-oracle/OracleTableJournal.cs

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1-
using System;
1+
using System;
22
using System.Data;
33
using System.Globalization;
4+
using DbUp.Engine;
45
using DbUp.Engine.Output;
56
using DbUp.Engine.Transactions;
67
using DbUp.Support;
78

89
namespace DbUp.Oracle
910
{
11+
/// <summary>
12+
/// An implementation of the <see cref="IJournal"/> interface which tracks version numbers for an
13+
/// Oracle database using a table called SchemaVersions.
14+
/// </summary>
1015
public class OracleTableJournal : TableJournal
1116
{
1217
bool journalExists;
@@ -22,8 +27,12 @@ public OracleTableJournal(Func<IConnectionManager> connectionManager, Func<IUpgr
2227
{
2328
}
2429

30+
/// <summary>
31+
/// English culture info used for formatting.
32+
/// </summary>
2533
public static CultureInfo English = new CultureInfo("en-US", false);
2634

35+
/// <inheritdoc/>
2736
protected override string CreateSchemaTableSql(string quotedPrimaryKeyName)
2837
{
2938
var fqSchemaTableName = UnquotedSchemaTableName;
@@ -37,12 +46,20 @@ scriptname VARCHAR2(255) NOT NULL,
3746
)";
3847
}
3948

49+
/// <summary>
50+
/// Creates the SQL for the sequence used by the schema table.
51+
/// </summary>
52+
/// <returns>The SQL statement to create the sequence.</returns>
4053
protected string CreateSchemaTableSequenceSql()
4154
{
4255
var fqSchemaTableName = UnquotedSchemaTableName;
4356
return $@" CREATE SEQUENCE {fqSchemaTableName}_sequence";
4457
}
4558

59+
/// <summary>
60+
/// Creates the SQL for the trigger used by the schema table.
61+
/// </summary>
62+
/// <returns>The SQL statement to create the trigger.</returns>
4663
protected string CreateSchemaTableTriggerSql()
4764
{
4865
var fqSchemaTableName = UnquotedSchemaTableName;
@@ -57,24 +74,32 @@ FOR EACH ROW
5774
";
5875
}
5976

77+
/// <inheritdoc/>
6078
protected override string GetInsertJournalEntrySql(string scriptName, string applied)
6179
{
6280
var unquotedSchemaTableName = UnquotedSchemaTableName.ToUpper(English);
6381
return $"insert into {unquotedSchemaTableName} (ScriptName, Applied) values (:" + scriptName.Replace("@", "") + ",:" + applied.Replace("@", "") + ")";
6482
}
6583

84+
/// <inheritdoc/>
6685
protected override string GetJournalEntriesSql()
6786
{
6887
var unquotedSchemaTableName = UnquotedSchemaTableName.ToUpper(English);
6988
return $"select scriptname from {unquotedSchemaTableName} order by scriptname";
7089
}
7190

91+
/// <inheritdoc/>
7292
protected override string DoesTableExistSql()
7393
{
7494
var unquotedSchemaTableName = UnquotedSchemaTableName.ToUpper(English);
7595
return $"select 1 from user_tables where table_name = '{unquotedSchemaTableName}'";
7696
}
7797

98+
/// <summary>
99+
/// Gets the command to create the sequence for the schema table.
100+
/// </summary>
101+
/// <param name="dbCommandFactory">Factory to create database commands.</param>
102+
/// <returns>A command to create the sequence.</returns>
78103
protected IDbCommand GetCreateTableSequence(Func<IDbCommand> dbCommandFactory)
79104
{
80105
var command = dbCommandFactory();
@@ -83,6 +108,11 @@ protected IDbCommand GetCreateTableSequence(Func<IDbCommand> dbCommandFactory)
83108
return command;
84109
}
85110

111+
/// <summary>
112+
/// Gets the command to create the trigger for the schema table.
113+
/// </summary>
114+
/// <param name="dbCommandFactory">Factory to create database commands.</param>
115+
/// <returns>A command to create the trigger.</returns>
86116
protected IDbCommand GetCreateTableTrigger(Func<IDbCommand> dbCommandFactory)
87117
{
88118
var command = dbCommandFactory();
@@ -91,6 +121,7 @@ protected IDbCommand GetCreateTableTrigger(Func<IDbCommand> dbCommandFactory)
91121
return command;
92122
}
93123

124+
/// <inheritdoc/>
94125
public override void EnsureTableExistsAndIsLatestVersion(Func<IDbCommand> dbCommandFactory)
95126
{
96127
if (!journalExists && !DoesTableExist(dbCommandFactory))

src/dbup-oracle/dbup-oracle.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 Oracle support.</Description>
@@ -14,6 +14,7 @@
1414
<SignAssembly>true</SignAssembly>
1515
<RepositoryUrl>https://github.com/DbUp/dbup-oracle.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)