Skip to main content

Posts

Showing posts from May, 2017

How to query data using GQL if your Kind name has a dot in it?

There is a big chance that your kind (table) name is of the format . because there are various tables in your module.

e.g. I had StoreService.Store and StoreService.Employee as two of the kinds in my service named StoreService.

In Google Cloud Console, if you write a GQL to query to fetch/filter the entities you will get an error:

SELECT * from StoreService.Store
GQL query error: Encountered "." at line 1, column 27. Was expecting one of: "group", "limit", "offset", "order", "where"

Enclosing the Kind name in single quotes doesn't help either:

SELECT * from 'StoreService.Store'
GQL query error: Encountered "'StoreService.Store'" at line 1, column 15. Was expecting one of: ,

To do it right, you need to enclose the name in backquotes (that key below ~ in the keyboard)!!!
SELECT * from `StoreService.Store`

This information is hidden in Datastore documentation here. Try finding it!