-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: JS connectors integration (#4097)
* Renames and restructure * Use proxy in `JsQueryable::is_healthy` * Change neon and planetscale drivers to use a promise for the version The promise executes aynchrounsly on constructor, but it's awaited whenever the version is required, particularly to provide consistent health information. Otherwise isHealthy would be returning false, while the promise hasn't resolved yet. * feat: add child parent relation migration * feat(js-connectors): add support for transactions in PlanetScale, without touching Rust * chore: apply renames as in #4085 * chore: use switch case syntax * chore: add hard error if we detect intertwine transaction * feat(js-connectors): adopt Rust's "performIO" pattern to simplify isHealthy() and version() * feat(js-connectors): implement "is_healthy()" * feat(js-connectors): add data conversions for neon * feat(js-connector): add common ConnectorConfig for PlanetScale and Neon * feat(js-connector): update type mapping in neon, use common ConnectorConfig * feat(js-connector): use common ConnectorConfig * test(js-connector): split + centralise tests for PlanetScale and Neon, enable "@withFlavor" test decorator * chore: update README.md * chore: fix typo * chore: fix typo * chore: restore PlanetScale transactions * fix: address review comments * feat: simplify neon/planetscale data-type conversions --------- Co-authored-by: Miguel Fernandez <[email protected]>
- Loading branch information
Showing
19 changed files
with
1,485 additions
and
897 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
51 changes: 51 additions & 0 deletions
51
...e/js-connectors/smoke-test-js/prisma/mysql-planetscale/migrations/type_test/migration.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,51 @@ | ||
INSERT INTO type_test ( | ||
tinyint_column, | ||
smallint_column, | ||
mediumint_column, | ||
int_column, | ||
bigint_column, | ||
float_column, | ||
double_column, | ||
decimal_column, | ||
boolean_column, | ||
bit_column, | ||
char_column, | ||
varchar_column, | ||
text_column, | ||
date_column, | ||
time_column, | ||
year_column, | ||
datetime_column, | ||
timestamp_column, | ||
json_column, | ||
enum_column, | ||
binary_column, | ||
varbinary_column, | ||
blob_column, | ||
set_column | ||
) VALUES ( | ||
127, -- tinyint | ||
32767, -- smallint | ||
8388607, -- mediumint | ||
2147483647, -- int | ||
9223372036854775807, -- bigint | ||
3.402823466, -- float | ||
1.7976931348623157, -- double | ||
99999999.99, -- decimal | ||
TRUE, -- boolean | ||
1, -- bit | ||
'c', -- char | ||
'Sample varchar', -- varchar | ||
'This is a long text...', -- text | ||
'2023-07-24', -- date | ||
'23:59:59', -- time | ||
2023, -- year | ||
'2023-07-24 23:59:59', -- datetime | ||
'2023-07-24 23:59:59', -- timestamp | ||
'{"key": "value"}', -- json | ||
'value3', -- enum | ||
0x4D7953514C, -- binary | ||
0x48656C6C6F20, -- varbinary | ||
_binary 'binary', -- blob | ||
'option1,option3' -- set | ||
); |
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
35 changes: 35 additions & 0 deletions
35
...ngine/js-connectors/smoke-test-js/prisma/postgres-neon/migrations/type_test/migration.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,35 @@ | ||
INSERT INTO type_test ( | ||
smallint_column, | ||
int_column, | ||
bigint_column, | ||
float_column, | ||
double_column, | ||
decimal_column, | ||
boolean_column, | ||
char_column, | ||
varchar_column, | ||
text_column, | ||
date_column, | ||
time_column, | ||
datetime_column, | ||
timestamp_column, | ||
json_column, | ||
enum_column | ||
) VALUES ( | ||
32767, -- smallint | ||
2147483647, -- int | ||
9223372036854775807, -- bigint | ||
3.402823466, -- float | ||
1.7976931348623157, -- double | ||
99999999.99, -- decimal | ||
TRUE, -- boolean | ||
'c', -- char | ||
'Sample varchar', -- varchar | ||
'This is a long text...', -- text | ||
'2023-07-24', -- date | ||
'23:59:59', -- time | ||
'2023-07-24 23:59:59', -- datetime | ||
'2023-07-24 23:59:59', -- timestamp | ||
'{"key": "value"}', -- json | ||
'value3' -- enum | ||
); |
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
64 changes: 0 additions & 64 deletions
64
query-engine/js-connectors/smoke-test-js/prisma/schema.prisma
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.