2using System.Collections.Generic;
4using System.Data.Common;
5using System.Data.OleDb;
6using System.Threading.Tasks;
18 private readonly Dictionary<string, OleDbStoredProcedure> procedures =
new Dictionary<string, OleDbStoredProcedure>();
20 private OleDbConnection connection;
29 this.connection = Connection;
37 this.connection?.Close();
38 this.connection?.Dispose();
39 this.connection =
null;
49 using (OleDbCommand Command = this.connection.CreateCommand())
51 Command.CommandType = CommandType.Text;
52 Command.CommandText = Statement;
53 DbDataReader Reader = await Command.ExecuteReaderAsync();
55 return await Reader.ParseAndClose();
65 public override Task<IElement>
GetSchema(
string Name)
67 DataTable Table = this.connection.GetSchema(Name);
68 return Task.FromResult<
IElement>(Table.ToMatrix());
76 public override async Task<ILambdaExpression>
GetProcedure(
string Name)
78 await this.synchObject.BeginWrite();
84 OleDbCommand Command = this.connection.CreateCommand();
85 Command.CommandType = CommandType.StoredProcedure;
86 Command.CommandText = this.connection.Database +
"." + Name;
88 OleDbCommandBuilder.DeriveParameters(Command);
91 this.procedures[Name] = Result;
97 await this.synchObject.EndWrite();
Represents an object that allows single concurrent writers but multiple concurrent readers....
Abstract base class for external databases
Manages an OLE DB SQL Server connection
override void Dispose()
IDisposable.Dispose
OleDbDatabase(OleDbConnection Connection)
Manages an OLE DB SQL Server connection
override async Task< IElement > ExecuteSqlStatement(string Statement)
Executes an SQL Statement on the database.
override Task< IElement > GetSchema(string Name)
Gets a Schema table, given its collection name. For a list of collections: https://mysqlconnector....
override async Task< ILambdaExpression > GetProcedure(string Name)
Creates a lambda expression for accessing a stored procedure.
Represents a stored precedure in an OLE DB Database.
Basic interface for all types of elements.