-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
fixtures_path
in sqlx::test args (#2545)
* feat: add fixtures_path * test: add test for fixtures_path * docs: expand test docs with fixtures_path * test: add new test instead of co-opting and old one. * feat: add explicit path operating mode for fixtures parameters and allow combining multiple fixtures parameters * fix: require .sql extension for explicit path fixtures * feat: add custom relative path style to fixtures argument * fix: missing cfg feature * docs: update * fix: explicit fixtures styling checks for paths. Remove strict sql extension requirement for explicit path, they still need an extension. Add .sql extension to implicit fixtures style only if missing. * style: cargo fmt * docs: update documentation
- Loading branch information
Showing
8 changed files
with
391 additions
and
18 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
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
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 @@ | ||
insert into post(post_id, user_id, content, created_at) | ||
values (1, | ||
1, | ||
'This new computer is lightning-fast!', | ||
timestamp(now(), '-1:00:00')), | ||
(2, | ||
2, | ||
'@alice is a haxxor :(', | ||
timestamp(now(), '-0:30:00')); |
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,2 @@ | ||
insert into user(user_id, username) | ||
values (1, 'alice'), (2, 'bob'); |
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,14 @@ | ||
insert into post(post_id, user_id, content, created_at) | ||
values | ||
( | ||
'252c1d98-a9b0-4f18-8298-e59058bdfe16', | ||
'6592b7c0-b531-4613-ace5-94246b7ce0c3', | ||
'This new computer is lightning-fast!', | ||
now() + '1 hour ago'::interval | ||
), | ||
( | ||
'844265f7-2472-4689-9a2e-b21f40dbf401', | ||
'6592b7c0-b531-4613-ace5-94246b7ce0c3', | ||
'@alice is a haxxor :(', | ||
now() + '30 minutes ago'::interval | ||
); |
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,2 @@ | ||
insert into "user"(user_id, username) | ||
values ('6592b7c0-b531-4613-ace5-94246b7ce0c3', 'alice'), ('297923c5-a83c-4052-bab0-030887154e52', 'bob'); |
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.