SQLite doesn't have an `RLIKE` function, so the query for hashtagged
posts was failing before. This adds a `regexp` function to SQLite and
correctly retrieves all posts on a blog with the requested hashtag.
This closes#55
@ -1139,7 +1139,14 @@ func (db *datastore) GetPostsTagged(c *Collection, tag string, page int, include
if!includeFuture{
timeCondition="AND created <= "+db.now()
}
rows,err:=db.Query("SELECT "+postCols+" FROM posts WHERE collection_id = ? AND LOWER(content) RLIKE ? "+timeCondition+" ORDER BY created "+order+limitStr,collID,"#"+strings.ToLower(tag)+"[[:>:]]")
varrows*sql.Rows
varerrerror
ifdb.driverName==driverSQLite{
rows,err=db.Query("SELECT "+postCols+" FROM posts WHERE collection_id = ? AND LOWER(content) regexp ? "+timeCondition+" ORDER BY created "+order+limitStr,collID,`.*#`+strings.ToLower(tag)+`\b.*`)
}else{
rows,err=db.Query("SELECT "+postCols+" FROM posts WHERE collection_id = ? AND LOWER(content) RLIKE ? "+timeCondition+" ORDER BY created "+order+limitStr,collID,"#"+strings.ToLower(tag)+"[[:>:]]")