You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/d1/tutorials/import-to-d1-with-rest-api/index.mdx
+6-7Lines changed: 6 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,20 +33,19 @@ You must have an existing D1 table which matches the schema of the data you wish
33
33
This tutorial uses example data:
34
34
35
35
- A database called `d1-import-tutorial`.
36
-
- A table called `D1TargetTable`
37
-
- Within `D1TargetTable`, three columns called `id`, `text`, and `date_added`.
36
+
- A table called `TargetD1Table`
37
+
- Within `TargetD1Table`, three columns called `id`, `text`, and `date_added`.
38
38
39
39
1. Go to **Storage & Databases > D1**.
40
40
2. Select **Create**.
41
41
3. Name your database. For this tutorial, name your D1 database `d1-import-tutorial`.
42
42
4. (Optional) Provide a location hint. Location hint is an optional parameter you can provide to indicate your desired geographical location for your database. Refer to [Provide a location hint](/d1/build-with-d1/configuration/data-location/#provide-a-location-hint) for more information.
43
43
5. Select **Create**.
44
-
6. Go to **Console**, then paste the following SQL snippet. This creates a table named `D1TargetTable`.
44
+
6. Go to **Console**, then paste the following SQL snippet. This creates a table named `TargetD1Table`.
45
45
46
46
```sql
47
-
DROPTABLE IF EXISTS D1TargetTable;
48
-
CREATETABLEIF NOT EXISTS D1TargetTable (id INTEGERPRIMARY KEY, textTEXT, date_added TEXT);
49
-
);
47
+
DROPTABLE IF EXISTS TargetD1Table;
48
+
CREATETABLEIF NOT EXISTS TargetD1Table (id INTEGERPRIMARY KEY, textTEXT, date_added TEXT);
50
49
```
51
50
52
51
## 3. Create an `index` file
@@ -60,7 +59,7 @@ Define your variables and set:
60
59
-`D1_API_KEY`: The D1 API token generated in [step 1](#1-create-a-d1-api-token)
61
60
62
61
```js title="index"
63
-
constTARGET_TABLE=""; // for the tutorial, `D1TargetTable`
62
+
constTARGET_TABLE=""; // for the tutorial, `TargetD1Table`
0 commit comments