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
// default pg result object: https://node-postgres.com/api/result
177
190
const { rows, rowCount } =awaitsql.query(db)`select * from movies`
178
191
179
192
// helpers
180
193
constmovies=awaitsql.many(db)`select * from movies`
181
194
constmovie=awaitsql.one(db)`select * from movies where id = ${id}`
182
-
constnbMovie=awaitsql.count(db)`update from movies set name = ${name} where id = ${id}`
195
+
constnbMovie=awaitsql.count(
196
+
db
197
+
)`update from movies set name = ${name} where id = ${id}`
183
198
```
184
199
185
200
You can then rewrite the previous `listMoviesByYear` function in a much more concise way 😎
@@ -214,7 +229,7 @@ const query = sql`
214
229
215
230
### More
216
231
217
-
This package is inspired by the great [sql-template-strings](https://github.com/felixfbecker/node-sql-template-strings). Some interesting features that we were missing:
232
+
This package is inspired by the great [sql-template-strings](https://github.com/felixfbecker/node-sql-template-strings). Some interesting features that we were missing:
0 commit comments