Skip to content

Commit

Permalink
update SQL Server README (#138)
Browse files Browse the repository at this point in the history
<!-- The PR description should answer 2 (maybe 3) important questions:
-->

### What

1. Fix typo
2. Add extra instructions (for webpage rendering, since it does not show
the title of the bash script)

<!-- What is this PR trying to accomplish (and why, if it's not
obvious)? -->
  • Loading branch information
pranshi06 authored Jun 28, 2024
1 parent 63bfe90 commit cd6a57c
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ To use the SQL Server connector, follow these steps in a Hasura project:
ddn connector init my_sql --subgraph my_subgraph --hub-connector hasura/sqlserver
```

### 2. Add your SQLServer credentials:
### 2. Add your SQLServer credentials

Add your credentials to `my_subgraph/connector/my_sql/.env.local`

Expand All @@ -71,7 +71,9 @@ OTEL_SERVICE_NAME=my_subgraph_my_sql
CONNECTION_URI=<YOUR_SQLSERVER_URL>
```

### 3. Intropsect your indices
### 3. Introspect your indices

From the root of your project run:

```bash title="From the root of your project run:"
ddn connector introspect --connector my_subgraph/connector/my_sql/connector.yaml
Expand All @@ -81,6 +83,8 @@ If you look at the `configuration.json` for your connector, you'll see metadata

### 4. Create the Hasura metadata

Run the following from the root of your project:

```bash title="Run the following from the root of your project:"
ddn connector-link add my_sql --subgraph my_subgraph
```
Expand All @@ -96,7 +100,7 @@ MY_SUBGRAPH_MY_SQL_WRITE_URL=http://local.hasura.dev:8081

### 5. Start the connector's docker compose

Let's start our connector's docker compose file.
Let's start our connector's docker compose file. Run the following from the connector's subdirectory inside a subgraph:

```bash title="Run the following from the connector's subdirectory inside a subgraph:"
docker compose -f docker-compose.my_sql.yaml up
Expand All @@ -122,7 +126,7 @@ include:
```
Now, whenever running the following, you'll bring up the GraphQL engine, observability tools, and any connectors you've
included:
included. From your project's root directory, run:
```bash title="From the root of your project, run:"
HASURA_DDN_PAT=$(ddn auth print-pat) docker compose -f docker-compose.hasura.yaml watch
Expand All @@ -132,7 +136,7 @@ HASURA_DDN_PAT=$(ddn auth print-pat) docker compose -f docker-compose.hasura.yam

Finally, now that our `DataConnectorLink` has the correct environment variables configured for the SQL Server connector,
we can run the update command to have the CLI look at the configuration JSON and transform it to reflect our database's
schema in `hml` format. In a new terminal tab, run:
schema in `hml` format. In a new terminal tab from your project's root directory run:

```bash title="From the root of your project, run:"
ddn connector-link update my_sql --subgraph my_subgraph
Expand All @@ -143,7 +147,7 @@ scaffolded out for you 🎉

### 8. Import _all_ your indices

You can do this in one convenience command.
You can do this with just one command. From your project's root directory, run:

```bash title="From the root of your project, run:"
ddn connector-link update my_sql --subgraph my_subgraph --add-all-resources
Expand All @@ -152,7 +156,7 @@ ddn connector-link update my_sql --subgraph my_subgraph --add-all-resources
### 9. Create a supergraph build

Pass the `local` subcommand along with specifying the output directory as `./engine` in the root of the project. This
directory is used by the docker-compose file to serve the engine locally:
directory is used by the docker-compose file to serve the engine locally. From your project's root directory, run:

```bash title="From the root of your project, run:"
ddn supergraph build local --output-dir ./engine
Expand Down

0 comments on commit cd6a57c

Please sign in to comment.