Skip to content

Commit

Permalink
Update links for GitHub.
Browse files Browse the repository at this point in the history
  • Loading branch information
Grauenwolf committed Jul 7, 2022
1 parent f0f307d commit a065d90
Show file tree
Hide file tree
Showing 15 changed files with 92 additions and 93 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ A Fluent ORM for .NET

* [Documentation Website](https://tortugaresearch.github.io/Tortuga.Chain)
* [API Reference](https://tortugaresearch.github.io/Tortuga.Chain/API/Index.html)
* [Chain Wiki](https://github.com/docevaad/Chain/wiki)
* [Chain vs Dapper](https://github.com/docevaad/Chain/wiki/A-Chain-comparison-to-Dapper)
* [Chain Wiki](https://github.com/TortugaResearch/Tortuga.Chain/wiki)
* [Chain vs Dapper](https://github.com/TortugaResearch/Tortuga.Chain/wiki/A-Chain-comparison-to-Dapper)
* The [change log](Tortuga.Chain/Changelog.md) starts with version 4.0.

## Getting Started
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

<Copyright>David Tomcik, Jonathan Allen 2016-2019</Copyright>

<PackageProjectUrl>https://github.com/docevaad/Chain</PackageProjectUrl>
<PackageProjectUrl>https://github.com/TortugaResearch/Tortuga.Chain</PackageProjectUrl>

<RepositoryUrl>https://github.com/docevaad/Chain.git</RepositoryUrl>
<RepositoryUrl>https://github.com/TortugaResearch/Tortuga.Chain.git</RepositoryUrl>

<RepositoryType>git</RepositoryType>
<Nullable>enable</Nullable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

<Copyright>David Tomcik, Jonathan Allen 2016-2019</Copyright>

<PackageProjectUrl>https://github.com/docevaad/Chain</PackageProjectUrl>
<PackageProjectUrl>https://github.com/TortugaResearch/Tortuga.Chain</PackageProjectUrl>

<RepositoryUrl>https://github.com/docevaad/Chain.git</RepositoryUrl>
<RepositoryUrl>https://github.com/TortugaResearch/Tortuga.Chain.git</RepositoryUrl>

<RepositoryType>git</RepositoryType>
<Nullable>enable</Nullable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

<Copyright>David Tomcik, Jonathan Allen 2016-2019</Copyright>

<PackageProjectUrl>https://github.com/docevaad/Chain</PackageProjectUrl>
<PackageProjectUrl>https://github.com/TortugaResearch/Tortuga.Chain</PackageProjectUrl>

<RepositoryUrl>https://github.com/docevaad/Chain.git</RepositoryUrl>
<RepositoryUrl>https://github.com/TortugaResearch/Tortuga.Chain.git</RepositoryUrl>

<RepositoryType>git</RepositoryType>
<Nullable>enable</Nullable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

<Copyright>David Tomcik, Jonathan Allen 2016-2019</Copyright>

<PackageProjectUrl>https://github.com/docevaad/Chain</PackageProjectUrl>
<PackageProjectUrl>https://github.com/TortugaResearch/Tortuga.Chain</PackageProjectUrl>

<RepositoryUrl>https://github.com/docevaad/Chain.git</RepositoryUrl>
<RepositoryUrl>https://github.com/TortugaResearch/Tortuga.Chain.git</RepositoryUrl>

<RepositoryType>git</RepositoryType>
<Nullable>enable</Nullable>
Expand Down
5 changes: 2 additions & 3 deletions Tortuga.Chain/Tortuga.Chain.Core/Tortuga.Chain.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@

<Copyright>David Tomcik, Jonathan Allen 2016-2019</Copyright>

<PackageProjectUrl>https://github.com/docevaad/Chain</PackageProjectUrl>

<RepositoryUrl>https://github.com/docevaad/Chain.git</RepositoryUrl>
<PackageProjectUrl>https://github.com/TortugaResearch/Tortuga.Chain</PackageProjectUrl>
<RepositoryUrl>https://github.com/TortugaResearch/Tortuga.Chain.git</RepositoryUrl>

<RepositoryType>git</RepositoryType>
<Nullable>enable</Nullable>
Expand Down
4 changes: 2 additions & 2 deletions Tortuga.Chain/Tortuga.Chain.MySql/Tortuga.Chain.MySql.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

<Copyright>David Tomcik, Jonathan Allen 2016-2019</Copyright>

<PackageProjectUrl>https://github.com/docevaad/Chain</PackageProjectUrl>
<PackageProjectUrl>https://github.com/TortugaResearch/Tortuga.Chain</PackageProjectUrl>

<RepositoryUrl>https://github.com/docevaad/Chain.git</RepositoryUrl>
<RepositoryUrl>https://github.com/TortugaResearch/Tortuga.Chain.git</RepositoryUrl>

<RepositoryType>git</RepositoryType>
<Nullable>enable</Nullable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public override CommandExecutionToken<NpgsqlCommand, NpgsqlParameter> Prepare(Ma

var identityInsert = m_Options.HasFlag(InsertOptions.IdentityInsert);
if (identityInsert)
throw new NotImplementedException("See issue 256. https://github.com/docevaad/Chain/issues/256");
throw new NotImplementedException("See issue 256. https://github.com/TortugaResearch/Tortuga.Chain/issues/256");

var sqlBuilder = m_Table.CreateSqlBuilder(StrictMode);
sqlBuilder.ApplyDesiredColumns(materializer.DesiredColumns());
Expand Down Expand Up @@ -105,4 +105,4 @@ public override CommandExecutionToken<NpgsqlCommand, NpgsqlParameter> Prepare(Ma
/// </remarks>
public override IReadOnlyList<ColumnMetadata> TryGetNonNullableColumns() => m_Table.NonNullableColumns;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public override CommandExecutionToken<NpgsqlCommand, NpgsqlParameter> Prepare(Ma

var identityInsert = m_Options.HasFlag(InsertOptions.IdentityInsert);
if (identityInsert)
throw new NotImplementedException("See issue 256. https://github.com/docevaad/Chain/issues/256");
throw new NotImplementedException("See issue 256. https://github.com/TortugaResearch/Tortuga.Chain/issues/256");

var sqlBuilder = Table.CreateSqlBuilder(StrictMode);
sqlBuilder.ApplyArgumentValue(DataSource, ArgumentValue, m_Options);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,78 +5,78 @@

namespace Tortuga.Chain.PostgreSql.CommandBuilders
{
/// <summary>
/// Class PostgreSqlInsertOrUpdateObject
/// </summary>
internal sealed class PostgreSqlInsertOrUpdateObject<TArgument> : PostgreSqlObjectCommand<TArgument>
where TArgument : class
{
readonly UpsertOptions m_Options;
/// <summary>
/// Class PostgreSqlInsertOrUpdateObject
/// </summary>
internal sealed class PostgreSqlInsertOrUpdateObject<TArgument> : PostgreSqlObjectCommand<TArgument>
where TArgument : class
{
readonly UpsertOptions m_Options;

/// <summary>
/// Initializes a new instance of the <see cref="PostgreSqlInsertOrUpdateObject{TArgument}"/> class.
/// </summary>
/// <param name="dataSource">The data source.</param>
/// <param name="tableName">Name of the table.</param>
/// <param name="argumentValue">The argument value.</param>
/// <param name="options">The options.</param>
public PostgreSqlInsertOrUpdateObject(PostgreSqlDataSourceBase dataSource, PostgreSqlObjectName tableName, TArgument argumentValue, UpsertOptions options)
: base(dataSource, tableName, argumentValue)
{
m_Options = options;
}
/// <summary>
/// Initializes a new instance of the <see cref="PostgreSqlInsertOrUpdateObject{TArgument}"/> class.
/// </summary>
/// <param name="dataSource">The data source.</param>
/// <param name="tableName">Name of the table.</param>
/// <param name="argumentValue">The argument value.</param>
/// <param name="options">The options.</param>
public PostgreSqlInsertOrUpdateObject(PostgreSqlDataSourceBase dataSource, PostgreSqlObjectName tableName, TArgument argumentValue, UpsertOptions options)
: base(dataSource, tableName, argumentValue)
{
m_Options = options;
}

/// <summary>
/// Prepares the command for execution by generating any necessary SQL.
/// </summary>
/// <param name="materializer"></param>
/// <returns><see cref="PostgreSqlCommandExecutionToken" /></returns>
public override CommandExecutionToken<NpgsqlCommand, NpgsqlParameter> Prepare(Materializer<NpgsqlCommand, NpgsqlParameter> materializer)
{
if (materializer == null)
throw new ArgumentNullException(nameof(materializer), $"{nameof(materializer)} is null.");
/// <summary>
/// Prepares the command for execution by generating any necessary SQL.
/// </summary>
/// <param name="materializer"></param>
/// <returns><see cref="PostgreSqlCommandExecutionToken" /></returns>
public override CommandExecutionToken<NpgsqlCommand, NpgsqlParameter> Prepare(Materializer<NpgsqlCommand, NpgsqlParameter> materializer)
{
if (materializer == null)
throw new ArgumentNullException(nameof(materializer), $"{nameof(materializer)} is null.");

var identityInsert = m_Options.HasFlag(UpsertOptions.IdentityInsert);
if (identityInsert)
throw new NotImplementedException("See issue 256. https://github.com/docevaad/Chain/issues/256");
var identityInsert = m_Options.HasFlag(UpsertOptions.IdentityInsert);
if (identityInsert)
throw new NotImplementedException("See issue 256. https://github.com/TortugaResearch/Tortuga.Chain/issues/256");

//var primaryKeyNames = Table.PrimaryKeyColumns.Select(x => x.QuotedSqlName);
//var primaryKeyNames = Table.PrimaryKeyColumns.Select(x => x.QuotedSqlName);

var sqlBuilder = Table.CreateSqlBuilder(StrictMode);
sqlBuilder.ApplyArgumentValue(DataSource, ArgumentValue, m_Options);
sqlBuilder.ApplyDesiredColumns(materializer.DesiredColumns());
var sqlBuilder = Table.CreateSqlBuilder(StrictMode);
sqlBuilder.ApplyArgumentValue(DataSource, ArgumentValue, m_Options);
sqlBuilder.ApplyDesiredColumns(materializer.DesiredColumns());

if (KeyColumns.Count > 0)
{
sqlBuilder.OverrideKeys(KeyColumns);
}
if (KeyColumns.Count > 0)
{
sqlBuilder.OverrideKeys(KeyColumns);
}

var sql = new StringBuilder();
List<NpgsqlParameter> keyParameters;
var isPrimaryKeyIdentity = sqlBuilder.PrimaryKeyIsIdentity(out keyParameters);
if (isPrimaryKeyIdentity && KeyColumns.Count == 0)
{
var areKeysNull = keyParameters.Any(c => c.Value == DBNull.Value || c.Value == null) ? true : false;
if (areKeysNull)
sqlBuilder.BuildInsertStatement(sql, Table.Name.ToString(), null);
else
sqlBuilder.BuildUpdateByKeyStatement(sql, Table.Name.ToString(), null);
sqlBuilder.BuildSelectClause(sql, " RETURNING ", null, ";");
}
else
{
string conflictNames = string.Join(", ", sqlBuilder.GetKeyColumns().Select(x => x.QuotedSqlName));
var sql = new StringBuilder();
List<NpgsqlParameter> keyParameters;
var isPrimaryKeyIdentity = sqlBuilder.PrimaryKeyIsIdentity(out keyParameters);
if (isPrimaryKeyIdentity && KeyColumns.Count == 0)
{
var areKeysNull = keyParameters.Any(c => c.Value == DBNull.Value || c.Value == null) ? true : false;
if (areKeysNull)
sqlBuilder.BuildInsertStatement(sql, Table.Name.ToString(), null);
else
sqlBuilder.BuildUpdateByKeyStatement(sql, Table.Name.ToString(), null);
sqlBuilder.BuildSelectClause(sql, " RETURNING ", null, ";");
}
else
{
string conflictNames = string.Join(", ", sqlBuilder.GetKeyColumns().Select(x => x.QuotedSqlName));

sqlBuilder.BuildInsertClause(sql, $"INSERT INTO {Table.Name.ToString()} (", null, ")");
sqlBuilder.BuildValuesClause(sql, " VALUES (", ")");
sqlBuilder.BuildSetClause(sql, $" ON CONFLICT ({conflictNames}) DO UPDATE SET ", null, null);
sqlBuilder.BuildSelectClause(sql, " RETURNING ", null, ";");
}
sqlBuilder.BuildInsertClause(sql, $"INSERT INTO {Table.Name.ToString()} (", null, ")");
sqlBuilder.BuildValuesClause(sql, " VALUES (", ")");
sqlBuilder.BuildSetClause(sql, $" ON CONFLICT ({conflictNames}) DO UPDATE SET ", null, null);
sqlBuilder.BuildSelectClause(sql, " RETURNING ", null, ";");
}

//Looks like ON CONFLICT is useful here http://www.postgresql.org/docs/current/static/sql-insert.html
//Use RETURNING in place of SQL Servers OUTPUT clause http://www.postgresql.org/docs/current/static/sql-insert.html
//Looks like ON CONFLICT is useful here http://www.postgresql.org/docs/current/static/sql-insert.html
//Use RETURNING in place of SQL Servers OUTPUT clause http://www.postgresql.org/docs/current/static/sql-insert.html

return new PostgreSqlCommandExecutionToken(DataSource, "Insert or update " + Table.Name, sql.ToString(), sqlBuilder.GetParameters());
}
}
}
return new PostgreSqlCommandExecutionToken(DataSource, "Insert or update " + Table.Name, sql.ToString(), sqlBuilder.GetParameters());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

<Copyright>David Tomcik, Jonathan Allen 2016-2019</Copyright>

<PackageProjectUrl>https://github.com/docevaad/Chain</PackageProjectUrl>
<PackageProjectUrl>https://github.com/TortugaResearch/Tortuga.Chain</PackageProjectUrl>

<RepositoryUrl>https://github.com/docevaad/Chain.git</RepositoryUrl>
<RepositoryUrl>https://github.com/TortugaResearch/Tortuga.Chain.git</RepositoryUrl>

<RepositoryType>git</RepositoryType>
<Nullable>enable</Nullable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

<Copyright>David Tomcik, Jonathan Allen 2016-2019</Copyright>

<PackageProjectUrl>https://github.com/docevaad/Chain</PackageProjectUrl>
<PackageProjectUrl>https://github.com/TortugaResearch/Tortuga.Chain</PackageProjectUrl>

<RepositoryUrl>https://github.com/docevaad/Chain.git</RepositoryUrl>
<RepositoryUrl>https://github.com/TortugaResearch/Tortuga.Chain.git</RepositoryUrl>

<RepositoryType>git</RepositoryType>
<Nullable>enable</Nullable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

<Copyright>David Tomcik, Jonathan Allen 2016-2019</Copyright>

<PackageProjectUrl>https://github.com/docevaad/Chain</PackageProjectUrl>
<PackageProjectUrl>https://github.com/TortugaResearch/Tortuga.Chain</PackageProjectUrl>

<RepositoryUrl>https://github.com/docevaad/Chain.git</RepositoryUrl>
<RepositoryUrl>https://github.com/TortugaResearch/Tortuga.Chain.git</RepositoryUrl>

<RepositoryType>git</RepositoryType>
<Nullable>enable</Nullable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

<Copyright>David Tomcik Jonathan Allen 2016-2019</Copyright>

<PackageProjectUrl>https://github.com/docevaad/Chain</PackageProjectUrl>
<PackageProjectUrl>https://github.com/TortugaResearch/Tortuga.Chain</PackageProjectUrl>

<RepositoryUrl>https://github.com/docevaad/Chain.git</RepositoryUrl>
<RepositoryUrl>https://github.com/TortugaResearch/Tortuga.Chain.git</RepositoryUrl>

<RepositoryType>git</RepositoryType>
<Nullable>enable</Nullable>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

<Copyright>David Tomcik, Jonathan Allen 2016-2019</Copyright>

<PackageProjectUrl>https://github.com/docevaad/Chain</PackageProjectUrl>
<PackageProjectUrl>https://github.com/TortugaResearch/Tortuga.Chain</PackageProjectUrl>

<RepositoryUrl>https://github.com/docevaad/Chain.git</RepositoryUrl>
<RepositoryUrl>https://github.com/TortugaResearch/Tortuga.Chain.git</RepositoryUrl>

<RepositoryType>git</RepositoryType>
<Nullable>enable</Nullable>
Expand Down

0 comments on commit a065d90

Please sign in to comment.