Skip to content

Local GQL queries return null if property name escaped with backticks #159

@devsterj

Description

@devsterj

Consider this query:

fetchOne('SELECT * from Folder WHERE client = @client AND `parent` = @parent', ['client' => $client, 'parent' => $parent])

The query produces null when run in local development mode, though it should return a stored entitity. In GAE, the same query returns actual entity data. The reason I have to use backticks around the parent property is that recently queries with the word "parent" started causing PHP Exceptions on GAE. Apparently "parent" is on the list of reserved query keywords (see: https://cloud.google.com/datastore/docs/reference/gql_reference#keywords_and_predefined_names)

Either "parent" was added to the list recently or I missed it back when I started coding with PHP-GDS. Anyway, for some reason GAE has started reacting to it with an Exception only a few weeks ago -- the code was running fine for a couple of months before that.

It would be nice if the local GQL parser worked with properties surrounded with backticks also (like the GAE interpreter GQL does).

Huge thanks to Tom for all his work on PHP-GDS!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions