Skip to content

command reference for generate schema-from-database #8266

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 25, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/pages/[platform]/reference/cli-commands/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,26 @@ npx ampx generate graphql-client-code --format modelgen --type-target angular
| 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` |


## npx ampx generate schema-from-database

Generates typescript data schema from a SQL database.

### Options

- `--stack`(_string_) - A stack name that contains an Amplify backend.
- `--branch` (_string_) - Name of the git branch being deployed.
- `--app-id` (_string_) - The app id of the target Amplify app.
- `--out`(_string_) - A path to directory where generated schema is written [default: `./amplify/data/schema.sql.ts`].
- `--connection-uri-secret`(_string_) - Amplify secret name for the database connection uri.
- `--ssl-cert-secret`(_string_) - Amplify secret name for the database ssl certificate.
- `--profile`(_string_) - An AWS profile name.

### Usage

```bash title="Terminal" showLineNumbers={false}
npx ampx generate schema-from-database --connection-uri-secret SQL_CONNECTION_STRING --out amplify/data/schema.sql.ts
```

## npx ampx generate forms

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