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: 05-query-d1/README.md
+12-4Lines changed: 12 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,18 +5,26 @@ Warning: Python support in Workers is experimental and things will break. This d
5
5
Currently, Python Workers using packages cannot be deployed and will only work in local development for the time being.
6
6
7
7
### How to Run
8
+
8
9
Download this quotes file from [Hugging Face in SQL form](https://huggingface.co/datasets/lizziepika/quotes_sql/blob/main/data.sql)
9
10
10
11
Create a new D1 database by running on the command line `npx wrangler d1 create {D1-NAME}`. Copy and paste the output into your `wrangler.toml` to bind your D1 database to your Python Worker.
Ensure that your Wrangler version is up to date (3.30.0 and above).
13
20
14
21
```
15
22
$ wrangler -v
16
23
⛅️ wrangler 3.30.0
17
-
```
18
-
Now, if you run `wrangler dev` within this directory, it should use the config in`wrangler.toml` to run the demo.
24
+
```
25
+
26
+
Now, if you run `wrangler dev` within this directory, it should use the config in `wrangler.toml` to run the demo.
19
27
20
-
You can also run `wrangler deploy` to deploy the demo.
28
+
You can also run `wrangler deploy` to deploy the demo (though you'll need to repeat the ingestion step above for the remote DB).
21
29
22
-
Finally, get a random quote from the database by visiting your deployed worker in the browser!<imgwidth="1421"alt="deployed app"src="https://github.com/user-attachments/assets/131a2836-2305-4b73-a54a-50dac039108f">
30
+
Finally, get a random quote from the database by visiting your deployed worker in the browser!<imgwidth="1421"alt="deployed app"src="https://github.com/user-attachments/assets/131a2836-2305-4b73-a54a-50dac039108f">
0 commit comments