data-api-builder
data-api-builder copied to clipboard
Sql: Improve bootstrap performance by getting all the metadata information in one go from the db
In SqlMetadataProvider, we use different methods to collect metadata information from the underlying database object source:
- a DbDataAdapter to get table columns, their type, and primary key
- GetSchema on Columns to find out if each column has Default value or not.
- Use a ForeignKey Query to derive the referenced table, and the referenced columns.
This involves multiple round trips to the database. This issue is to investigate if we can optimize this bootstrap to acquire all this information in a single roundtrip.