Skip to content

Commit b1fce2c

Browse files
authored
Merge pull request #17 from DbUp/xml-doc
Add XML documentation for all public members
2 parents 66e5224 + ec09794 commit b1fce2c

File tree

10 files changed

+47
-15
lines changed

10 files changed

+47
-15
lines changed

src/Sample/Program.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ public static class Program
77
{
88
static void Main()
99
{
10-
InMemoryDb();
11-
TemporaryFileDb();
10+
//InMemoryDb();
11+
//TemporaryFileDb();
1212
PermanentFileDb();
1313
}
1414

@@ -56,7 +56,7 @@ static void TemporaryFileDb()
5656

5757
static void PermanentFileDb()
5858
{
59-
SqliteConnection connection = new("Data Source=dbup.db");
59+
SqliteConnection connection = new("Data Source=dbup.db;");
6060

6161
using (var database = new DbUp.Sqlite.Helpers.SharedConnection(connection))
6262
{

src/dbup-sqlite/Helpers/InMemorySqliteDatabase.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using DbUp.Engine.Transactions;
33
using DbUp.Helpers;
44
using Microsoft.Data.Sqlite;
@@ -33,6 +33,9 @@ public InMemorySqliteDatabase()
3333
SqlRunner = new AdHocSqlRunner(() => sharedConnection.CreateCommand(), new SqliteObjectParser(), null, () => true);
3434
}
3535

36+
/// <summary>
37+
/// Gets or sets the connection string for the in-memory database.
38+
/// </summary>
3639
public string ConnectionString { get; set; }
3740

3841
/// <summary>

src/dbup-sqlite/Helpers/SharedConnection.cs

Lines changed: 15 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

44
namespace DbUp.Sqlite.Helpers
@@ -30,36 +30,50 @@ public SharedConnection(IDbConnection dbConnection)
3030
connection.Open();
3131
}
3232

33+
/// <inheritdoc/>
3334
public IDbTransaction BeginTransaction(IsolationLevel il) => connection.BeginTransaction(il);
3435

36+
/// <inheritdoc/>
3537
public IDbTransaction BeginTransaction() => connection.BeginTransaction();
3638

39+
/// <inheritdoc/>
3740
public void ChangeDatabase(string databaseName) => connection.ChangeDatabase(databaseName);
3841

42+
/// <inheritdoc/>
3943
public void Close() { } // shared underlying connection is not closed
4044

45+
/// <inheritdoc/>
4146
public string ConnectionString
4247
{
4348
get => connection.ConnectionString;
4449
set => connection.ConnectionString = value;
4550
}
4651

52+
/// <inheritdoc/>
4753
public int ConnectionTimeout => connection.ConnectionTimeout;
4854

55+
/// <inheritdoc/>
4956
public IDbCommand CreateCommand() => connection.CreateCommand();
5057

58+
/// <inheritdoc/>
5159
public string Database => connection.Database;
5260

61+
/// <inheritdoc/>
5362
public void Open()
5463
{
5564
if (connection.State == ConnectionState.Closed)
5665
connection.Open();
5766
}
5867

68+
/// <inheritdoc/>
5969
public ConnectionState State => connection.State;
6070

71+
/// <inheritdoc/>
6172
public void Dispose() { } // shared underlying connection is not disposed
6273

74+
/// <summary>
75+
/// Closes the connection if it was opened by this wrapper.
76+
/// </summary>
6377
public void DoClose()
6478
{
6579
// if shared underlying connection is opened by this object

src/dbup-sqlite/Helpers/TemporarySqliteDatabase.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.IO;
33
using DbUp.Helpers;
44
using Microsoft.Data.Sqlite;
@@ -39,6 +39,9 @@ public TemporarySqliteDatabase(string name)
3939
/// </summary>
4040
public AdHocSqlRunner SqlRunner { get; }
4141

42+
/// <summary>
43+
/// Gets the shared connection used by this temporary database.
44+
/// </summary>
4245
public SharedConnection SharedConnection { get; }
4346

4447
/// <summary>

src/dbup-sqlite/SqliteConnectionManager.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Collections.Generic;
1+
using System.Collections.Generic;
22
using System.Linq;
33
using System.Text.RegularExpressions;
44
using DbUp.Engine.Transactions;
@@ -26,9 +26,7 @@ public SqliteConnectionManager(SharedConnection sharedConnection) : base(l => sh
2626
{
2727
}
2828

29-
/// <summary>
30-
/// Sqlite statements separator is ; (see http://www.sqlite.org/lang.html)
31-
/// </summary>
29+
/// <inheritdoc/>
3230
public override IEnumerable<string> SplitScriptIntoCommands(string scriptContents)
3331
{
3432
var scriptStatements =

src/dbup-sqlite/SqliteExtensions.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using DbUp.Builder;
1+
using DbUp.Builder;
22
using DbUp.Sqlite;
33
using DbUp.Sqlite.Helpers;
44

@@ -53,6 +53,7 @@ public static UpgradeEngineBuilder SqliteDatabase(this SupportedDatabases suppor
5353
/// <summary>
5454
/// Tracks the list of executed scripts in a custom SQLite table.
5555
/// </summary>
56+
/// <param name="builder">The builder.</param>
5657
/// <param name="table">The name of the table used to store the list of executed scripts.</param>
5758
/// <returns>The <see cref="UpgradeEngineBuilder"/> used to set the journal table name.</returns>
5859
public static UpgradeEngineBuilder JournalToSqliteTable(this UpgradeEngineBuilder builder, string table)

src/dbup-sqlite/SqliteObjectParser.cs

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

33
namespace DbUp.Sqlite
44
{
@@ -7,6 +7,9 @@ namespace DbUp.Sqlite
77
/// </summary>
88
public class SqliteObjectParser : SqlObjectParser
99
{
10+
/// <summary>
11+
/// Initializes a new instance of the <see cref="SqliteObjectParser"/> class.
12+
/// </summary>
1013
public SqliteObjectParser()
1114
: base("[", "]")
1215
{

src/dbup-sqlite/SqliteScriptExecutor.cs

Lines changed: 3 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;
@@ -28,11 +28,13 @@ public SqliteScriptExecutor(Func<IConnectionManager> connectionManagerFactory, F
2828
{
2929
}
3030

31+
/// <inheritdoc/>
3132
protected override string GetVerifySchemaSql(string schema)
3233
{
3334
throw new NotSupportedException();
3435
}
3536

37+
/// <inheritdoc/>
3638
protected override void ExecuteCommandsWithinExceptionHandler(int index, SqlScript script, Action executeCommand)
3739
{
3840
try

src/dbup-sqlite/SqliteTableJournal.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using DbUp.Engine;
33
using DbUp.Engine.Output;
44
using DbUp.Engine.Transactions;
@@ -15,20 +15,26 @@ public class SqliteTableJournal : TableJournal
1515
/// <summary>
1616
/// Initializes a new instance of the <see cref="SqliteTableJournal"/> class.
1717
/// </summary>
18+
/// <param name="connectionManager">The connection manager.</param>
19+
/// <param name="logger">The log.</param>
20+
/// <param name="table">The table name.</param>
1821
public SqliteTableJournal(Func<IConnectionManager> connectionManager, Func<IUpgradeLog> logger, string table) :
1922
base(connectionManager, logger, new SqliteObjectParser(), null, table)
2023
{ }
2124

25+
/// <inheritdoc/>
2226
protected override string GetInsertJournalEntrySql(string @scriptName, string @applied)
2327
{
2428
return $"insert into {FqSchemaTableName} (ScriptName, Applied) values ({@scriptName}, {@applied})";
2529
}
2630

31+
/// <inheritdoc/>
2732
protected override string GetJournalEntriesSql()
2833
{
2934
return $"select [ScriptName] from {FqSchemaTableName} order by [ScriptName]";
3035
}
3136

37+
/// <inheritdoc/>
3238
protected override string CreateSchemaTableSql(string quotedPrimaryKeyName)
3339
{
3440
return
@@ -39,6 +45,7 @@ Applied DATETIME NOT NULL
3945
)";
4046
}
4147

48+
/// <inheritdoc/>
4249
protected override string DoesTableExistSql()
4350
{
4451
return $"SELECT count(name) FROM sqlite_master WHERE type = 'table' AND name = '{UnquotedSchemaTableName}'";

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