Skip to content

Implement new ADO.NET batching API #2317

@roji

Description

@roji

Assuming the new batching API proposal makes it through (https://github.com/dotnet/corefx/issues/35135), we need to implement it in Npgsql. The details still need to be finalized in that proposal, but here are some comments/questions:

  • NpgsqlStatement will probably disappear, since we'll now have an NpgsqlCommandSet containing multiple NpgsqlCommands, rather than an NpgsqlCommand containing multiple NpgsqlStatements. Investigate the consequences of this.
  • We probably want to maintain backwards compatibility and continue to support concatenation-based batching in NpgsqlCommand. This means that we should continue parsing the CommandText for semicolons, and if we find multiple statements, internally construct an NpgsqlCommandSet and execute that.
  • However, when executing as part of a batch, we should not split commands on semicolons ("nested batching").
  • Regardless, we still need to parse/rewrite SQL because of the parameter placeholder problem (https://github.com/dotnet/corefx/issues/27075). Once everything is completed, we can have an opt-in mode without any SQL access (New raw SQL mode where Npgsql doesn't parse the SQL #1042).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions