-
-
Notifications
You must be signed in to change notification settings - Fork 120
Expand file tree
/
Copy pathDatabaseHelper.cs
More file actions
53 lines (39 loc) · 1.38 KB
/
DatabaseHelper.cs
File metadata and controls
53 lines (39 loc) · 1.38 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using System;
using EvolveDb.Connection;
using EvolveDb.Metadata;
using EvolveDb.Utilities;
namespace EvolveDb.Dialect
{
internal abstract class DatabaseHelper : IDisposable
{
private bool _disposedValue = false;
protected DatabaseHelper(WrappedConnection wrappedConnection)
{
WrappedConnection = Check.NotNull(wrappedConnection, nameof(wrappedConnection));
}
public WrappedConnection WrappedConnection { get; }
public abstract string DatabaseName { get; }
public abstract string CurrentUser { get; }
public abstract SqlStatementBuilderBase SqlStatementBuilder { get; }
public abstract string? GetCurrentSchemaName();
public abstract Schema GetSchema(string schemaName);
public abstract IEvolveMetadata GetMetadataTable(string schema, string tableName);
public abstract bool TryAcquireApplicationLock(object? lockId = null);
public abstract bool ReleaseApplicationLock(object? lockId = null);
public void Dispose()
{
Dispose(true);
}
protected virtual void Dispose(bool disposing)
{
if (!_disposedValue)
{
if (disposing)
{
WrappedConnection.Dispose();
}
_disposedValue = true;
}
}
}
}