-
Notifications
You must be signed in to change notification settings - Fork 106
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
feat: Support for using multiple databases in datastore #1090
Commits on Mar 20, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 11524c1 - Browse repository at this point
Copy the full SHA 11524c1View commit details -
A simple test with multidb support
Adds databaseId to the request options, client options and code for carrying over the client options to the request options as well as a test to make sure it actually works.
Configuration menu - View commit details
-
Copy full SHA for e06bee0 - Browse repository at this point
Copy the full SHA e06bee0View commit details -
Merge branch 'multi-db' of https://github.com/danieljbruce/nodejs-dat…
…astore into multi-db
Configuration menu - View commit details
-
Copy full SHA for 1f464a5 - Browse repository at this point
Copy the full SHA 1f464a5View commit details -
Add additional checks with get
The test should include additional checks to ensure get is running the way it is supposed to.
Configuration menu - View commit details
-
Copy full SHA for 10da9c8 - Browse repository at this point
Copy the full SHA 10da9c8View commit details -
Configuration menu - View commit details
-
Copy full SHA for ecfce7d - Browse repository at this point
Copy the full SHA ecfce7dView commit details -
other datastore should delete the entity
Since we are saving things to another datastore we need to delete the data from that datastore.
Configuration menu - View commit details
-
Copy full SHA for 3b6a42c - Browse repository at this point
Copy the full SHA 3b6a42cView commit details -
Add a test for the getDatastore method
The user needs a way to get the database Id from the client so that they can keep track of their clients more easily.
Configuration menu - View commit details
-
Copy full SHA for e254be5 - Browse repository at this point
Copy the full SHA e254be5View commit details -
Add a unit test for database id
Ensure that the database id gets passed all the way down to the generated layer and gets included in the request.
Configuration menu - View commit details
-
Copy full SHA for 77970c8 - Browse repository at this point
Copy the full SHA 77970c8View commit details -
Do an additional check for the sake of tests
We should check for the existance of datastore.options so that the code doesn’t fail if they are not provided at all.
Configuration menu - View commit details
-
Copy full SHA for 3b86ce2 - Browse repository at this point
Copy the full SHA 3b86ce2View commit details -
initialize generated client so it can be mocked
The test on kokoro is failing because in that environment a project id isn’t defined. The solution is to eliminate the get request so that a call never reaches the backend and initialize the gapic client so it can be mocked out and then catch any call that reaches the mock.
Configuration menu - View commit details
-
Copy full SHA for ea54946 - Browse repository at this point
Copy the full SHA ea54946View commit details
Commits on Mar 21, 2023
-
Add docs comments for newly added functions and add a test that ensures setDatabaseId works correctly.
Configuration menu - View commit details
-
Copy full SHA for 38d955c - Browse repository at this point
Copy the full SHA 38d955cView commit details -
Don’t use the same string multiple times. When the database name we are using for testing changes then we should only have to make that change in one place.
Configuration menu - View commit details
-
Copy full SHA for 57bc2eb - Browse repository at this point
Copy the full SHA 57bc2ebView commit details -
correction to test against old database
This was a typo. We want to test against the database we were using before
Configuration menu - View commit details
-
Copy full SHA for c9856b2 - Browse repository at this point
Copy the full SHA c9856b2View commit details
Commits on Mar 22, 2023
-
getRequestWithDatabaseId function
Add the getRequestWithDatabaseId function and change it so that it can easily be used in multiple places and the tests still pass.
Configuration menu - View commit details
-
Copy full SHA for 543e486 - Browse repository at this point
Copy the full SHA 543e486View commit details -
Change function name to addDatabaseIdToRequest
The request options should contain databaseId so rename the function as appropriate.
Configuration menu - View commit details
-
Copy full SHA for dde1eba - Browse repository at this point
Copy the full SHA dde1ebaView commit details -
Comments in all the places to add reqOpts
This commit contains a comment in all the places we want to add the reqOpts change.
Configuration menu - View commit details
-
Copy full SHA for 8ba512a - Browse repository at this point
Copy the full SHA 8ba512aView commit details -
Add a warning to a certain test for easier debug
Add a warning because the way the assert checking was done before, the test suite was not receiving any indication of which test was failing which makes debugging really hard.
Configuration menu - View commit details
-
Copy full SHA for de946b2 - Browse repository at this point
Copy the full SHA de946b2View commit details -
Configuration menu - View commit details
-
Copy full SHA for dd7b06c - Browse repository at this point
Copy the full SHA dd7b06cView commit details -
Add request ids back in all the places they are required
Configuration menu - View commit details
-
Copy full SHA for f167ce3 - Browse repository at this point
Copy the full SHA f167ce3View commit details -
Add addDatabaseIdToRequest to the transaction test framework so that it can be used in the tests.
Configuration menu - View commit details
-
Copy full SHA for 364845b - Browse repository at this point
Copy the full SHA 364845bView commit details -
Solve all the test errors for createReadStream
Mock out add database id for the tests in createReadStream that correspond to createReadStream.
Configuration menu - View commit details
-
Copy full SHA for 7b5f902 - Browse repository at this point
Copy the full SHA 7b5f902View commit details -
addDatabaseIdToRequest mock for runQueryStream
Add the addDatabaseIdToRequest mock to the tests for every runQueryStream test so that the tests pass.
Configuration menu - View commit details
-
Copy full SHA for a3bdb92 - Browse repository at this point
Copy the full SHA a3bdb92View commit details -
By default, mock out addDatabaseIdToRequest
addDatabaseIdToRequest should be a default function in datastore object of request so that we don’t have to mock it out in many different places.
Configuration menu - View commit details
-
Copy full SHA for 9d7fab1 - Browse repository at this point
Copy the full SHA 9d7fab1View commit details -
Revert "addDatabaseIdToRequest mock for runQueryStream"
This reverts commit a3bdb92.
Configuration menu - View commit details
-
Copy full SHA for d9a96bf - Browse repository at this point
Copy the full SHA d9a96bfView commit details -
Revert "Solve all the test errors for createReadStream"
This reverts commit 7b5f902.
Configuration menu - View commit details
-
Copy full SHA for 7543f57 - Browse repository at this point
Copy the full SHA 7543f57View commit details
Commits on Mar 23, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 3f3e965 - Browse repository at this point
Copy the full SHA 3f3e965View commit details -
Configuration menu - View commit details
-
Copy full SHA for 32bb92b - Browse repository at this point
Copy the full SHA 32bb92bView commit details -
Revert "This fixed the bug for the save operation"
This reverts commit dd7b06c.
Configuration menu - View commit details
-
Copy full SHA for 92f8778 - Browse repository at this point
Copy the full SHA 92f8778View commit details -
Revert "Comments in all the places to add reqOpts"
This reverts commit 8ba512a.
Configuration menu - View commit details
-
Copy full SHA for 6159882 - Browse repository at this point
Copy the full SHA 6159882View commit details -
Introduce addDatabaseIdRequest in request
Introduce adding the databaseId in request layer again.
Configuration menu - View commit details
-
Copy full SHA for 9410652 - Browse repository at this point
Copy the full SHA 9410652View commit details -
Declare a constant so that tests don’t run
Importing test into the system-test folder causes the system-test command to also run the tests. Eliminate this import.
Configuration menu - View commit details
-
Copy full SHA for b34bf17 - Browse repository at this point
Copy the full SHA b34bf17View commit details
Commits on Mar 28, 2023
-
Remove setDatabaseId as it provides a way for the user to get confused about the current state of the client.
Configuration menu - View commit details
-
Copy full SHA for 2e1999a - Browse repository at this point
Copy the full SHA 2e1999aView commit details -
Add comment for addDatabaseIdToRequest function
The function needs a comment to be consistent with docs.
Configuration menu - View commit details
-
Copy full SHA for bd97d00 - Browse repository at this point
Copy the full SHA bd97d00View commit details -
Configuration menu - View commit details
-
Copy full SHA for d41ca60 - Browse repository at this point
Copy the full SHA d41ca60View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1519ad3 - Browse repository at this point
Copy the full SHA 1519ad3View commit details -
Add databaseId for encoding and decoding keys
The databaseId should be encoded on keys so that the user can write on a record by record basis
Configuration menu - View commit details
-
Copy full SHA for 0ebabd5 - Browse repository at this point
Copy the full SHA 0ebabd5View commit details
Commits on Mar 29, 2023
-
Revert "Add databaseId for encoding and decoding keys"
This reverts commit 0ebabd5.
Configuration menu - View commit details
-
Copy full SHA for 6449d10 - Browse repository at this point
Copy the full SHA 6449d10View commit details -
Try out a new test that looks at data details
Configuration menu - View commit details
-
Copy full SHA for e9ee522 - Browse repository at this point
Copy the full SHA e9ee522View commit details -
Use the other datastore in the test
Use another datastore with key
Configuration menu - View commit details
-
Copy full SHA for 1ba9756 - Browse repository at this point
Copy the full SHA 1ba9756View commit details -
Create a test that looks at specific details
The test should look at specific details in the key and should return the data with the right author.
Configuration menu - View commit details
-
Copy full SHA for d35cdee - Browse repository at this point
Copy the full SHA d35cdeeView commit details -
Add additional checks to existing test
Add additional checks to existing test to show default database is unaffected.
Configuration menu - View commit details
-
Copy full SHA for 769417d - Browse repository at this point
Copy the full SHA 769417dView commit details -
Revert "Revert "Add databaseId for encoding and decoding keys""
This reverts commit 6449d10.
Configuration menu - View commit details
-
Copy full SHA for e694341 - Browse repository at this point
Copy the full SHA e694341View commit details -
Revert "Revert "Revert "Add databaseId for encoding and decoding keys"""
This reverts commit e694341.
Configuration menu - View commit details
-
Copy full SHA for f307f4d - Browse repository at this point
Copy the full SHA f307f4dView commit details
Commits on Mar 31, 2023
-
Merge branch 'main' of https://github.com/googleapis/nodejs-datastore …
…into multi-db # Conflicts: # system-test/datastore.ts
Configuration menu - View commit details
-
Copy full SHA for 0f27ea4 - Browse repository at this point
Copy the full SHA 0f27ea4View commit details
Commits on May 10, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 76a3dfc - Browse repository at this point
Copy the full SHA 76a3dfcView commit details
Commits on May 19, 2023
-
Use the database called multidb-test
multidb-test is the name of the database set up on the project used in Github automation so we need to change this name in code to use that new database.
Configuration menu - View commit details
-
Copy full SHA for 3fd19fb - Browse repository at this point
Copy the full SHA 3fd19fbView commit details
Commits on May 31, 2023
-
Configuration menu - View commit details
-
Copy full SHA for d4e3f91 - Browse repository at this point
Copy the full SHA d4e3f91View commit details
Commits on Jun 9, 2023
-
Eliminate function on index that adds the id
Currently a function is used as a passthrough to the function on the util file. This unnecessarily exposes a function to the user that they shouldn’t be concerned with.
Configuration menu - View commit details
-
Copy full SHA for 771390c - Browse repository at this point
Copy the full SHA 771390cView commit details -
Fix the test so that the assertion error bubbles
The assertion error should bubble up to the user if we send it through the callback.
Configuration menu - View commit details
-
Copy full SHA for ae15bc4 - Browse repository at this point
Copy the full SHA ae15bc4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6b5c542 - Browse repository at this point
Copy the full SHA 6b5c542View commit details
Commits on Aug 8, 2023
-
Add types so that purpose of function is clear
Types currently set to any should be more specific. This will help clarify the purpose of the function that is used.
Configuration menu - View commit details
-
Copy full SHA for da64dab - Browse repository at this point
Copy the full SHA da64dabView commit details
Commits on Aug 14, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 8d170fd - Browse repository at this point
Copy the full SHA 8d170fdView commit details -
Add types and names so that the function works
The types should be more specific and the names should be more explicit and clear.
Configuration menu - View commit details
-
Copy full SHA for d49e5fc - Browse repository at this point
Copy the full SHA d49e5fcView commit details -
Merge branch 'multi-db' of https://github.com/danieljbruce/nodejs-dat…
…astore into multi-db
Configuration menu - View commit details
-
Copy full SHA for e7082ab - Browse repository at this point
Copy the full SHA e7082abView commit details
Commits on Aug 15, 2023
-
Eliminate repeated code fragments
The test case has the same lines for each secondary database key and these lines should not be repeated so we regroup them into better data structures for the job
Configuration menu - View commit details
-
Copy full SHA for b50b065 - Browse repository at this point
Copy the full SHA b50b065View commit details -
Better names and code organization
The names of some variables were changed to align with others and code was moved so that code pertaining to the same function is grouped together
Configuration menu - View commit details
-
Copy full SHA for f3aadc2 - Browse repository at this point
Copy the full SHA f3aadc2View commit details -
Change the variable name of the default key
There is only one default key so we change the variable name so that it doesn’t mention 1
Configuration menu - View commit details
-
Copy full SHA for 65605e8 - Browse repository at this point
Copy the full SHA 65605e8View commit details -
Refactor the post key hierarchy out
Refactor the hierarchy out for a cleaner test
Configuration menu - View commit details
-
Copy full SHA for 6986d4c - Browse repository at this point
Copy the full SHA 6986d4cView commit details
Commits on Aug 18, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 0378dea - Browse repository at this point
Copy the full SHA 0378deaView commit details -
Revert "Add only to the test we are interested in"
This reverts commit 0378dea.
Configuration menu - View commit details
-
Copy full SHA for a190512 - Browse repository at this point
Copy the full SHA a190512View commit details
Commits on Aug 21, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 4b62317 - Browse repository at this point
Copy the full SHA 4b62317View commit details
Commits on Sep 20, 2023
-
Merge branch 'main' of https://github.com/googleapis/nodejs-datastore …
…into multi-db # Conflicts: # src/index.ts # system-test/datastore.ts
Configuration menu - View commit details
-
Copy full SHA for 88e20ed - Browse repository at this point
Copy the full SHA 88e20edView commit details -
In the transaction tests we add the databaseId parameter. The databaseId parameter will run tests against the secondary database.
Configuration menu - View commit details
-
Copy full SHA for 739796f - Browse repository at this point
Copy the full SHA 739796fView commit details -
The mocks for addDatabaseIdToRequest are not necessary for these two files since they were only useful for the way the code was written before so should be removed.
Configuration menu - View commit details
-
Copy full SHA for 87450ef - Browse repository at this point
Copy the full SHA 87450efView commit details -
Imports that were used in old mocks no longer exist in the file so should be removed.
Configuration menu - View commit details
-
Copy full SHA for 28b5aaa - Browse repository at this point
Copy the full SHA 28b5aaaView commit details -
Add parameterized testing to the test/index file
Parameterized testing can be added to the test/index file to test to see how the tests behave with databaseId set to the second database and without this setting too.
Configuration menu - View commit details
-
Copy full SHA for 46a5627 - Browse repository at this point
Copy the full SHA 46a5627View commit details -
Add parameterized testing to test/transaction.ts
Parameterized testing should be used on transaction.ts. This commit adds the testing with async.
Configuration menu - View commit details
-
Copy full SHA for 2cf3d98 - Browse repository at this point
Copy the full SHA 2cf3d98View commit details -
This ensures that the tests still run on the deft
Tests need to run on the default database as well as the secondary database. This commit ensures that they do.
Configuration menu - View commit details
-
Copy full SHA for 9505083 - Browse repository at this point
Copy the full SHA 9505083View commit details -
Add parameterized testing for the system tests
Parameterized testing for the system tests will ensure that tests run with the default database as well as with the secondary database.
Configuration menu - View commit details
-
Copy full SHA for e34735a - Browse repository at this point
Copy the full SHA e34735aView commit details -
Use default datastore variable in new tests
The intent of the datastore variable in the new tests is to be the default database so that we are able to see if reads/writes affect the default or secondary database in these tests. They should not use the parameterized version of datastore.
Configuration menu - View commit details
-
Copy full SHA for eb55764 - Browse repository at this point
Copy the full SHA eb55764View commit details
Commits on Sep 21, 2023
-
Now that the tests don’t need to mock out adding database id function, we can inline the code that adds the database id to the request options.
Configuration menu - View commit details
-
Copy full SHA for 992117f - Browse repository at this point
Copy the full SHA 992117fView commit details -
Modify the namespace in parameterized tests
Parameterized tests should have a different namespace for the second set of tests for sure so we add this prefix.
Configuration menu - View commit details
-
Copy full SHA for 7312f49 - Browse repository at this point
Copy the full SHA 7312f49View commit details -
Move databaseId to SharedQueryOptions for alignme
The databaseId should be moved to shared query options as discussed.
Configuration menu - View commit details
-
Copy full SHA for aef80a1 - Browse repository at this point
Copy the full SHA aef80a1View commit details
Commits on Sep 27, 2023
-
Linting was broken so that the PR could be read. Ran the linter again.
Configuration menu - View commit details
-
Copy full SHA for 72255ef - Browse repository at this point
Copy the full SHA 72255efView commit details
Commits on Sep 28, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 07dc746 - Browse repository at this point
Copy the full SHA 07dc746View commit details