Skip to content

Commit acbc7fb

Browse files
authored
command reference for generate schema-from-database (#8266)
1 parent 48d5480 commit acbc7fb

File tree

1 file changed

+20
-0
lines changed
  • src/pages/[platform]/reference/cli-commands

1 file changed

+20
-0
lines changed

src/pages/[platform]/reference/cli-commands/index.mdx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,26 @@ npx ampx generate graphql-client-code --format modelgen --type-target angular
332332
| Modelgen | Amplify Flutter | `amplify codegen model` | `npx ampx generate graphql-client-code --format modelgen --model-target dart --out <path_to_flutter_project>/AmplifyModels` | `<path_to_flutter_project>/AmplifyModels` |
333333

334334

335+
## npx ampx generate schema-from-database
336+
337+
Generates typescript data schema from a SQL database.
338+
339+
### Options
340+
341+
- `--stack`(_string_) - A stack name that contains an Amplify backend.
342+
- `--branch` (_string_) - Name of the git branch being deployed.
343+
- `--app-id` (_string_) - The app id of the target Amplify app.
344+
- `--out`(_string_) - A path to directory where generated schema is written [default: `./amplify/data/schema.sql.ts`].
345+
- `--connection-uri-secret`(_string_) - Amplify secret name for the database connection uri.
346+
- `--ssl-cert-secret`(_string_) - Amplify secret name for the database ssl certificate.
347+
- `--profile`(_string_) - An AWS profile name.
348+
349+
### Usage
350+
351+
```bash title="Terminal" showLineNumbers={false}
352+
npx ampx generate schema-from-database --connection-uri-secret SQL_CONNECTION_STRING --out amplify/data/schema.sql.ts
353+
```
354+
335355
## npx ampx generate forms
336356

337357
Generate React form components derived from your backend data models for your frontend application to consume.

0 commit comments

Comments
 (0)