| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 280d567 commit 6c440af
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -540,8 +540,8 @@ sql.run`INSERT INTO users VALUES (1, 'Alice')`; | |||
| 540 | 540 | sql.run`INSERT INTO users VALUES (2, 'Bob')`; | |
| 541 | 541 | ||
| 542 | 542 | // Using the 'get' method to retrieve a single row. | |
| 543 | - const id = 1; | ||
| 544 | - const user = sql.get`SELECT * FROM users WHERE id = ${id}`; | ||
| 543 | + const name = 'Alice'; | ||
| 544 | + const user = sql.get`SELECT * FROM users WHERE name = ${name}`; | ||
| 545 | 545 | console.log(user); // { id: 1, name: 'Alice' } | |
| 546 | 546 | ||
| 547 | 547 | // Using the 'all' method to retrieve all rows. | |
@@ -567,8 +567,8 @@ sql.run`INSERT INTO users VALUES (1, 'Alice')`; | |||
| 567 | 567 | sql.run`INSERT INTO users VALUES (2, 'Bob')`; | |
| 568 | 568 | ||
| 569 | 569 | // Using the 'get' method to retrieve a single row. | |
| 570 | - const id = 1; | ||
| 571 | - const user = sql.get`SELECT * FROM users WHERE id = ${id}`; | ||
| 570 | + const name = 'Alice'; | ||
| 571 | + const user = sql.get`SELECT * FROM users WHERE name = ${name}`; | ||
| 572 | 572 | console.log(user); // { id: 1, name: 'Alice' } | |
| 573 | 573 | ||
| 574 | 574 | // Using the 'all' method to retrieve all rows. | |
| Back | FazBrowse Home | New Git URL |
0 commit comments