Skip to content

Commit

Permalink
chore: add integration tests in main test file for the samples (#2019)
Browse files Browse the repository at this point in the history
* chore: add integration tests in main test file for the samples

* fix: lint errors

* fix: presubmit error

* fix: presubmit error

* fix: presubmit error

* fix: lint errors

* fix: presubmit errors

* fix: presubmit errors

* fix: presubmit errors

* fix: presubmit errors

* fix: presubmit errors

* fix: presubmit errors
  • Loading branch information
alkatrivedi authored Mar 20, 2024
1 parent fc99d8e commit b1424e5
Show file tree
Hide file tree
Showing 2 changed files with 990 additions and 316 deletions.
25 changes: 13 additions & 12 deletions samples/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,20 @@ async function createDatabase(instanceID, databaseID, projectID) {
const databaseAdminClient = spanner.getDatabaseAdminClient();

const createSingersTableStatement = `
CREATE TABLE Singers (
SingerId INT64 NOT NULL,
FirstName STRING(1024),
LastName STRING(1024),
SingerInfo BYTES(MAX)
) PRIMARY KEY (SingerId)`;
CREATE TABLE Singers (
SingerId INT64 NOT NULL,
FirstName STRING(1024),
LastName STRING(1024),
SingerInfo BYTES(MAX),
FullName STRING(2048) AS (ARRAY_TO_STRING([FirstName, LastName], " ")) STORED,
) PRIMARY KEY (SingerId)`;
const createAlbumsTableStatement = `
CREATE TABLE Albums (
SingerId INT64 NOT NULL,
AlbumId INT64 NOT NULL,
AlbumTitle STRING(MAX)
) PRIMARY KEY (SingerId, AlbumId),
INTERLEAVE IN PARENT Singers ON DELETE CASCADE`;
CREATE TABLE Albums (
SingerId INT64 NOT NULL,
AlbumId INT64 NOT NULL,
AlbumTitle STRING(MAX)
) PRIMARY KEY (SingerId, AlbumId),
INTERLEAVE IN PARENT Singers ON DELETE CASCADE`;

// Creates a new database
try {
Expand Down
Loading

0 comments on commit b1424e5

Please sign in to comment.