/
OracleOptions.cs
65 lines (56 loc) · 2.12 KB
/
OracleOptions.cs
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
using System;
using System.Collections.Generic;
namespace LinqToDB.DataProvider.Oracle
{
using Common;
using Common.Internal;
using Data;
/// <param name="BulkCopyType">
/// Default bulk copy mode, used for oracle by <see cref="DataConnectionExtensions.BulkCopy{T}(DataConnection, IEnumerable{T})"/>
/// methods, if mode is not specified explicitly.
/// Default value: <see cref="BulkCopyType.MultipleRows"/>.
/// </param>
/// <param name="AlternativeBulkCopy">
/// Defines type of multi-row INSERT operation to generate for <see cref="BulkCopyType.RowByRow"/> bulk copy mode.
/// </param>
/// <param name="DontEscapeLowercaseIdentifiers">
/// Gets or sets flag to tell LinqToDB to quote identifiers, if they contain lowercase letters.
/// Default value: <c>false</c>.
/// This flag is added for backward compatibility and not recommended for use with new applications.
/// </param>
public sealed record OracleOptions
(
BulkCopyType BulkCopyType = BulkCopyType.MultipleRows,
AlternativeBulkCopy AlternativeBulkCopy = AlternativeBulkCopy.InsertAll,
bool DontEscapeLowercaseIdentifiers = false
// If you add another parameter here, don't forget to update
// OracleOptions copy constructor and CreateID method.
)
: DataProviderOptions<OracleOptions>(BulkCopyType)
{
public OracleOptions() : this(BulkCopyType.MultipleRows)
{
}
OracleOptions(OracleOptions original) : base(original)
{
AlternativeBulkCopy = original.AlternativeBulkCopy;
DontEscapeLowercaseIdentifiers = original.DontEscapeLowercaseIdentifiers;
}
protected override IdentifierBuilder CreateID(IdentifierBuilder builder) => builder
.Add(AlternativeBulkCopy)
.Add(DontEscapeLowercaseIdentifiers)
;
#region IEquatable implementation
public bool Equals(OracleOptions? other)
{
if (ReferenceEquals(null, other)) return false;
if (ReferenceEquals(this, other)) return true;
return ((IOptionSet)this).ConfigurationID == ((IOptionSet)other).ConfigurationID;
}
public override int GetHashCode()
{
return ((IOptionSet)this).ConfigurationID;
}
#endregion
}
}