Hi all, How DAL is supported json query? My test is on Web2py by source code v.2.10.3, PostgreSQL 9.4:
db.define_table('person', Field('name','string'), Field('jdata','json')) db.person.insert(name='Adam',jdata='{"age":30}') print db.executesql('SELECT * FROM person WHERE (jdata ->> "age") > "20";') I get this error: Traceback (most recent call last): File "E:\GDriver\web2py\gluon\restricted.py", line 227, in restricted exec ccode in environment File "E:/GDriver/web2py/applications/form/models/db.py" <http://127.0.0.1:8000/admin/default/edit/form/models/db.py>, line 103, in <module> print db.executesql('SELECT * FROM hoso WHERE (jdata ->> "age") > "20";') File "E:\GDriver\web2py\gluon\packages\dal\pydal\base.py", line 1028, in executesql adapter.execute(query) File "E:\GDriver\web2py\gluon\packages\dal\pydal\adapters\base.py", line 1326, in execute return self.log_execute(*a, **b) File "E:\GDriver\web2py\gluon\packages\dal\pydal\adapters\base.py", line 1320, in log_execute ret = self.cursor.execute(command, *a[1:], **b) File "E:\GDriver\web2py\gluon\contrib\pg8000\core.py", line 573, in execute self._c.execute(self, operation, args) File "E:\GDriver\web2py\gluon\contrib\pg8000\core.py", line 1626, in execute self.handle_messages(cursor) File "E:\GDriver\web2py\gluon\contrib\pg8000\core.py", line 1774, in handle_messages raise self.error ProgrammingError: ('ERROR', '42703', 'column "age" does not exist') -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.