Skip to content

Commit 4154c02

Browse files
asthamohtasurbhigarg92rajatbhattagcf-owl-bot[bot]
authored
feat: Bit reverse sequence (#1846)
* changes for brs * changes * changes * changes * changes * changes * changes * comment change * changes * Update samples/sequence-create.js Co-authored-by: Rajat Bhatta <[email protected]> * changes * changes * lint * Update samples/pg-sequence-alter.js Co-authored-by: Rajat Bhatta <[email protected]> * Update samples/pg-sequence-drop.js Co-authored-by: Rajat Bhatta <[email protected]> * Update samples/sequence-drop.js Co-authored-by: Rajat Bhatta <[email protected]> * Update samples/sequence-alter.js Co-authored-by: Rajat Bhatta <[email protected]> * Update samples/sequence-create.js Co-authored-by: Rajat Bhatta <[email protected]> * Update samples/pg-sequence-create.js Co-authored-by: Rajat Bhatta <[email protected]> * Changes * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: surbhigarg92 <[email protected]> Co-authored-by: Rajat Bhatta <[email protected]> Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 75f357a commit 4154c02

9 files changed

+757
-0
lines changed

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ Samples are in the [`samples/`](https://github.com/googleapis/nodejs-spanner/tre
161161
| Showcases how a Spanner PostgreSQL database orders null values in a query. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/pg-ordering-nulls.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/pg-ordering-nulls.js,samples/README.md) |
162162
| Execute a query with parameters on a Spanner PostgreSQL database. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/pg-query-parameter.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/pg-query-parameter.js,samples/README.md) |
163163
| Query the information schema metadata in a Spanner PostgreSQL database. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/pg-schema-information.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/pg-schema-information.js,samples/README.md) |
164+
| Alters a sequence in a PostgreSQL database. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/pg-sequence-alter.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/pg-sequence-alter.js,samples/README.md) |
165+
| Creates sequence in PostgreSQL database. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/pg-sequence-create.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/pg-sequence-create.js,samples/README.md) |
166+
| Drops a sequence in PostgreSQL database. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/pg-sequence-drop.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/pg-sequence-drop.js,samples/README.md) |
164167
| Queryoptions | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/queryoptions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/queryoptions.js,samples/README.md) |
165168
| Quickstart | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) |
166169
| Read data with database role | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/read-data-with-database-role.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/read-data-with-database-role.js,samples/README.md) |
@@ -172,6 +175,9 @@ Samples are in the [`samples/`](https://github.com/googleapis/nodejs-spanner/tre
172175
| Query data with RPC Priority | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/rpc-priority-run.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/rpc-priority-run.js,samples/README.md) |
173176
| Run transaction with RPC priority | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/rpc-priority-transaction.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/rpc-priority-transaction.js,samples/README.md) |
174177
| Schema | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/schema.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/schema.js,samples/README.md) |
178+
| Alters a sequence in a GoogleSQL database. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/sequence-alter.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/sequence-alter.js,samples/README.md) |
179+
| Creates sequence in GoogleSQL database. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/sequence-create.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/sequence-create.js,samples/README.md) |
180+
| Drops a sequence in GoogleSQL database. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/sequence-drop.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/sequence-drop.js,samples/README.md) |
175181
| Struct | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/struct.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/struct.js,samples/README.md) |
176182
| Alters a table with foreign key delete cascade action | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/table-alter-with-foreign-key-delete-cascade.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/table-alter-with-foreign-key-delete-cascade.js,samples/README.md) |
177183
| Creates a table with foreign key delete cascade action | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/table-create-with-foreign-key-delete-cascade.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/table-create-with-foreign-key-delete-cascade.js,samples/README.md) |

samples/README.md

+108
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ and automatic, synchronous replication for high availability.
8686
* [Showcases how a Spanner PostgreSQL database orders null values in a query.](#showcases-how-a-spanner-postgresql-database-orders-null-values-in-a-query.)
8787
* [Execute a query with parameters on a Spanner PostgreSQL database.](#execute-a-query-with-parameters-on-a-spanner-postgresql-database.)
8888
* [Query the information schema metadata in a Spanner PostgreSQL database.](#query-the-information-schema-metadata-in-a-spanner-postgresql-database.)
89+
* [Alters a sequence in a PostgreSQL database.](#alters-a-sequence-in-a-postgresql-database.)
90+
* [Creates sequence in PostgreSQL database.](#creates-sequence-in-postgresql-database.)
91+
* [Drops a sequence in PostgreSQL database.](#drops-a-sequence-in-postgresql-database.)
8992
* [Queryoptions](#queryoptions)
9093
* [Quickstart](#quickstart)
9194
* [Read data with database role](#read-data-with-database-role)
@@ -97,6 +100,9 @@ and automatic, synchronous replication for high availability.
97100
* [Query data with RPC Priority](#query-data-with-rpc-priority)
98101
* [Run transaction with RPC priority](#run-transaction-with-rpc-priority)
99102
* [Schema](#schema)
103+
* [Alters a sequence in a GoogleSQL database.](#alters-a-sequence-in-a-googlesql-database.)
104+
* [Creates sequence in GoogleSQL database.](#creates-sequence-in-googlesql-database.)
105+
* [Drops a sequence in GoogleSQL database.](#drops-a-sequence-in-googlesql-database.)
100106
* [Struct](#struct)
101107
* [Alters a table with foreign key delete cascade action](#alters-a-table-with-foreign-key-delete-cascade-action)
102108
* [Creates a table with foreign key delete cascade action](#creates-a-table-with-foreign-key-delete-cascade-action)
@@ -1344,6 +1350,57 @@ __Usage:__
13441350

13451351

13461352

1353+
### Alters a sequence in a PostgreSQL database.
1354+
1355+
View the [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/pg-sequence-alter.js).
1356+
1357+
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/pg-sequence-alter.js,samples/README.md)
1358+
1359+
__Usage:__
1360+
1361+
1362+
`node pg-sequence-alter.js <INSTANCE_ID> <DATABASE_ID> <PROJECT_ID>`
1363+
1364+
1365+
-----
1366+
1367+
1368+
1369+
1370+
### Creates sequence in PostgreSQL database.
1371+
1372+
View the [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/pg-sequence-create.js).
1373+
1374+
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/pg-sequence-create.js,samples/README.md)
1375+
1376+
__Usage:__
1377+
1378+
1379+
`node pg-sequence-create.js <INSTANCE_ID> <DATABASE_ID> <PROJECT_ID>`
1380+
1381+
1382+
-----
1383+
1384+
1385+
1386+
1387+
### Drops a sequence in PostgreSQL database.
1388+
1389+
View the [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/pg-sequence-drop.js).
1390+
1391+
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/pg-sequence-drop.js,samples/README.md)
1392+
1393+
__Usage:__
1394+
1395+
1396+
`node pg-sequence-drop.js <INSTANCE_ID> <DATABASE_ID> <PROJECT_ID>`
1397+
1398+
1399+
-----
1400+
1401+
1402+
1403+
13471404
### Queryoptions
13481405

13491406
View the [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/queryoptions.js).
@@ -1531,6 +1588,57 @@ __Usage:__
15311588

15321589

15331590

1591+
### Alters a sequence in a GoogleSQL database.
1592+
1593+
View the [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/sequence-alter.js).
1594+
1595+
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/sequence-alter.js,samples/README.md)
1596+
1597+
__Usage:__
1598+
1599+
1600+
`node sequence-alter.js <INSTANCE_ID> <DATABASE_ID> <PROJECT_ID>`
1601+
1602+
1603+
-----
1604+
1605+
1606+
1607+
1608+
### Creates sequence in GoogleSQL database.
1609+
1610+
View the [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/sequence-create.js).
1611+
1612+
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/sequence-create.js,samples/README.md)
1613+
1614+
__Usage:__
1615+
1616+
1617+
`node sequence-create.js <INSTANCE_ID> <DATABASE_ID> <PROJECT_ID>`
1618+
1619+
1620+
-----
1621+
1622+
1623+
1624+
1625+
### Drops a sequence in GoogleSQL database.
1626+
1627+
View the [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/sequence-drop.js).
1628+
1629+
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/sequence-drop.js,samples/README.md)
1630+
1631+
__Usage:__
1632+
1633+
1634+
`node sequence-drop.js <INSTANCE_ID> <DATABASE_ID> <PROJECT_ID>`
1635+
1636+
1637+
-----
1638+
1639+
1640+
1641+
15341642
### Struct
15351643

15361644
View the [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/struct.js).

samples/pg-sequence-alter.js

+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
// Copyright 2023 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// sample-metadata:
16+
// title: Alters a sequence in a PostgreSQL database.
17+
// usage: node pg-sequence-alter.js <INSTANCE_ID> <DATABASE_ID> <PROJECT_ID>
18+
19+
'use strict';
20+
21+
async function main(instanceId, databaseId, projectId) {
22+
// [START spanner_postgresql_alter_sequence]
23+
// Imports the Google Cloud client library.
24+
const {Spanner} = require('@google-cloud/spanner');
25+
26+
/**
27+
* TODO(developer): Uncomment the following lines before running the sample.
28+
*/
29+
// const projectId = 'my-project-id';
30+
// const instanceId = 'my-instance';
31+
// const databaseId = 'my-database';
32+
33+
// Creates a client
34+
const spanner = new Spanner({
35+
projectId: projectId,
36+
});
37+
38+
async function alterSequence(instanceId, databaseId) {
39+
// Gets a reference to a Cloud Spanner instance and database
40+
const instance = spanner.instance(instanceId);
41+
const database = instance.database(databaseId);
42+
43+
const request = ['ALTER SEQUENCE Seq SKIP RANGE 1000 5000000'];
44+
45+
try {
46+
const [operation] = await database.updateSchema(request);
47+
48+
console.log('Waiting for operation to complete...');
49+
await operation.promise();
50+
51+
console.log(
52+
'Altered Seq sequence to skip an inclusive range between 1000 and 5000000.'
53+
);
54+
} catch (err) {
55+
console.error('ERROR:', err);
56+
}
57+
database.runTransaction(async (err, transaction) => {
58+
if (err) {
59+
console.error(err);
60+
return;
61+
}
62+
try {
63+
const [rows, stats] = await transaction.run({
64+
sql: "INSERT INTO Customers (CustomerName) VALUES ('Lea'), ('Catalina'), ('Smith') RETURNING CustomerId",
65+
});
66+
67+
rows.forEach(row => {
68+
console.log(
69+
`Inserted customer record with CustomerId: ${
70+
row.toJSON({wrapNumbers: true}).customerid.value
71+
}`
72+
);
73+
});
74+
75+
const rowCount = Math.floor(stats[stats.rowCount]);
76+
console.log(`Number of customer records inserted is: ${rowCount}`);
77+
78+
await transaction.commit();
79+
} catch (err) {
80+
console.error('ERROR:', err);
81+
} finally {
82+
// Close the database when finished.
83+
await database.close();
84+
}
85+
});
86+
}
87+
await alterSequence(instanceId, databaseId);
88+
// [END spanner_postgresql_alter_sequence]
89+
}
90+
91+
process.on('unhandledRejection', err => {
92+
console.error(err.message);
93+
process.exitCode = 1;
94+
});
95+
main(...process.argv.slice(2));

samples/pg-sequence-create.js

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
// Copyright 2023 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// sample-metadata:
16+
// title: Creates sequence in PostgreSQL database.
17+
// usage: node pg-sequence-create.js <INSTANCE_ID> <DATABASE_ID> <PROJECT_ID>
18+
19+
'use strict';
20+
21+
async function main(instanceId, databaseId, projectId) {
22+
// [START spanner_postgresql_create_sequence]
23+
// Imports the Google Cloud client library.
24+
const {Spanner} = require('@google-cloud/spanner');
25+
26+
/**
27+
* TODO(developer): Uncomment the following lines before running the sample.
28+
*/
29+
// const projectId = 'my-project-id';
30+
// const instanceId = 'my-instance';
31+
// const databaseId = 'my-database';
32+
33+
// Creates a client
34+
const spanner = new Spanner({
35+
projectId: projectId,
36+
});
37+
38+
async function createSequence(instanceId, databaseId) {
39+
// Gets a reference to a Cloud Spanner instance and database
40+
const instance = spanner.instance(instanceId);
41+
const database = instance.database(databaseId);
42+
43+
const request = [
44+
'CREATE SEQUENCE Seq BIT_REVERSED_POSITIVE',
45+
"CREATE TABLE Customers (CustomerId BIGINT DEFAULT nextval('Seq'), CustomerName character varying(1024), PRIMARY KEY (CustomerId))",
46+
];
47+
48+
// Creates a new table with sequence
49+
try {
50+
const [operation] = await database.updateSchema(request);
51+
52+
console.log('Waiting for operation to complete...');
53+
await operation.promise();
54+
55+
console.log(
56+
'Created Seq sequence and Customers table, where the key column CustomerId uses the sequence as a default value'
57+
);
58+
} catch (err) {
59+
console.error('ERROR:', err);
60+
}
61+
database.runTransaction(async (err, transaction) => {
62+
if (err) {
63+
console.error(err);
64+
return;
65+
}
66+
try {
67+
const [rows, stats] = await transaction.run({
68+
sql: "INSERT INTO Customers (CustomerName) VALUES ('Alice'), ('David'), ('Marc') RETURNING CustomerId",
69+
});
70+
71+
rows.forEach(row => {
72+
console.log(
73+
`Inserted customer record with CustomerId: ${
74+
row.toJSON({wrapNumbers: true}).customerid.value
75+
}`
76+
);
77+
});
78+
79+
const rowCount = Math.floor(stats[stats.rowCount]);
80+
console.log(`Number of customer records inserted is: ${rowCount}`);
81+
82+
await transaction.commit();
83+
} catch (err) {
84+
console.error('ERROR:', err);
85+
} finally {
86+
// Close the database when finished.
87+
await database.close();
88+
}
89+
});
90+
}
91+
await createSequence(instanceId, databaseId);
92+
// [END spanner_postgresql_create_sequence]
93+
}
94+
95+
process.on('unhandledRejection', err => {
96+
console.error(err.message);
97+
process.exitCode = 1;
98+
});
99+
main(...process.argv.slice(2));

0 commit comments

Comments
 (0)