Skip to content

Commit

Permalink
Compiled query fixes from last Weasel change
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremydmiller committed Jul 24, 2024
1 parent 08d4b48 commit 8499334
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Marten/Internal/CompiledQueries/CompiledQueryPlan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,16 @@ NpgsqlParameter ICommandBuilder.AppendParameter<T>(T value)

NpgsqlParameter ICommandBuilder.AppendParameter<T>(T value, NpgsqlDbType dbType)
{
throw new NotSupportedException();
_current ??= appendCommand();
var name = "p" + _parameterIndex;
_parameterIndex++;
var usage = new ParameterUsage(_current.Parameters.Count, name, value, dbType);

_current.Parameters.Add(usage);

_current.CommandText += ParameterPlaceholder;

return usage.Parameter;
}

private int _parameterIndex = 0;
Expand Down

0 comments on commit 8499334

Please sign in to comment.