-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
persistence upsert cross-database with generated columns
- Loading branch information
1 parent
891e682
commit f9a0917
Showing
31 changed files
with
319 additions
and
105 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace DataAccessKit\Exception; | ||
|
||
use LogicException; | ||
|
||
class PersistenceException extends LogicException | ||
{ | ||
} |
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
2 changes: 2 additions & 0 deletions
2
data-access-kit/test/Persistence/MariaDB1060/PersistenceTest__testExecute.txt
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 @@ | ||
DELETE FROM users WHERE user_id = 1; | ||
SELECT COUNT(*) FROM users; |
2 changes: 2 additions & 0 deletions
2
data-access-kit/test/Persistence/MariaDB1060/PersistenceTest__testInsert.txt
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 `users` (`first_name`, `last_name`) VALUES (?, ?) RETURNING `user_id`, `full_name`; | ||
SELECT user_id, first_name, last_name, full_name FROM users WHERE user_id = ?; |
1 change: 1 addition & 0 deletions
1
data-access-kit/test/Persistence/MariaDB1060/PersistenceTest__testInsertAll.txt
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 @@ | ||
INSERT INTO `users` (`first_name`, `last_name`) VALUES (?, ?), (?, ?) RETURNING `user_id`, `full_name`; |
1 change: 1 addition & 0 deletions
1
data-access-kit/test/Persistence/MariaDB1060/PersistenceTest__testSelectAllColumns.txt
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 @@ | ||
SELECT user_id, first_name, last_name, full_name FROM users LIMIT 1; |
1 change: 1 addition & 0 deletions
1
data-access-kit/test/Persistence/MariaDB1060/PersistenceTest__testSelectScalar.txt
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 @@ | ||
SELECT COUNT(*) FROM users; |
1 change: 1 addition & 0 deletions
1
data-access-kit/test/Persistence/MariaDB1060/PersistenceTest__testSelectSubsetOfColumns.txt
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 @@ | ||
SELECT user_id FROM users; |
2 changes: 2 additions & 0 deletions
2
data-access-kit/test/Persistence/MariaDB1060/PersistenceTest__testUpsert.txt
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 `users` (`user_id`, `first_name`, `last_name`) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE `first_name` = VALUES(`first_name`), `last_name` = VALUES(`last_name`) RETURNING `user_id`, `full_name`; | ||
SELECT user_id, first_name, last_name, full_name FROM users WHERE user_id = ?; |
2 changes: 2 additions & 0 deletions
2
data-access-kit/test/Persistence/MySQL80/PersistenceTest__testExecute.txt
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 @@ | ||
DELETE FROM users WHERE user_id = 1; | ||
SELECT COUNT(*) FROM users; |
3 changes: 3 additions & 0 deletions
3
data-access-kit/test/Persistence/MySQL80/PersistenceTest__testInsert.txt
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,3 @@ | ||
INSERT INTO `users` (`first_name`, `last_name`) VALUES (?, ?); | ||
SELECT `user_id`, `full_name` FROM `users` WHERE `user_id` = ?; | ||
SELECT user_id, first_name, last_name, full_name FROM users WHERE user_id = ?; |
1 change: 1 addition & 0 deletions
1
data-access-kit/test/Persistence/MySQL80/PersistenceTest__testSelectAllColumns.txt
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 @@ | ||
SELECT user_id, first_name, last_name, full_name FROM users LIMIT 1; |
1 change: 1 addition & 0 deletions
1
data-access-kit/test/Persistence/MySQL80/PersistenceTest__testSelectScalar.txt
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 @@ | ||
SELECT COUNT(*) FROM users; |
1 change: 1 addition & 0 deletions
1
data-access-kit/test/Persistence/MySQL80/PersistenceTest__testSelectSubsetOfColumns.txt
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 @@ | ||
SELECT user_id FROM users; |
3 changes: 3 additions & 0 deletions
3
data-access-kit/test/Persistence/MySQL80/PersistenceTest__testUpsert.txt
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,3 @@ | ||
INSERT INTO `users` (`user_id`, `first_name`, `last_name`) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE `first_name` = VALUES(`first_name`), `last_name` = VALUES(`last_name`); | ||
SELECT `user_id`, `full_name` FROM `users` WHERE `user_id` = ?; | ||
SELECT user_id, first_name, last_name, full_name FROM users WHERE user_id = ?; |
2 changes: 2 additions & 0 deletions
2
data-access-kit/test/Persistence/PostgreSQL/PersistenceTest__testExecute.txt
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 @@ | ||
DELETE FROM users WHERE user_id = 1; | ||
SELECT COUNT(*) FROM users; |
2 changes: 2 additions & 0 deletions
2
data-access-kit/test/Persistence/PostgreSQL/PersistenceTest__testInsert.txt
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 "users" ("first_name", "last_name") VALUES (?, ?) RETURNING "user_id", "full_name"; | ||
SELECT user_id, first_name, last_name, full_name FROM users WHERE user_id = ?; |
1 change: 1 addition & 0 deletions
1
data-access-kit/test/Persistence/PostgreSQL/PersistenceTest__testInsertAll.txt
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 @@ | ||
INSERT INTO "users" ("first_name", "last_name") VALUES (?, ?), (?, ?) RETURNING "user_id", "full_name"; |
1 change: 1 addition & 0 deletions
1
data-access-kit/test/Persistence/PostgreSQL/PersistenceTest__testSelectAllColumns.txt
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 @@ | ||
SELECT user_id, first_name, last_name, full_name FROM users LIMIT 1; |
1 change: 1 addition & 0 deletions
1
data-access-kit/test/Persistence/PostgreSQL/PersistenceTest__testSelectScalar.txt
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 @@ | ||
SELECT COUNT(*) FROM users; |
1 change: 1 addition & 0 deletions
1
data-access-kit/test/Persistence/PostgreSQL/PersistenceTest__testSelectSubsetOfColumns.txt
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 @@ | ||
SELECT user_id FROM users; |
2 changes: 2 additions & 0 deletions
2
data-access-kit/test/Persistence/PostgreSQL/PersistenceTest__testUpsert.txt
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 "users" ("user_id", "first_name", "last_name") VALUES (?, ?, ?) ON CONFLICT ("user_id") DO UPDATE SET "first_name" = EXCLUDED."first_name", "last_name" = EXCLUDED."last_name" RETURNING "user_id", "full_name"; | ||
SELECT user_id, first_name, last_name, full_name FROM users WHERE user_id = ?; |
2 changes: 2 additions & 0 deletions
2
data-access-kit/test/Persistence/SQLite/PersistenceTest__testExecute.txt
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 @@ | ||
DELETE FROM users WHERE user_id = 1; | ||
SELECT COUNT(*) FROM users; |
2 changes: 2 additions & 0 deletions
2
data-access-kit/test/Persistence/SQLite/PersistenceTest__testInsert.txt
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 "users" ("first_name", "last_name") VALUES (?, ?) RETURNING "user_id", "full_name"; | ||
SELECT user_id, first_name, last_name, full_name FROM users WHERE user_id = ?; |
1 change: 1 addition & 0 deletions
1
data-access-kit/test/Persistence/SQLite/PersistenceTest__testInsertAll.txt
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 @@ | ||
INSERT INTO "users" ("first_name", "last_name") VALUES (?, ?), (?, ?) RETURNING "user_id", "full_name"; |
1 change: 1 addition & 0 deletions
1
data-access-kit/test/Persistence/SQLite/PersistenceTest__testSelectAllColumns.txt
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 @@ | ||
SELECT user_id, first_name, last_name, full_name FROM users LIMIT 1; |
1 change: 1 addition & 0 deletions
1
data-access-kit/test/Persistence/SQLite/PersistenceTest__testSelectScalar.txt
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 @@ | ||
SELECT COUNT(*) FROM users; |
1 change: 1 addition & 0 deletions
1
data-access-kit/test/Persistence/SQLite/PersistenceTest__testSelectSubsetOfColumns.txt
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 @@ | ||
SELECT user_id FROM users; |
2 changes: 2 additions & 0 deletions
2
data-access-kit/test/Persistence/SQLite/PersistenceTest__testUpsert.txt
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 "users" ("user_id", "first_name", "last_name") VALUES (?, ?, ?) ON CONFLICT ("user_id") DO UPDATE SET "first_name" = EXCLUDED."first_name", "last_name" = EXCLUDED."last_name" RETURNING "user_id", "full_name"; | ||
SELECT user_id, first_name, last_name, full_name FROM users WHERE user_id = ?; |
Oops, something went wrong.