RepoDB icon indicating copy to clipboard operation
RepoDB copied to clipboard

Enhancement: Consider the support to DbTableCache.

Open mikependon opened this issue 5 years ago • 0 comments

Currently, there is no way for us to extract the list of tables of the database in an efficient (cached) manner. As RepoDB is becoming more hybrid and is fully integrating the dynamics into the framework, therefore, this method is significantly becoming more important.

Signature/Calls:

using (var connection = new SqlConnection(connectionString))
{
	var tables = DbTableCache.Get(connection, transaction: null).AsList();
}

Target Usage:

Then, you can combine it with the other calls. Below is when you are extracting the schemas.

tables.ForEach(table =>
{
	var columns = DbFieldCache.Get(connection, table.Name, transaction: null);
});

And below is when you are querying the records.

tables.ForEach(table =>
{
	var data = connection.Query(table.Name);
});

And to any other extent, when you retrieved the data as dynamic (aka ExpandoObject), you can also just do the call to the push operaions.

connection.Insert(table.Name, data);
connection.BulkInsert(table.Name, data);
...

Rationale:

The main reason behind this is the complete support to the dynamic operations.

mikependon avatar Oct 18 '20 11:10 mikependon