-
Notifications
You must be signed in to change notification settings - Fork 495
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support and test for gen_random_uuid() (#3855)
* add support and test for gen_random_uuid() * Add type * match code style * fix compile error * use correct queries object * Use postgres capable of generating uuids
- Loading branch information
1 parent
3be35d6
commit 2e271a9
Showing
4 changed files
with
24 additions
and
1 deletion.
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
7 changes: 7 additions & 0 deletions
7
dialects/postgresql/src/test/fixtures_postgresql/uuids/Test.s
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,7 @@ | ||
CREATE TABLE uuid_test ( | ||
pk uuid | ||
); | ||
|
||
SELECT gen_random_uuid(), pk FROM uuid_test; | ||
|
||
INSERT INTO uuid_test(pk) SELECT gen_random_uuid(); |
9 changes: 9 additions & 0 deletions
9
...ration-postgresql/src/main/sqldelight/app/cash/sqldelight/postgresql/integration/Uuids.sq
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 @@ | ||
CREATE TABLE uuids( | ||
key uuid NOT NULL | ||
); | ||
|
||
insertUuid: | ||
INSERT INTO uuids (key) VALUES (:key); | ||
|
||
randomUuid: | ||
SELECT gen_random_uuid(); |
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