Skip to content

Instantly share code, notes, and snippets.

@cjauvin
Created December 11, 2012 22:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cjauvin/4262882 to your computer and use it in GitHub Desktop.
Save cjauvin/4262882 to your computer and use it in GitHub Desktop.
where = {}
where['adjective'] = 'Lucid'
# where adjective = 'Lucid'
where['adjective'] = ('Warty', 'Dapper')
# where adjective in ('Warty', 'Dapper')
# For sequence values, the rules are: a tuple translates
# to the 'in' operator (as above), a list to a PG array
# and a set to a conjunction of predicates (see below)
where[('version::real', '<=')] = 10.04
# where version::real <= 10.04
where[('adjective', 'ilike')] = {'%lucid%', '%lynx%'}
# where adjective ilike '%lucid%' and adjective ilike '%lynx%'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment