Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<Version>9.0.0-alpha.2</Version>
<Version>9.0.0-alpha.3</Version>
<LangVersion>13.0</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand Down
4 changes: 2 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<PackageVersion Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.12.19" />
<PackageVersion Include="DistributedLock.Postgres" Version="1.3.0" />
<PackageVersion Include="DotNet.ReproducibleBuilds" Version="1.2.39" />
<PackageVersion Include="JasperFx" Version="2.0.0-alpha.1" />
<PackageVersion Include="JasperFx.Events" Version="2.0.0-alpha.1" />
<PackageVersion Include="JasperFx" Version="2.0.0-alpha.11" />
<PackageVersion Include="JasperFx.Events" Version="2.0.0-alpha.4" />
<PackageVersion Include="Microsoft.Data.Sqlite" Version="9.0.1" />
<PackageVersion Include="Microsoft.Data.SqlClient" Version="6.1.3" />
<!-- EF Core versions are framework-conditional - see below -->
Expand Down
14 changes: 13 additions & 1 deletion src/Weasel.Core/CommandBuilderBase.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Collections;
using System.Data.Common;
using System.Diagnostics.CodeAnalysis;
using System.Text;
using JasperFx.Core;

Expand Down Expand Up @@ -273,9 +274,20 @@
/// <summary>
/// For each public property of the parameters object, adds a new parameter
/// to the command with the name of the property and the current value of the property
/// on the parameters object. Does *not* affect the command text
/// on the parameters object. Does *not* affect the command text.
/// </summary>
/// <param name="parameters"></param>
/// <remarks>
/// weasel#266: reflects on <c>parameters.GetType().GetProperties()</c>.
/// The static type is <see cref="object"/>, which can't carry a
/// <see cref="DynamicallyAccessedMembersAttribute"/> annotation at
/// the parameter site, so this method propagates
/// <see cref="RequiresUnreferencedCodeAttribute"/> to AOT-publishing
/// consumers. Callers that need AOT compatibility should pass an
/// <see cref="IDictionary{TKey,TValue}"/> instead (the dictionary
/// overloads above don't reflect).
/// </remarks>
[RequiresUnreferencedCode("AddParameters(object) reflects on the parameters object's public properties via Type.GetProperties(). Use the IDictionary<string, T> overload when publishing AOT-trim-clean.")]
public void AddParameters(object parameters)
{
if (parameters == null)
Expand Down Expand Up @@ -518,7 +530,7 @@
/// <param name="ct"></param>
/// <typeparam name="T"></typeparam>
/// <returns></returns>
public static async Task<IReadOnlyList<T>> FetchListAsync<T, TCommand>(

Check warning on line 533 in src/Weasel.Core/CommandBuilderBase.cs

View workflow job for this annotation

GitHub Actions / MSSQL mcr.microsoft.com/mssql/server:2022-latest net9.0

Type parameter 'TCommand' has no matching typeparam tag in the XML comment on 'CommandBuilderExtensions.FetchListAsync<T, TCommand>(DbConnection, ICommandBuilder<TCommand>, Func<DbDataReader, CancellationToken, Task<T>>, DbTransaction?, CancellationToken)' (but other type parameters do)

Check warning on line 533 in src/Weasel.Core/CommandBuilderBase.cs

View workflow job for this annotation

GitHub Actions / MSSQL mcr.microsoft.com/mssql/server:2019-latest net10.0

Type parameter 'TCommand' has no matching typeparam tag in the XML comment on 'CommandBuilderExtensions.FetchListAsync<T, TCommand>(DbConnection, ICommandBuilder<TCommand>, Func<DbDataReader, CancellationToken, Task<T>>, DbTransaction?, CancellationToken)' (but other type parameters do)

Check warning on line 533 in src/Weasel.Core/CommandBuilderBase.cs

View workflow job for this annotation

GitHub Actions / MSSQL mcr.microsoft.com/mssql/server:2019-latest net9.0

Type parameter 'TCommand' has no matching typeparam tag in the XML comment on 'CommandBuilderExtensions.FetchListAsync<T, TCommand>(DbConnection, ICommandBuilder<TCommand>, Func<DbDataReader, CancellationToken, Task<T>>, DbTransaction?, CancellationToken)' (but other type parameters do)

Check warning on line 533 in src/Weasel.Core/CommandBuilderBase.cs

View workflow job for this annotation

GitHub Actions / SQLite ubuntu-latest net8.0

Type parameter 'TCommand' has no matching typeparam tag in the XML comment on 'CommandBuilderExtensions.FetchListAsync<T, TCommand>(DbConnection, ICommandBuilder<TCommand>, Func<DbDataReader, CancellationToken, Task<T>>, DbTransaction?, CancellationToken)' (but other type parameters do)

Check warning on line 533 in src/Weasel.Core/CommandBuilderBase.cs

View workflow job for this annotation

GitHub Actions / SQLite ubuntu-latest net9.0

Type parameter 'TCommand' has no matching typeparam tag in the XML comment on 'CommandBuilderExtensions.FetchListAsync<T, TCommand>(DbConnection, ICommandBuilder<TCommand>, Func<DbDataReader, CancellationToken, Task<T>>, DbTransaction?, CancellationToken)' (but other type parameters do)

Check warning on line 533 in src/Weasel.Core/CommandBuilderBase.cs

View workflow job for this annotation

GitHub Actions / MSSQL mcr.microsoft.com/mssql/server:2019-latest net8.0

Type parameter 'TCommand' has no matching typeparam tag in the XML comment on 'CommandBuilderExtensions.FetchListAsync<T, TCommand>(DbConnection, ICommandBuilder<TCommand>, Func<DbDataReader, CancellationToken, Task<T>>, DbTransaction?, CancellationToken)' (but other type parameters do)

Check warning on line 533 in src/Weasel.Core/CommandBuilderBase.cs

View workflow job for this annotation

GitHub Actions / Postgres postgres:15.3-alpine net9.0 Case Sensitive false

Type parameter 'TCommand' has no matching typeparam tag in the XML comment on 'CommandBuilderExtensions.FetchListAsync<T, TCommand>(DbConnection, ICommandBuilder<TCommand>, Func<DbDataReader, CancellationToken, Task<T>>, DbTransaction?, CancellationToken)' (but other type parameters do)

Check warning on line 533 in src/Weasel.Core/CommandBuilderBase.cs

View workflow job for this annotation

GitHub Actions / SQLite ubuntu-latest net10.0

Type parameter 'TCommand' has no matching typeparam tag in the XML comment on 'CommandBuilderExtensions.FetchListAsync<T, TCommand>(DbConnection, ICommandBuilder<TCommand>, Func<DbDataReader, CancellationToken, Task<T>>, DbTransaction?, CancellationToken)' (but other type parameters do)

Check warning on line 533 in src/Weasel.Core/CommandBuilderBase.cs

View workflow job for this annotation

GitHub Actions / Oracle net9.0

Type parameter 'TCommand' has no matching typeparam tag in the XML comment on 'CommandBuilderExtensions.FetchListAsync<T, TCommand>(DbConnection, ICommandBuilder<TCommand>, Func<DbDataReader, CancellationToken, Task<T>>, DbTransaction?, CancellationToken)' (but other type parameters do)

Check warning on line 533 in src/Weasel.Core/CommandBuilderBase.cs

View workflow job for this annotation

GitHub Actions / MSSQL mcr.microsoft.com/mssql/server:2022-latest net10.0

Type parameter 'TCommand' has no matching typeparam tag in the XML comment on 'CommandBuilderExtensions.FetchListAsync<T, TCommand>(DbConnection, ICommandBuilder<TCommand>, Func<DbDataReader, CancellationToken, Task<T>>, DbTransaction?, CancellationToken)' (but other type parameters do)

Check warning on line 533 in src/Weasel.Core/CommandBuilderBase.cs

View workflow job for this annotation

GitHub Actions / MSSQL mcr.microsoft.com/mssql/server:2022-latest net8.0

Type parameter 'TCommand' has no matching typeparam tag in the XML comment on 'CommandBuilderExtensions.FetchListAsync<T, TCommand>(DbConnection, ICommandBuilder<TCommand>, Func<DbDataReader, CancellationToken, Task<T>>, DbTransaction?, CancellationToken)' (but other type parameters do)

Check warning on line 533 in src/Weasel.Core/CommandBuilderBase.cs

View workflow job for this annotation

GitHub Actions / MySql mysql:8.0 net9.0

Type parameter 'TCommand' has no matching typeparam tag in the XML comment on 'CommandBuilderExtensions.FetchListAsync<T, TCommand>(DbConnection, ICommandBuilder<TCommand>, Func<DbDataReader, CancellationToken, Task<T>>, DbTransaction?, CancellationToken)' (but other type parameters do)

Check warning on line 533 in src/Weasel.Core/CommandBuilderBase.cs

View workflow job for this annotation

GitHub Actions / Postgres postgres:15.3-alpine net9.0 Case Sensitive true

Type parameter 'TCommand' has no matching typeparam tag in the XML comment on 'CommandBuilderExtensions.FetchListAsync<T, TCommand>(DbConnection, ICommandBuilder<TCommand>, Func<DbDataReader, CancellationToken, Task<T>>, DbTransaction?, CancellationToken)' (but other type parameters do)

Check warning on line 533 in src/Weasel.Core/CommandBuilderBase.cs

View workflow job for this annotation

GitHub Actions / Oracle net10.0

Type parameter 'TCommand' has no matching typeparam tag in the XML comment on 'CommandBuilderExtensions.FetchListAsync<T, TCommand>(DbConnection, ICommandBuilder<TCommand>, Func<DbDataReader, CancellationToken, Task<T>>, DbTransaction?, CancellationToken)' (but other type parameters do)

Check warning on line 533 in src/Weasel.Core/CommandBuilderBase.cs

View workflow job for this annotation

GitHub Actions / Postgres postgres:15.3-alpine net8.0 Case Sensitive true

Type parameter 'TCommand' has no matching typeparam tag in the XML comment on 'CommandBuilderExtensions.FetchListAsync<T, TCommand>(DbConnection, ICommandBuilder<TCommand>, Func<DbDataReader, CancellationToken, Task<T>>, DbTransaction?, CancellationToken)' (but other type parameters do)

Check warning on line 533 in src/Weasel.Core/CommandBuilderBase.cs

View workflow job for this annotation

GitHub Actions / MySql mysql:8.0 net8.0

Type parameter 'TCommand' has no matching typeparam tag in the XML comment on 'CommandBuilderExtensions.FetchListAsync<T, TCommand>(DbConnection, ICommandBuilder<TCommand>, Func<DbDataReader, CancellationToken, Task<T>>, DbTransaction?, CancellationToken)' (but other type parameters do)

Check warning on line 533 in src/Weasel.Core/CommandBuilderBase.cs

View workflow job for this annotation

GitHub Actions / MySql mysql:8.0 net10.0

Type parameter 'TCommand' has no matching typeparam tag in the XML comment on 'CommandBuilderExtensions.FetchListAsync<T, TCommand>(DbConnection, ICommandBuilder<TCommand>, Func<DbDataReader, CancellationToken, Task<T>>, DbTransaction?, CancellationToken)' (but other type parameters do)

Check warning on line 533 in src/Weasel.Core/CommandBuilderBase.cs

View workflow job for this annotation

GitHub Actions / Postgres postgres:15.3-alpine net10.0 Case Sensitive true

Type parameter 'TCommand' has no matching typeparam tag in the XML comment on 'CommandBuilderExtensions.FetchListAsync<T, TCommand>(DbConnection, ICommandBuilder<TCommand>, Func<DbDataReader, CancellationToken, Task<T>>, DbTransaction?, CancellationToken)' (but other type parameters do)

Check warning on line 533 in src/Weasel.Core/CommandBuilderBase.cs

View workflow job for this annotation

GitHub Actions / Oracle net8.0

Type parameter 'TCommand' has no matching typeparam tag in the XML comment on 'CommandBuilderExtensions.FetchListAsync<T, TCommand>(DbConnection, ICommandBuilder<TCommand>, Func<DbDataReader, CancellationToken, Task<T>>, DbTransaction?, CancellationToken)' (but other type parameters do)

Check warning on line 533 in src/Weasel.Core/CommandBuilderBase.cs

View workflow job for this annotation

GitHub Actions / Postgres postgres:15.3-alpine net8.0 Case Sensitive false

Type parameter 'TCommand' has no matching typeparam tag in the XML comment on 'CommandBuilderExtensions.FetchListAsync<T, TCommand>(DbConnection, ICommandBuilder<TCommand>, Func<DbDataReader, CancellationToken, Task<T>>, DbTransaction?, CancellationToken)' (but other type parameters do)

Check warning on line 533 in src/Weasel.Core/CommandBuilderBase.cs

View workflow job for this annotation

GitHub Actions / Postgres postgres:15.3-alpine net10.0 Case Sensitive false

Type parameter 'TCommand' has no matching typeparam tag in the XML comment on 'CommandBuilderExtensions.FetchListAsync<T, TCommand>(DbConnection, ICommandBuilder<TCommand>, Func<DbDataReader, CancellationToken, Task<T>>, DbTransaction?, CancellationToken)' (but other type parameters do)
DbConnection connection,
ICommandBuilder<TCommand> commandBuilder,
Func<DbDataReader, CancellationToken, Task<T>> transform,
Expand Down
15 changes: 15 additions & 0 deletions src/Weasel.Core/CommandLine/AssertCommand.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Diagnostics.CodeAnalysis;
using JasperFx.CommandLine;
using Spectre.Console;
using Weasel.Core.Migrations;
Expand All @@ -7,6 +8,20 @@ namespace Weasel.Core.CommandLine;
[Description("Assert that the existing database(s) matches the current configuration", Name = "db-assert")]
public class AssertCommand: JasperFxAsyncCommand<WeaselInput>
{
// weasel#265: Spectre.Console.AnsiConsole.WriteException calls into
// an ExceptionFormatter path that's RequiresDynamicCode. db-assert is
// a dev-time CLI tool (not a production hot path), so suppressing the
// warning here is the right call rather than propagating it via
// [RequiresDynamicCode] — propagation would trigger IL3051 because the
// JasperFx base method JasperFxAsyncCommand<T>.Execute(T) doesn't
// carry the attribute, and adding it there would ripple to every
// JasperFx command across the Critter Stack. Suppression keeps the
// fix Weasel-scoped. If JasperFx ever annotates the base method,
// delete this suppression and use [RequiresDynamicCode] instead.
[UnconditionalSuppressMessage(
"AOT",
"IL3050",
Justification = "AnsiConsole.WriteException is only reached on the dev-time db-assert command path. weasel#265 / JasperFx/jasperfx#213.")]
public override async Task<bool> Execute(WeaselInput input)
{
AnsiConsole.Write(
Expand Down
Loading