Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test new supported column types #581

Merged
merged 3 commits into from Mar 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion query-engine/connectors/sql-query-connector/src/row.rs
Expand Up @@ -6,7 +6,7 @@ use quaint::{
ast::{DatabaseValue, ParameterizedValue},
connector::ResultRow,
};
use rust_decimal::{prelude::FromPrimitive, Decimal};
use rust_decimal::Decimal;
use std::{borrow::Borrow, io, str::FromStr};
use uuid::Uuid;

Expand Down
6 changes: 3 additions & 3 deletions query-engine/prisma/src/tests/type_mappings/mysql_types.rs
Expand Up @@ -120,7 +120,7 @@ async fn mysql_types_roundtrip(api: &TestApi) -> TestResult {
date_date: \"2020-02-27T00:00:00Z\"
date_datetime: \"2020-02-27T19:10:22Z\"
date_timestamp: \"2020-02-27T19:11:22Z\"
# date_time: \"2020-02-20T12:50:01Z\"
date_time: \"2020-02-20T12:50:01Z\"
date_year: 2012
string_char: \"make dolphins easy\"
string_varchar: \"dolphins of varying characters\"
Expand Down Expand Up @@ -173,7 +173,7 @@ async fn mysql_types_roundtrip(api: &TestApi) -> TestResult {
date_date
date_datetime
date_timestamp
# date_time
date_time
date_year
string_char
string_varchar
Expand Down Expand Up @@ -213,7 +213,7 @@ async fn mysql_types_roundtrip(api: &TestApi) -> TestResult {
"date_date": "2020-02-27T00:00:00.000Z",
"date_datetime": "2020-02-27T19:10:22.000Z",
"date_timestamp": "2020-02-27T19:11:22.000Z",
// "date_time": "2020-02-27T19:11:22.000Z",
"date_time": "1970-01-01T12:50:01.000Z",
"date_year": 2012,
"string_char": "make dolphins easy",
"string_varchar": "dolphins of varying characters",
Expand Down
16 changes: 14 additions & 2 deletions query-engine/prisma/src/tests/type_mappings/postgres_types.rs
Expand Up @@ -29,7 +29,7 @@ const CREATE_TYPES_TABLE: &str = indoc! {
string_text text,

binary_bytea bytea,
binary_bits bit(80),
binary_bits bit(7),
binary_bits_varying bit varying(80),
binary_uuid uuid,

Expand Down Expand Up @@ -129,6 +129,8 @@ async fn postgres_types_roundtrip(api: &TestApi) -> TestResult {
string_char: "yeet"
string_varchar: "yeet variable"
string_text: "to yeet or not to yeet"
binary_bits: "0101110"
binary_bits_varying: "0101110"
# binary_bytea: "test"
binary_uuid: "111142ec-880b-4062-913d-8eac479ab957"
time_timestamp: "2020-03-02T08:00:00.000"
Expand Down Expand Up @@ -168,6 +170,8 @@ async fn postgres_types_roundtrip(api: &TestApi) -> TestResult {
string_varchar
string_text
# binary_bytea
binary_bits
binary_bits_varying
binary_uuid
time_timestamp
time_timestamptz
Expand Down Expand Up @@ -213,6 +217,8 @@ async fn postgres_types_roundtrip(api: &TestApi) -> TestResult {
"string_char": "yeet ",
"string_varchar": "yeet variable",
"string_text": "to yeet or not to yeet",
"binary_bits": "0101110",
"binary_bits_varying": "0101110",
"binary_uuid": "111142ec-880b-4062-913d-8eac479ab957",
"time_timestamp": "2020-03-02T08:00:00.000Z",
"time_timestamptz": "2020-03-02T08:00:00.000Z",
Expand Down Expand Up @@ -313,7 +319,7 @@ const CREATE_ARRAY_TYPES_TABLE: &str = indoc! {
string_text text[],

binary_bytea bytea[],
binary_bits bit(80)[],
binary_bits bit(8)[],
binary_bits_varying bit varying(80)[],
binary_uuid uuid[],

Expand Down Expand Up @@ -384,6 +390,8 @@ async fn postgres_array_types_roundtrip(api: &TestApi) -> TestResult {
string_char: { set: ["yeet"] }
string_varchar: { set: ["yeet variable"] }
string_text: { set: ["to yeet or not to yeet"] }
binary_bits: { set: ["10100011"] }
binary_bits_varying: { set: ["01000"] }
binary_uuid: { set: ["111142ec-880b-4062-913d-8eac479ab957"] }
time_timestamp: { set: ["2020-03-02T08:00:00.000"] }
time_timestamptz: { set: ["2020-03-02T08:00:00.000"] }
Expand All @@ -407,6 +415,8 @@ async fn postgres_array_types_roundtrip(api: &TestApi) -> TestResult {
string_char
string_varchar
string_text
binary_bits
binary_bits_varying
binary_uuid
time_timestamp
time_timestamptz
Expand Down Expand Up @@ -438,6 +448,8 @@ async fn postgres_array_types_roundtrip(api: &TestApi) -> TestResult {
"string_char": ["yeet "],
"string_varchar": ["yeet variable"],
"string_text": ["to yeet or not to yeet"],
"binary_bits": ["10100011"],
"binary_bits_varying": ["01000"],
"binary_uuid": ["111142ec-880b-4062-913d-8eac479ab957"],
"time_timestamp": ["2020-03-02T08:00:00.000Z"],
"time_timestamptz": ["2020-03-02T08:00:00.000Z"],
Expand Down