-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
147 additions
and
52 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
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
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,17 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace NextrasTests\Orm; | ||
|
||
|
||
use DateTimeImmutable; | ||
use Nextras\Orm\Entity\Entity; | ||
|
||
|
||
/** | ||
* @property DateTimeImmutable $id {primary-proxy} | ||
* @property DateTimeImmutable $date {primary} | ||
* @property int $value | ||
*/ | ||
final class TimeSeries extends Entity | ||
{ | ||
} |
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 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace NextrasTests\Orm; | ||
|
||
|
||
use Nextras\Orm\Mapper\Dbal\DbalMapper; | ||
|
||
|
||
/** | ||
* @extends DbalMapper<Log> | ||
*/ | ||
final class TimeSeriesMapper extends DbalMapper | ||
{ | ||
} |
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,18 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace NextrasTests\Orm; | ||
|
||
|
||
use Nextras\Orm\Repository\Repository; | ||
|
||
|
||
/** | ||
* @extends Repository<Log> | ||
*/ | ||
final class TimeSeriesRepository extends Repository | ||
{ | ||
static function getEntityClassNames(): array | ||
{ | ||
return [TimeSeries::class]; | ||
} | ||
} |
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
12 changes: 12 additions & 0 deletions
12
...ls/NextrasTests/Orm/Integration/Entity/EntityCompositePKTest_testCompositePKDateTime2.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,12 @@ | ||
START TRANSACTION; | ||
INSERT INTO "users" VALUES (DEFAULT); | ||
SELECT CURRVAL('"users_id_seq"'); | ||
COMMIT; | ||
START TRANSACTION; | ||
INSERT INTO "user_stats_x" ("user_id", "date", "value") VALUES (1, '2019-01-01 00:00:00.000000'::timestamp, 100); | ||
COMMIT; | ||
SELECT "user_stats_x".* FROM "user_stats_x" AS "user_stats_x" WHERE (("user_stats_x"."date" = '2019-01-01 00:00:00.000000'::timestamp)); | ||
START TRANSACTION; | ||
UPDATE "user_stats_x" SET "value" = 200 WHERE "user_id" = 1 AND "date" = '2019-01-01 00:00:00.000000'::timestamp; | ||
COMMIT; | ||
SELECT "user_stats_x".* FROM "user_stats_x" AS "user_stats_x" WHERE (("user_stats_x"."date" = '2019-01-01 00:00:00.000000'::timestamp)); |
9 changes: 9 additions & 0 deletions
9
...s/sqls/NextrasTests/Orm/Integration/Entity/EntityPkTest_testDateTimeWithProxyPkUpdate.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 @@ | ||
START TRANSACTION; | ||
INSERT INTO "time_series" ("date", "value") VALUES ('2022-03-06 03:03:03.000000'::timestamptz, 3); | ||
COMMIT; | ||
SELECT "time_series".* FROM "time_series" AS "time_series" WHERE (("time_series"."date" = '2022-03-06 03:03:03.000000'::timestamptz)); | ||
SELECT "time_series".* FROM "time_series" AS "time_series" WHERE (("time_series"."date" = '2022-03-06 03:03:03.000000'::timestamptz)); | ||
START TRANSACTION; | ||
UPDATE "time_series" SET "value" = 5 WHERE "date" = '2022-03-06 04:03:03.000000'; | ||
COMMIT; | ||
SELECT "time_series".* FROM "time_series" AS "time_series" WHERE (("time_series"."date" = '2022-03-06 03:03:03.000000'::timestamptz)); |