Skip to content

Commit a74affb

Browse files
authored
Fix some Gel related documentation things (#551)
* Fix gel example object name * Fix step numbering * Remove unused reference to gel CLI Typically we direct people to use `npx gel` which handles downloading, installing, and running the CLI. The `-new` docs already reflected this, so just remove the extra reference to it here. * A few more minor alignments
1 parent 71fb10b commit a74affb

File tree

2 files changed

+15
-18
lines changed

2 files changed

+15
-18
lines changed

src/content/docs/get-started/gel-existing.mdx

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import SetupEnv from '@mdx/get-started/SetupEnv.mdx';
2525
<Prerequisites>
2626
- **tsx** - package for running TypeScript files - [read here](https://tsx.is/)
2727
- **gel-js** - package for querying your Gel database - [read here](https://github.com/geldata/gel-js)
28-
- **gel** - cli tool to manage your Gel database - [read here](https://docs.geldata.com/reference/cli)
2928
</Prerequisites>
3029

3130
Drizzle has native support for Gel connections with the `gel` client.
@@ -47,13 +46,13 @@ This is the basic file structure of the project. In the `src` directory, we have
4746
└ 📜 tsconfig.json
4847
```
4948

50-
#### Step 4 - Install **gel** package
49+
#### Step 1 - Install required packages
5150
<Npm>
5251
drizzle-orm gel
5352
-D drizzle-kit tsx
5453
</Npm>
5554

56-
#### Step 5 - Setup Drizzle config file
55+
#### Step 2 - Setup Drizzle config file
5756

5857
**Drizzle config** - a configuration file that is used by [Drizzle Kit](/docs/kit-overview) and contains all the information about your database connection, migration folder and schema files.
5958

@@ -67,7 +66,7 @@ export default defineConfig({
6766
});
6867
```
6968

70-
#### Step 6 - Pull Gel types to Drizzle schema
69+
#### Step 3 - Pull Gel types to Drizzle schema
7170

7271
Pull your database schema:
7372
<Npx>
@@ -76,8 +75,7 @@ drizzle-kit pull
7675

7776
Here is an example of the generated schema.ts file:
7877

79-
```ts
80-
// drizzle/schema.ts
78+
```typescript filename="drizzle/schema.ts"
8179
import { gelTable, uniqueIndex, uuid, smallint, text } from "drizzle-orm/gel-core"
8280
import { sql } from "drizzle-orm"
8381

@@ -91,19 +89,19 @@ export const users = gelTable("users", {
9189
]);
9290
```
9391

94-
#### Step 6 - Connect Drizzle ORM to the database
92+
#### Step 4 - Connect Drizzle ORM to the database
9593

9694
Create a `index.ts` file in the `src` directory and initialize the connection:
9795

98-
```typescript copy
96+
```typescript copy filename="src/index.ts"
9997
import { drizzle } from "drizzle-orm/gel";
10098
import { createClient } from "gel";
10199

102100
const gelClient = createClient();
103101
const db = drizzle({ client: gelClient });
104102
```
105103

106-
#### Step 7 - Query the database
104+
#### Step 5 - Query the database
107105

108106
```typescript copy filename="src/index.ts"
109107
import { eq } from "drizzle-orm";
@@ -150,6 +148,6 @@ async function main() {
150148
main();
151149
```
152150

153-
#### Step 8 - Run index.ts file
151+
#### Step 6 - Run index.ts file
154152

155153
<RunFile/>

src/content/docs/get-started/gel-new.mdx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ In `dbschema/default.esdl` file add a basic Gel schema
5353

5454
```esdl
5555
module default {
56-
TYPE test {
56+
type user {
5757
name: str;
5858
required email: str;
5959
age: int16;
@@ -91,7 +91,7 @@ Now you should have this file structure
9191
```
9292
</Callout>
9393

94-
#### Step 4 - Install **gel** package
94+
#### Step 4 - Install required packages
9595
<Npm>
9696
drizzle-orm gel
9797
-D drizzle-kit tsx
@@ -120,8 +120,7 @@ drizzle-kit pull
120120

121121
Here is an example of the generated schema.ts file:
122122

123-
```ts
124-
// drizzle/schema.ts
123+
```typescript filename="drizzle/schema.ts"
125124
import { gelTable, uniqueIndex, uuid, smallint, text } from "drizzle-orm/gel-core"
126125
import { sql } from "drizzle-orm"
127126

@@ -135,19 +134,19 @@ export const users = gelTable("users", {
135134
]);
136135
```
137136

138-
#### Step 6 - Connect Drizzle ORM to the database
137+
#### Step 7 - Connect Drizzle ORM to the database
139138

140139
Create a `index.ts` file in the `src` directory and initialize the connection:
141140

142-
```typescript copy
141+
```typescript copy filename="src/index.ts"
143142
import { drizzle } from "drizzle-orm/gel";
144143
import { createClient } from "gel";
145144

146145
const gelClient = createClient();
147146
const db = drizzle({ client: gelClient });
148147
```
149148

150-
#### Step 7 - Query the database
149+
#### Step 8 - Query the database
151150

152151
```typescript copy filename="src/index.ts"
153152
import { eq } from "drizzle-orm";
@@ -194,6 +193,6 @@ async function main() {
194193
main();
195194
```
196195

197-
#### Step 8 - Run index.ts file
196+
#### Step 9 - Run index.ts file
198197

199198
<RunFile/>

0 commit comments

Comments
 (0)