[web-devel] [Yesod][Persist] Like keyword

Michael Snoyman michael at snoyman.com
Tue Dec 21 16:37:26 CET 2010


On Tue, Dec 21, 2010 at 1:46 PM, Greg Weber <greg at gregweber.info> wrote:
> mongoDB does not have LIKE. But it has regular expressions, so LIKE is easy
> to implement.
> I doubt Redis has anything here. A true key-value store like Redis already
> doesn't make much sense with the filtering 'Where' queries. I think of
> Persistent not as a key-value friendly store, but as a noSQL friendly
> interface (no joins) that something like MongoDB fits in well.
> The other think to think about is creating better capabilities for allowing
> users to use arbitrary SQL (or mongo queries) with Persistent.

For the SQL backends, I think the problem is that it is not well
documented and could probably have a nice wrapper put around it.
However, running arbitrary queries is definitely supported, and I've
done it in the past to implement full-text search. For those
interested, you'll want the withStmt and execute functions from
Database.Persist.GenericSql.Raw[1].

This is yet another thing I should write a blog post/section in the
Yesod book about.

Michael

[1] http://hackage.haskell.org/packages/archive/persistent/0.3.1.3/doc/html/Database-Persist-GenericSql-Raw.html



More information about the web-devel mailing list