Skip to content

gman-au/schema-search

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SchemaSearch

nuget

GitHub Release

Summary

The SchemaSearch application is a class library that will build a set of database tables, columns and foreign key relationships when supplied with a valid database connection string.

A sample console host is included. To test it, create or connect to a database (you can run a sample Northwind script to create a test database) and supply the connection string:

  • either as an environment variable
ConnectionStrings__Default=<YOUR_CONNECTION_STRING>
  • or as part of the appsettings.json configuration:
{
    "ConnectionStrings": {
        "Default": "<YOUR_CONNECTION_STRING>"
    }
}

Usage

The Entity Framework implementation can be injected in your program startup via the following services extension function:

services
    .AddEntityFrameworkServices(configuration);

Where configuration is an IConfiguration object with valid connection string data.

From here, you can then make the call to retrieve the schema tables via the ISchemaSearchApplication interface:

var allTables =
    (await
        searchApplication
            .RunAsync())
    .ToList();