Get started with Data API Builder
Esta página aún no está disponible en tu idioma.
⭐ Community Toolkit
Data API Builder (DAB) generates REST and GraphQL endpoints from a database schema and a declarative configuration file. The Aspire hosting integration runs DAB as a container, passes database connections to it, and exposes its HTTP endpoint to consuming apps.
Why use Data API Builder with Aspire
Section titled “Why use Data API Builder with Aspire”- One application model. Model DAB, its databases, and its consuming apps in the same AppHost.
- Configuration-file mounting. Aspire mounts one or more DAB configuration files into the container.
- Database reference injection. Referenced database resources provide the connection strings that DAB reads from its configuration.
- Service discovery. Consuming apps can resolve the DAB HTTP endpoint by resource name or read its endpoint environment variable.
- Language-neutral APIs. C#, TypeScript, Python, and Go apps can use any standard HTTP or GraphQL client.
How the pieces fit together
Section titled “How the pieces fit together”architecture-beta group apphost(server)[AppHost] group consumer(server)[Consuming app] service database(database)[Database] in apphost service dab(server)[Data API Builder] in apphost service app(server)[Application] in consumer database:R --> L:dab dab:R --> L:app
-
Model Data API Builder in the AppHost
Section titled “Model Data API Builder in the AppHost”Add the hosting integration, provide a DAB configuration file, and reference each database that the API exposes.
Set up Data API Builder
-
Connect from an app
Section titled “Connect from an app”Reference DAB from the consuming app, then call its REST or GraphQL endpoint with the HTTP client for your language.
Connect to Data API Builder