+1
src/database/post.v
+1
src/database/post.v
···
164
// todo: query options/filters, such as user:beep, !excluded-text, etc
165
pub fn (app &DatabaseAccess) search_for_posts(query string, limit int, offset int) []PostSearchResult {
166
println('searching, q=${query},l=${limit},o=${offset}')
167
posts := sql app.db {
168
select from Post where title like '%${query}%' order by posted_at desc limit limit offset offset
169
} or { [] }
···
164
// todo: query options/filters, such as user:beep, !excluded-text, etc
165
pub fn (app &DatabaseAccess) search_for_posts(query string, limit int, offset int) []PostSearchResult {
166
println('searching, q=${query},l=${limit},o=${offset}')
167
+
//todo: app.db.q_strings('select from Post where title like \'%${query}%\' or body like \'%${query}%\' order by posted_at desc limit limit offset offset')
168
posts := sql app.db {
169
select from Post where title like '%${query}%' order by posted_at desc limit limit offset offset
170
} or { [] }
+1
-1
src/templates/search.html
+1
-1
src/templates/search.html