Skip to content

docs: change the example timestamps in Spanner Graph java sample code #3295

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

Merged
merged 1 commit into from
Aug 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,7 @@ static void createDatabaseWithPropertyGraph(
+ " id INT64 NOT NULL,"
+ " to_id INT64 NOT NULL,"
+ " amount FLOAT64,"
+ " create_time TIMESTAMP NOT NULL OPTIONS"
+ " (allow_commit_timestamp=true),"
+ " create_time TIMESTAMP NOT NULL,"
+ " order_number STRING(MAX),"
+ " FOREIGN KEY (to_id) REFERENCES Account (id)"
+ ") PRIMARY KEY (id, to_id, create_time),"
Expand Down Expand Up @@ -316,7 +315,7 @@ static void insertUsingDml(DatabaseClient dbClient) {
"INSERT INTO Account (id, create_time, is_blocked) "
+ " VALUES"
+ " (1, CAST('2000-08-10 08:18:48.463959-07:52' AS TIMESTAMP), false),"
+ " (2, CAST('2000-08-12 08:18:48.463959-07:52' AS TIMESTAMP), true)";
+ " (2, CAST('2000-08-12 07:13:16.463959-03:41' AS TIMESTAMP), true)";
long rowCount = transaction.executeUpdate(Statement.of(sql));
System.out.printf("%d record(s) inserted into Account.\n", rowCount);
return null;
Expand All @@ -329,8 +328,8 @@ static void insertUsingDml(DatabaseClient dbClient) {
String sql =
"INSERT INTO AccountTransferAccount (id, to_id, create_time, amount) "
+ " VALUES"
+ " (1, 2, PENDING_COMMIT_TIMESTAMP(), 100),"
+ " (1, 1, PENDING_COMMIT_TIMESTAMP(), 200) ";
+ " (1, 2, CAST('2000-09-11 03:11:18.463959-06:36' AS TIMESTAMP), 100),"
+ " (1, 1, CAST('2000-09-12 04:09:34.463959-05:12' AS TIMESTAMP), 200) ";
long rowCount = transaction.executeUpdate(Statement.of(sql));
System.out.printf("%d record(s) inserted into AccountTransferAccount.\n", rowCount);
return null;
Expand Down
Loading