-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(electric): Add support for TIME data type in electrified tables (#…
- Loading branch information
Showing
8 changed files
with
193 additions
and
81 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,5 @@ | ||
--- | ||
"@core/electric": patch | ||
--- | ||
|
||
Implement support for the TIME column type in electrified tables. |
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 was deleted.
Oops, something went wrong.
88 changes: 88 additions & 0 deletions
88
e2e/tests/03.14_node_satellite_can_sync_dates_and_times.lux
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,88 @@ | ||
[doc NodeJS Satellite correctly syncs DATE and TIME values from and to Electric] | ||
[include _shared.luxinc] | ||
[include _satellite_macros.luxinc] | ||
|
||
[invoke setup] | ||
|
||
[shell pg_1] | ||
[local sql= | ||
""" | ||
CREATE TABLE public.datetimes ( | ||
id TEXT PRIMARY KEY DEFAULT uuid_generate_v4(), | ||
d DATE, | ||
t TIME | ||
); | ||
CALL electric.electrify('public.datetimes'); | ||
"""] | ||
[invoke migrate_pg 20230913 $sql] | ||
|
||
[invoke setup_client 1 electric_1 5133] | ||
|
||
[shell satellite_1] | ||
[invoke node_await_table "datetimes"] | ||
[invoke node_sync_table "datetimes"] | ||
|
||
[shell pg_1] | ||
!INSERT INTO public.datetimes (id, d, t) VALUES ('001', '2023-08-23', '11:00:59'), \ | ||
('002', '01-01-0001', '00:59:03.11'), \ | ||
('003', 'Feb 29 6000', '23:05:17.999999'); | ||
??INSERT 0 3 | ||
|
||
[shell satellite_1] | ||
[invoke node_await_get_from_table "datetimes" "003"] | ||
|
||
??id: '001' | ||
??d: '2023-08-23' | ||
??t: '11:00:59' | ||
|
||
??id: '002' | ||
??d: '0001-01-01' | ||
??t: '00:59:03.11' | ||
|
||
??id: '003' | ||
??d: '6000-02-29' | ||
??t: '23:05:17.999999' | ||
|
||
[invoke node_await_insert_extended_into "datetimes" "{id: '004', d: '1999-12-31'}"] | ||
[invoke node_await_insert_extended_into "datetimes" "{id: '005', t: '00:00:00.000'}"] | ||
|
||
[shell pg_1] | ||
[invoke wait-for "SELECT * FROM public.datetimes;" "005" 10 $psql] | ||
|
||
!SELECT * FROM public.datetimes; | ||
??001 | 2023-08-23 | 11:00:59 | ||
??002 | 0001-01-01 | 00:59:03.11 | ||
??003 | 6000-02-29 | 23:05:17.999999 | ||
??004 | 1999-12-31 | <NULL> | ||
??005 | <NULL> | 00:00:00 | ||
|
||
# Start a new Satellite client and verify that it receives all dates and times | ||
[invoke setup_client 2 electric_1 5133] | ||
|
||
[shell satellite_2] | ||
[invoke node_await_table "datetimes"] | ||
[invoke node_sync_table "datetimes"] | ||
|
||
[invoke node_await_get_from_table "datetimes" "005"] | ||
??id: '001' | ||
??d: '2023-08-23' | ||
??t: '11:00:59' | ||
|
||
??id: '002' | ||
??d: '0001-01-01' | ||
??t: '00:59:03.11' | ||
|
||
??id: '003' | ||
??d: '6000-02-29' | ||
??t: '23:05:17.999999' | ||
|
||
??id: '004' | ||
??d: '1999-12-31' | ||
??t: null | ||
|
||
??id: '005' | ||
??d: null | ||
??t: '00:00:00' | ||
|
||
[cleanup] | ||
[invoke teardown] |