| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ca5720e commit bebb473
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -550,8 +550,8 @@ sql.run`INSERT INTO users VALUES (1, 'Alice')`; | |||
| 550 | 550 | sql.run`INSERT INTO users VALUES (2, 'Bob')`; | |
| 551 | 551 | ||
| 552 | 552 | // Using the 'get' method to retrieve a single row. | |
| 553 | - const id = 1; | ||
| 554 | - const user = sql.get`SELECT * FROM users WHERE id = ${id}`; | ||
| 553 | + const name = 'Alice'; | ||
| 554 | + const user = sql.get`SELECT * FROM users WHERE name = ${name}`; | ||
| 555 | 555 | console.log(user); // { id: 1, name: 'Alice' } | |
| 556 | 556 | ||
| 557 | 557 | // Using the 'all' method to retrieve all rows. | |
@@ -577,8 +577,8 @@ sql.run`INSERT INTO users VALUES (1, 'Alice')`; | |||
| 577 | 577 | sql.run`INSERT INTO users VALUES (2, 'Bob')`; | |
| 578 | 578 | ||
| 579 | 579 | // Using the 'get' method to retrieve a single row. | |
| 580 | - const id = 1; | ||
| 581 | - const user = sql.get`SELECT * FROM users WHERE id = ${id}`; | ||
| 580 | + const name = 'Alice'; | ||
| 581 | + const user = sql.get`SELECT * FROM users WHERE name = ${name}`; | ||
| 582 | 582 | console.log(user); // { id: 1, name: 'Alice' } | |
| 583 | 583 | ||
| 584 | 584 | // Using the 'all' method to retrieve all rows. | |
| Back | FazBrowse Home | New Git URL |
0 commit comments