Skip to content

Instantly share code, notes, and snippets.

@dapangmao
Created June 6, 2017 18:20
Show Gist options
  • Save dapangmao/06dab65d3c76d57ed540ef0cd4dfe857 to your computer and use it in GitHub Desktop.
Save dapangmao/06dab65d3c76d57ed540ef0cd4dfe857 to your computer and use it in GitHub Desktop.

postgret的select查询规则如下所示,使用get方式提交请求:

http://localhost:3000/stock_info?select=close,tradingdate&tradingdate=lt.20160429&order=close.desc&limit=15 url中包含表名?select=字段名1,字段名2&过滤条件字段=比较运算符.值&order=排序字段.正序&limit=数量

其中比较运算符包括:

abbreviation	meaning
eq	equals
gte	greater than or equal
gt	greater than
lte	less than or equal
lt	less than
neq	not equal
like	LIKE operator (use * in place of %)
ilike	ILIKE operator (use * in place of %)
in	one of a list of values e.g. ?a=in.1,2,3
is	checking for exact equality (null,true,false)
@@	full-text search using to_tsquery
@>	contains e.g. ?tags=@>.{example, new}
<@	contained in e.g. ?values=<@{1,2,3}
not	negates another operator, see below
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment