Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic GQL parser for local development server #44

Closed
tomwalder opened this issue Jun 24, 2015 · 8 comments
Closed

Add basic GQL parser for local development server #44

tomwalder opened this issue Jun 24, 2015 · 8 comments
Assignees

Comments

@tomwalder
Copy link
Owner

Currently, the local development server does not support GQL queries.

This means that you can write to the Datastore, do basic fetchByName and fetchById queries, but not much more.

The idea with this issue to to build a basic GQL parser to support the core "SELECT * FROM" syntax against the Datastore by turning the GQL into structured lookups which are supported locally.

@oleaan
Copy link

oleaan commented Jul 6, 2015

I find it extremely weird that the local development server does not support GQL counting that its sole purpose is to develop applications locally before you deploy them.

The ball is in Google's hands right now, therefore I don't it's necessary to add such a feature to the library. I bet you GQL support is just around the corner.

An official statement from Google regarding this issue would have been nice.

@tomwalder tomwalder self-assigned this Jul 7, 2015
@tomwalder
Copy link
Owner Author

This is now in progress

@tomwalder tomwalder added this to the 2.x Series milestone Jul 7, 2015
@tomwalder tomwalder changed the title Add basic GQL parser for local dev server Add basic GQL parser for local development server Jul 7, 2015
@tomwalder
Copy link
Owner Author

Closing this as GQL parser now included in beta 2

@mivale
Copy link

mivale commented Jul 9, 2015

I have followed the example in list_fetch.php but somehow the gql parser does not find any records when I run it with a query against a local datastore

SELECT * FROM Server WHERE field = 'value'

yields no records, whereas

SELECT * FROM Server

yields the 2 records I have

I've installed via composer using dev-master and have checked to see if the latest commit on master has been incorparted in my local code and it has. My code is executing via the ProtoBuf Gateway

I'm running this on GAE release: "1.9.23"
timestamp: 1433876744
api_versions: ['1']

I personally don't need GQL (a basic comparison on fields suits my need) but since this is not possible in php-gds (I haven't found it anyway either in the docs or the examples or the source) I think that we actually do need a working GQL in de local version ;-)

I wouldn't mind even creating my own fetchBy{Mykey} methods if the docs or the code would somehow make it clear. Maybe you could shed some light on this?

BTW, thanks for making a fine library as this. I hope we can make it even better!

@tomwalder
Copy link
Owner Author

Hi there,

Could you add a new issue for the fetchByProperty('property', 'value') feature request?

As for your current situation, are the records in the Datastore indexed on "field" ? Have you defined a Schema?

@tomwalder tomwalder reopened this Jul 9, 2015
@tomwalder
Copy link
Owner Author

Hi again,

I have added support for single quoted string parameters (previously only supported backtick and double-quoted). This should fix your issue.

The "recommended" way to pass parameters in to GQL queries is using the parameter binding.

Either way, this issue is fixed.

Thanks for reporting!

@mivale
Copy link

mivale commented Jul 9, 2015

Hi Tom,

Thanks for adding it. It works!

Did you maybe remove it at one point? It's in the examples (list_fetch.php@24), that's why i used it :-)

I'll add an issue for fetchByProperty

@tomwalder
Copy link
Owner Author

No problem!

Until recently the whole library only worked against the remote or "live" D
atastore.

But in version 2.0 I've added support for the local Datastore - and that's
where the problem was.

Had you deployed your code to App Engine it would have worked!

Good luck.

Tom

On Thursday, July 9, 2015, Michiel van Leening notifications@github.com
wrote:

Hi Tom,

Thanks for adding it. It works!

Did you maybe remove it at one point? It's in the examples
(list_fetch.php@24), that's why i used it :-)

I'll add an issue for fetchByProperty


Reply to this email directly or view it on GitHub
#44 (comment).

Tom Walder, CTO_Call_: 0845 521 0444 / Web: www.docnet.nu
http://www.docnet.nu/?utm_source=email_signature&utm_medium=email&utm_campaign=email_signatureThis
message is private and confidential. If you have received this message in
error, please notify us and remove it from your system. Venditan Limited
t/a Docnet is a company registered in England and Wales. Registered number:
9604502. Registered office: Speakers House, 39 Deansgate, Manchester, M3 2BA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants