-
Notifications
You must be signed in to change notification settings - Fork 603
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
Why is datastore initialized differently than the other libraries? #593
Comments
I would really like to do the last one. @rakyll said to anticipate more things added to Datastore, which was why we couldn't do it. |
I'm down for: var gcloud = require('gcloud')(options);
var datastore = gcloud.datastore(newOptions);
var dataset = datastore.dataset('name of the dataset' /* optional */);
var key = datastore.key('Company');
datastore.save(key, { data: { hello: 'world' } }, callback); The reason we can't kill data set is that we are in the process of adding the ability to have multiple datasets (we'll probably call them databases) per project, so But I still think we need to allow you to configure stuff at the datastore level... ? right? |
Oh, as far as I understand right now we have no concept of a name of a dataset, right? In that case I like my first new proposal where it will just take no options for the time being until this multi-dataset functionality rolls around. This would be a breaking change. |
Don't think this should be a breaking change, right? |
It would be breaking because gcloud.datastore will now be a function that needs to be called with options. datastore.dataset will no longer accept these options. And it doesn't make sense to have it in both places. |
Gotcha - we couldn't make it work with and without the parens? ( |
Maybe but if we're in the business of breaking things with the moving of options from dataset to datastore then we should just break it. Also this is much easier to do pre-1.0 |
Just want to make sure this is correct: // uses dataset-id-1:
var gcloud = require('gcloud')({ projectId: 'dataset-id-1' });
gcloud.datastore.dataset();
// uses dataset-id-2:
var gcloud = require('gcloud')({ projectId: 'dataset-id-1' });
var datastore = gcloud.datastore({ projectId: 'dataset-id-2' });
datastore.dataset();
// uses dataset-id-3:
var gcloud = require('gcloud')({ projectId: 'dataset-id-1' });
var datastore = gcloud.datastore({ projectId: 'dataset-id-2' });
datastore.dataset('dataset-id-3'); // the projectId given above is useless. |
@callmehiphop does this change how you would approach your PR (#845) at all? |
I don't believe so, I think it would simplify the api object creation though. |
This is going to be not-a-thing when datastore v1beta3 is released (see #897). The |
Regenerated the library using [gapic-generator-typescript](https://github.com/googleapis/gapic-generator-typescript) v1.2.1.
🤖 I have created a release *beep* *boop* --- ## [4.0.1](googleapis/nodejs-dataproc@v4.0.0...v4.0.1) (2022-06-20) ### Bug Fixes * **deps:** update dependency @google-cloud/storage to v6 ([#592](googleapis/nodejs-dataproc#592)) ([54ffbec](googleapis/nodejs-dataproc@54ffbec)) * fixes for dynamic routing and streaming descriptors ([#591](googleapis/nodejs-dataproc#591)) ([3d1dc28](googleapis/nodejs-dataproc@3d1dc28)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
🤖 I have created a release *beep* *boop* --- ## [3.1.2](https://github.com/googleapis/nodejs-iot/compare/v3.1.1...v3.1.2) (2022-11-10) ### Bug Fixes * **deps:** Use google-gax v3.5.2 ([#593](https://github.com/googleapis/nodejs-iot/issues/593)) ([2f547e1](https://github.com/googleapis/nodejs-iot/commit/2f547e1c27006a201c9c7066befd35e043fb43c2)) * update protos ([a8e8800](https://github.com/googleapis/nodejs-iot/commit/a8e88006f95594575a70494b1ca5f417e5985765)) * Update protos ([#597](https://github.com/googleapis/nodejs-iot/issues/597)) ([a8e8800](https://github.com/googleapis/nodejs-iot/commit/a8e88006f95594575a70494b1ca5f417e5985765)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [null-loader](https://github.com/webpack-contrib/null-loader) | devDependencies | major | [`^3.0.0` -> `^4.0.0`](https://renovatebot.com/diffs/npm/null-loader/3.0.0/4.0.0) | --- ### Release Notes <details> <summary>webpack-contrib/null-loader</summary> ### [`v4.0.0`](https://github.com/webpack-contrib/null-loader/blob/master/CHANGELOG.md#​400-httpsgithubcomwebpack-contribnull-loadercomparev300v400-2020-04-15) [Compare Source](https://github.com/webpack-contrib/null-loader/compare/v3.0.0...v4.0.0) ##### Bug Fixes - support `webpack@5` ##### ⚠ BREAKING CHANGES - minimum required Nodejs version is `10.13` </details> --- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-dialogflow).
This PR was generated using Autosynth. 🌈 Synth log will be available here: https://source.cloud.google.com/results/invocations/2f68300a-9812-4342-86c6-33ab267ece4f/targets Source-Link: googleapis/synthtool@be74d3e
This PR was generated using Autosynth. 🌈 Synth log will be available here: https://source.cloud.google.com/results/invocations/2f68300a-9812-4342-86c6-33ab267ece4f/targets Source-Link: googleapis/synthtool@be74d3e
* chore: cleanup unused protos in google/cloud/automl/v1 PiperOrigin-RevId: 429068183 Source-Link: googleapis/googleapis@ed90e7c Source-Link: googleapis/googleapis-gen@0070e3e Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDA3MGUzZTIxYzEwMjI1Mjk1MWYzYmI4YjcyNzI3NDVhNTdiYjA2ZSJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
See here for what I'm talking about. Seems that once
gcloud
is initialized, datastore cannot be initialized with different options. I think this is because we delegated it to thedataset
object instead but that just is kinda messy. Would it be worth it to change this to be consistent with the other APIs?Current way:
Proposed way:
ADDITIONAL CRAZY IDEA: What if we just eliminated the
dataset
altogether? Something like:Anything preventing us from doing this?
The text was updated successfully, but these errors were encountered: