-
Notifications
You must be signed in to change notification settings - Fork 874
Expand file tree
/
Copy pathNpgsqlDataSourceBatch.cs
More file actions
35 lines (29 loc) · 1.34 KB
/
NpgsqlDataSourceBatch.cs
File metadata and controls
35 lines (29 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
using System.Data.Common;
using System.Threading;
using System.Threading.Tasks;
using Npgsql.Properties;
namespace Npgsql;
sealed class NpgsqlDataSourceBatch : NpgsqlBatch
{
internal NpgsqlDataSourceBatch(NpgsqlConnection connection)
: base(static (conn, batch) => new NpgsqlDataSourceCommand(batch, DefaultBatchCommandsSize, conn), connection)
{
}
// The below are incompatible with batches executed directly against DbDataSource, since no DbConnection
// is involved at the user API level and the batch owns the DbConnection.
public override void Prepare()
=> throw new NotSupportedException(NpgsqlStrings.NotSupportedOnDataSourceBatch);
public override Task PrepareAsync(CancellationToken cancellationToken = default)
=> throw new NotSupportedException(NpgsqlStrings.NotSupportedOnDataSourceBatch);
protected override DbConnection? DbConnection
{
get => throw new NotSupportedException(NpgsqlStrings.NotSupportedOnDataSourceBatch);
set => throw new NotSupportedException(NpgsqlStrings.NotSupportedOnDataSourceBatch);
}
protected override DbTransaction? DbTransaction
{
get => throw new NotSupportedException(NpgsqlStrings.NotSupportedOnDataSourceBatch);
set => throw new NotSupportedException(NpgsqlStrings.NotSupportedOnDataSourceBatch);
}
}