tests/blogdb/sql/blogs/blogs_sqlite.sql
raw| 1 | -- name: sqlite-get-blogs-published-after |
| 2 | -- Get all blogs by all authors published after the given date. |
| 3 | select b.title, |
| 4 | u.username, |
| 5 | strftime('%Y-%m-%d %H:%M', b.published) as published |
| 6 | from blogs b |
| 7 | inner join users u on b.userid = u.userid |
| 8 | where b.published >= :published |
| 9 | order by b.published desc; |
| 10 | |
| 11 | |
| 12 | -- name: sqlite-bulk-publish*! |
| 13 | -- Insert many blogs at once |
| 14 | insert into blogs ( |
| 15 | userid, |
| 16 | title, |
| 17 | content, |
| 18 | published |
| 19 | ) |
| 20 | values (?, ?, ? , ?); |