Cannot do parallelized "X is one of [A,B,C]" queries
See original GitHub issueThe old DB and NDB libraries offered a way to query a field as a member of a list:
CityTable.query(CityTable.city.IN(city_names)).fetch(100)
I think it should be possible to do this parallelized query in google.cloud.datastore
as well.
The google.cloud.datastore
offers no async API, and so can be an order of magnitude slower when manually stitching together this query, which makes it unusable for my purposes as a replacement for NDB. (I am getting off NDB as it is currently a requirement for getting off python-compat
onto a generic python
runtime.)
The async API bug mentions that an async API is not needed “because NDB exists”, which doesn’t make sense to me because NDB is more than an async API…its also an ORM and an eventloop library and more.
And even the NDB bug talks about how NDB positions as a complex ORM layer vs the simple key-value store of google.cloud.datastore
.
I would like the simple key-value approach combined with a barebones async API, that one could use to implement a “where field is in list” query like the old DB and NDB libraries supported.
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (4 by maintainers)
+1 for adding an async API interface to the google cloud datastore library. I agree with @mikelambert that it should not a requirement to use NDB to gain this async ability (as ndb comes with a number of other things which might be surplus to requirements - e.g. the ORM).
I think this is particularly important as async Python web frameworks are growing in popularity, and other well established frameworks are actively working to support ASGI (biggest example being Django 3). It should not be a pre-requisite for existing apps to migrate to NDB IMO to unlock this functionality.
Hello, feature requests will now be tracked in the project Feature Requests. I will close this issue now, please feel free to continue to address any issues/concerns here.