Skip to content
Merged
Show file tree
Hide file tree
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
80 changes: 38 additions & 42 deletions src/content/docs/d1/get-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -121,28 +121,24 @@ To create your first D1 database:
While Wrangler gets installed locally to your project, you can use it outside the project by using the command `npx wrangler`.
:::

```sh
npx wrangler@latest d1 create prod-d1-tutorial
```

```sh output

✅ Successfully created DB 'prod-d1-tutorial' in region WEUR
Created your new D1 database.

{
"d1_databases": [
{
"binding": "DB",
"database_name": "prod-d1-tutorial",
"database_id": "<unique-ID-for-your-database>"
}
]
}

```
```sh
npx wrangler@latest d1 create prod-d1-tutorial
```

```txt output
✅ Successfully created DB 'prod-d1-tutorial' in region WEUR
Created your new D1 database.

{
"d1_databases": [
{
"binding": "DB",
"database_name": "prod-d1-tutorial",
"database_id": "<unique-ID-for-your-database>"
}
]
}
```

</Steps>

Expand Down Expand Up @@ -253,11 +249,11 @@ After correctly preparing your [Wrangler configuration file](/workers/wrangler/c

2. Initialize your database to run and test locally first. Bootstrap your new D1 database by running:

```sh
npx wrangler d1 execute prod-d1-tutorial --local --file=./schema.sql
```
```output
⛅️ wrangler 4.13.2
```sh
npx wrangler d1 execute prod-d1-tutorial --local --file=./schema.sql
```
```txt output
⛅️ wrangler 4.13.2
-------------------

🌀 Executing on local database prod-d1-tutorial (<DATABASE_ID>) from .wrangler/state/v3/d1:
Expand All @@ -275,7 +271,7 @@ After correctly preparing your [Wrangler configuration file](/workers/wrangler/c
npx wrangler d1 execute prod-d1-tutorial --local --command="SELECT * FROM Customers"
```

```sh output
```txt output
🌀 Mapping SQL input into an array of statements
🌀 Executing on local database production-db-backend (<DATABASE_ID>) from .wrangler/state/v3/d1:
┌────────────┬─────────────────────┬───────────────────┐
Expand Down Expand Up @@ -424,7 +420,7 @@ To deploy your Worker to production using Wrangler, you must first repeat the [d
```sh
npx wrangler d1 execute prod-d1-tutorial --remote --file=./schema.sql
```
```sh output
```txt output
✔ ⚠️ This process may take some time, during which your D1 database will be unavailable to serve queries.
Ok to proceed? y
🚣 Executed 3 queries in 0.00 seconds (5 rows read, 6 rows written)
Expand All @@ -441,8 +437,8 @@ To deploy your Worker to production using Wrangler, you must first repeat the [d
```sh
npx wrangler d1 execute prod-d1-tutorial --remote --command="SELECT * FROM Customers"
```
```sh output
⛅️ wrangler 4.13.2
```txt output
⛅️ wrangler 4.13.2
-------------------

🌀 Executing on remote database prod-d1-tutorial (<DATABASE_ID>):
Expand All @@ -466,19 +462,19 @@ To deploy your Worker to production using Wrangler, you must first repeat the [d
```sh
npx wrangler deploy
```
```sh output
⛅️ wrangler 4.13.2
-------------------

Total Upload: 0.19 KiB / gzip: 0.16 KiB
Your worker has access to the following bindings:
- D1 Databases:
- DB: prod-d1-tutorial (<DATABASE_ID>)
Uploaded d1-tutorial (3.76 sec)
Deployed d1-tutorial triggers (2.77 sec)
https://d1-tutorial.<YOUR_SUBDOMAIN>.workers.dev
Current Version ID: <VERSION_ID>
```
```txt output
⛅️ wrangler 4.13.2
-------------------

Total Upload: 0.19 KiB / gzip: 0.16 KiB
Your worker has access to the following bindings:
- D1 Databases:
- DB: prod-d1-tutorial (<DATABASE_ID>)
Uploaded d1-tutorial (3.76 sec)
Deployed d1-tutorial triggers (2.77 sec)
https://d1-tutorial.<YOUR_SUBDOMAIN>.workers.dev
Current Version ID: <VERSION_ID>
```

You can now visit the URL for your newly created project to query your live database.

Expand Down
10 changes: 6 additions & 4 deletions src/content/docs/images/tutorials/optimize-mobile-viewing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,17 @@ There are two possible `loading` attributes for your `<img>` tags: `lazy` and `
Lazy loading is recommended for most images. With Lazy loading, resources like images are deferred until they reach a certain distance from the viewport. If an image does not reach the threshold, then it does not get loaded.

Example of modifying the `loading` attribute of your `<img>` tags to be `"lazy"`:
````HTML

```html
<img src="example.com/cdn-cgi/width=300/image.png" loading="lazy">
````
```

### Eager loading

If you have images that are in the viewport, eager loading, instead of lazy loading, is recommended. Eager loading loads the asset at the initial page load, regardless of its location on the page.

Example of modifying the `loading` attribute of your `<img>` tags to be `"eager"`:
````HTML

```html
<img src="example.com/cdn-cgi/width=300/image.png" loading="eager">
````
```
Loading