-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create zookie-like 'wookie' implementation for specifying consistency/freshness on reads * Persist wookies on updates and send back in responses * Fix postgres createWookie query * Send back latest wookie in all check/read calls * Simplify wookie service methods * Check service Check() to use wookie read * Implement wookie service methods * Allow wookieSafeReads() within WithWookieUpdate() * Don't err out if wookie values not present * Add basic wookie token unit test * Address cr comments
- Loading branch information
Showing
36 changed files
with
1,104 additions
and
311 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
migrations/datastore/mysql/000005_create_wookie_table.down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
BEGIN; | ||
|
||
DROP TABLE IF EXISTS wookie; | ||
|
||
COMMIT; |
10 changes: 10 additions & 0 deletions
10
migrations/datastore/mysql/000005_create_wookie_table.up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
BEGIN; | ||
|
||
CREATE TABLE IF NOT EXISTS wookie ( | ||
id bigint NOT NULL AUTO_INCREMENT, | ||
ver bigint NOT NULL, | ||
createdAt timestamp(6) NULL DEFAULT CURRENT_TIMESTAMP(6), | ||
PRIMARY KEY (id) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; | ||
|
||
COMMIT; |
5 changes: 5 additions & 0 deletions
5
migrations/datastore/postgres/000006_create_wookie_table.down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
BEGIN; | ||
|
||
DROP TABLE IF EXISTS wookie; | ||
|
||
COMMIT; |
9 changes: 9 additions & 0 deletions
9
migrations/datastore/postgres/000006_create_wookie_table.up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
BEGIN; | ||
|
||
CREATE TABLE IF NOT EXISTS wookie ( | ||
id bigserial PRIMARY KEY, | ||
ver bigserial, | ||
created_at timestamp(6) NULL DEFAULT CURRENT_TIMESTAMP(6) | ||
); | ||
|
||
COMMIT; |
1 change: 1 addition & 0 deletions
1
migrations/datastore/sqlite/000005_create_wookie_table.down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DROP TABLE IF EXISTS wookie; |
5 changes: 5 additions & 0 deletions
5
migrations/datastore/sqlite/000005_create_wookie_table.up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
CREATE TABLE IF NOT EXISTS wookie ( | ||
id INTEGER PRIMARY KEY AUTOINCREMENT, | ||
ver INTEGER, | ||
createdAt DATETIME DEFAULT CURRENT_TIMESTAMP | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.