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

feat(spanner): add PG.OID support #1948

Merged
merged 7 commits into from
Feb 14, 2024
Merged

Conversation

skuruppu
Copy link
Contributor

@skuruppu skuruppu commented Nov 14, 2023

The PG.OID type is an int64 value with a PG_OID type annotation, mostly used by pg_catalog tables. This PR adds support for encoding/decoding PG.OID values.

Tests are added for being able to query a PG.OID value, with and without parameters.

User tables can't be created with PG.OID as a column type so no tests were added for DML or mutations. Since the currently available set of pg_catalog tables don't have PG.OID columns, we also don't test being able to read a PG.OID from a table.

@skuruppu skuruppu requested review from a team as code owners November 14, 2023 05:00
@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: spanner Issues related to the googleapis/nodejs-spanner API. labels Nov 14, 2023
value: string;
constructor(value: string) {
super();
this.value = value.toString();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need toString() as value type is already string

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought this would work but it actually makes the behaviour different. I'm not sure I understand why. But this logic is the same as how we represent the Int type on line 144.

system-test/spanner.ts Outdated Show resolved Hide resolved
@surbhigarg92 surbhigarg92 added the owlbot:run Add this label to trigger the Owlbot post processor. label Feb 14, 2024
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Feb 14, 2024
@surbhigarg92 surbhigarg92 added automerge Merge the pull request once unit tests and other checks pass. owlbot:run Add this label to trigger the Owlbot post processor. labels Feb 14, 2024
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Feb 14, 2024
@surbhigarg92 surbhigarg92 merged commit cf9df7a into googleapis:main Feb 14, 2024
16 checks passed
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Feb 14, 2024
gcf-merge-on-green bot pushed a commit that referenced this pull request Feb 23, 2024
🤖 I have created a release *beep* *boop*
---


## [7.4.0](https://togithub.com/googleapis/nodejs-spanner/compare/v7.3.0...v7.4.0) (2024-02-23)


### Features

* **spanner:** Add PG.OID support ([#1948](https://togithub.com/googleapis/nodejs-spanner/issues/1948)) ([cf9df7a](https://togithub.com/googleapis/nodejs-spanner/commit/cf9df7a54c21ac995bbea9ad82c3544e4aff41b6))
* Untyped param types ([#1869](https://togithub.com/googleapis/nodejs-spanner/issues/1869)) ([6ef44c3](https://togithub.com/googleapis/nodejs-spanner/commit/6ef44c383a90bf6ae95de531c83e21d2d58da159))
* Update TransactionOptions to include new option exclude_txn_from_change_streams ([#1998](https://togithub.com/googleapis/nodejs-spanner/issues/1998)) ([937a7a1](https://togithub.com/googleapis/nodejs-spanner/commit/937a7a13f8c7660e21d34ebbaecad426b2bacd99))


### Bug Fixes

* **deps:** Update dependency google-gax to v4.3.1 ([#1995](https://togithub.com/googleapis/nodejs-spanner/issues/1995)) ([bed4832](https://togithub.com/googleapis/nodejs-spanner/commit/bed4832445e72c7116fe5495c79d989664220b38))
* Only reset pending value with resume token ([#2000](https://togithub.com/googleapis/nodejs-spanner/issues/2000)) ([f337089](https://togithub.com/googleapis/nodejs-spanner/commit/f337089567d7d92c9467e311be7d72b0a7dc8047)), closes [#1959](https://togithub.com/googleapis/nodejs-spanner/issues/1959)

---
This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/nodejs-spanner API. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants