https://github.com/dzsquared/dab-dacfx
https://github.com/dzsquared/dab-dacfx
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/dzsquared/dab-dacfx
- Owner: dzsquared
- License: mit
- Created: 2024-06-16T03:13:02.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-18T01:43:41.000Z (almost 2 years ago)
- Last Synced: 2025-02-13T09:15:32.032Z (over 1 year ago)
- Language: C#
- Size: 21.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Dab-DacFx: Generate config entities for Data API Builder with DacFx from a dacpac or a database
Proof of concept.
## Usage
Use an existing dacpac to generate a config file for Data API Builder, including the views.
```bash
dab-dacfx -d "C:\path\to\your\database.dacpac" -c "C:\path\to\your\dab\config.json" -i true
```
### Inputs
| Name | Description | Required | Default |
| --- | --- | --- | --- |
| -d | Path to the dacpac file | true, or -s | |
| -s | Connection string to the database | true, or -d | |
| -c | Path to the config file | true | |
| -i | Include views in the config file | false | false |
| -p | Permissions to apply to the entities | false | "anonymous:*" |
| -h | Show help | false | |
## Notes
There's no library to manipulate the Data API Builder config files, so I went with using the CLI manually.
- https://github.com/Azure/data-api-builder
- https://learn.microsoft.com/en-us/azure/data-api-builder/reference-configuration#actions
The TSqlModel from either the DacPac or the SQL connection will also contain information about foreign keys that can be used to generate the relationships in the config file.