Skip to content

Commit

Permalink
Merge branch 'main' into feat/sql-query-connector-on-wasm32-unknown-u…
Browse files Browse the repository at this point in the history
…nknown
  • Loading branch information
jkomyno committed Nov 17, 2023
2 parents 7359a08 + 49084af commit 33cdf77
Show file tree
Hide file tree
Showing 18 changed files with 30 additions and 119 deletions.
2 changes: 1 addition & 1 deletion .buildkite/engineer
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ fi
# Check if the system has engineer installed, if not, use a local copy.
if ! type "engineer" &> /dev/null; then
# Setup Prisma engine build & test tool (engineer).
curl --fail -sSL "https://prisma-engineer.s3-eu-west-1.amazonaws.com/1.62/latest/$OS/engineer.gz" --output engineer.gz
curl --fail -sSL "https://prisma-engineer.s3-eu-west-1.amazonaws.com/1.63/latest/$OS/engineer.gz" --output engineer.gz
gzip -d engineer.gz
chmod +x engineer

Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/query-engine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ jobs:
fail-fast: false
matrix:
database:
- name: 'vitess_5_7'
single_threaded: true
connector: 'vitess'
version: '5.7'
- name: 'vitess_8_0'
single_threaded: true
connector: 'vitess'
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/schema-engine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,6 @@ jobs:
url: 'postgresql://prisma@localhost:26257'
- name: sqlite
url: sqlite
- name: vitess_5_7
url: 'mysql://root:prisma@localhost:33577/test'
shadow_database_url: 'mysql://root:prisma@localhost:33578/shadow'
is_vitess: true
single_threaded: true
- name: vitess_8_0
url: 'mysql://root:prisma@localhost:33807/test'
shadow_database_url: 'mysql://root:prisma@localhost:33808/shadow'
Expand Down
2 changes: 0 additions & 2 deletions .test_database_urls/vitess_5_7

This file was deleted.

20 changes: 10 additions & 10 deletions Cargo.lock

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

6 changes: 0 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,6 @@ dev-mongodb_5: start-mongodb_5
dev-mongodb_4_2: start-mongodb_4_2
cp $(CONFIG_PATH)/mongodb42 $(CONFIG_FILE)

start-vitess_5_7:
docker compose -f docker-compose.yml up --wait -d --remove-orphans vitess-test-5_7 vitess-shadow-5_7

dev-vitess_5_7: start-vitess_5_7
cp $(CONFIG_PATH)/vitess_5_7 $(CONFIG_FILE)

start-vitess_8_0:
docker compose -f docker-compose.yml up --wait -d --remove-orphans vitess-test-8_0 vitess-shadow-8_0

Expand Down
40 changes: 0 additions & 40 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -222,26 +222,6 @@ services:
- databases
tmpfs: /var/lib/mariadb

vitess-test-5_7:
image: vitess/vttestserver:mysql57@sha256:23863a518b34330109c502ac61a396008f5f023e96263bcb2bb1b0f7f7d5dc7f
restart: unless-stopped
ports:
- 33577:33577
environment:
PORT: 33574
KEYSPACES: 'test'
NUM_SHARDS: '1'
MYSQL_BIND_HOST: '0.0.0.0'
FOREIGN_KEY_MODE: 'disallow'
ENABLE_ONLINE_DDL: false
MYSQL_MAX_CONNECTIONS: 100000
TABLET_REFRESH_INTERVAL: '500ms'
healthcheck:
test: ['CMD', 'mysqladmin', 'ping', '-h127.0.0.1', '-P33577']
interval: 5s
timeout: 2s
retries: 20

vitess-test-8_0:
image: vitess/vttestserver:mysql80@sha256:8bec2644d83cb322eb2cdd596d33c0f858243ba6ade9164c95dfcc519643094e
restart: unless-stopped
Expand All @@ -262,26 +242,6 @@ services:
timeout: 2s
retries: 20

vitess-shadow-5_7:
image: vitess/vttestserver:mysql57@sha256:23863a518b34330109c502ac61a396008f5f023e96263bcb2bb1b0f7f7d5dc7f
restart: unless-stopped
ports:
- 33578:33577
environment:
PORT: 33574
KEYSPACES: 'shadow'
NUM_SHARDS: '1'
MYSQL_BIND_HOST: '0.0.0.0'
FOREIGN_KEY_MODE: 'disallow'
ENABLE_ONLINE_DDL: false
MYSQL_MAX_CONNECTIONS: 100000
TABLET_REFRESH_INTERVAL: '500ms'
healthcheck:
test: ['CMD', 'mysqladmin', 'ping', '-h127.0.0.1', '-P33577']
interval: 5s
timeout: 2s
retries: 20

vitess-shadow-8_0:
image: vitess/vttestserver:mysql80@sha256:8bec2644d83cb322eb2cdd596d33c0f858243ba6ade9164c95dfcc519643094e
restart: unless-stopped
Expand Down
47 changes: 12 additions & 35 deletions flake.lock

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

2 changes: 0 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
crane = {
url = "github:ipetkov/crane";
inputs.nixpkgs.follows = "nixpkgs";
inputs.rust-overlay.follows = "rust-overlay";
inputs.flake-utils.follows = "flake-utils";
};
flake-utils = {
url = "github:numtide/flake-utils";
Expand Down
2 changes: 1 addition & 1 deletion prisma-schema-wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ edition = "2021"
crate-type = ["cdylib"]

[dependencies]
wasm-bindgen = "=0.2.87"
wasm-bindgen = "=0.2.88"
wasm-logger = { version = "0.2.0", optional = true }
prisma-fmt = { path = "../prisma-fmt" }
2 changes: 1 addition & 1 deletion query-engine/black-box-tests/tests/metrics/smoke_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ mod smoke_tests {

fn assert_value_in_range(metrics: &str, metric: &str, low: f64, high: f64) {
let regex = Regex::new(format!(r"{metric}\s+([+-]?\d+(\.\d+)?)").as_str()).unwrap();
match regex.captures(&metrics) {
match regex.captures(metrics) {
Some(capture) => {
let value = capture.get(1).unwrap().as_str().parse::<f64>().unwrap();
assert!(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ pub(crate) fn connection_string(
None => unreachable!("A versioned connector must have a concrete version to run."),
}
}
ConnectorVersion::Vitess(Some(VitessVersion::V5_7)) => "mysql://root@localhost:33577/test".into(),
ConnectorVersion::Vitess(Some(VitessVersion::V8_0)) => "mysql://root@localhost:33807/test".into(),
ConnectorVersion::Vitess(None) => unreachable!("A versioned connector must have a concrete version to run."),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ impl ConnectorTagInterface for VitessConnectorTag {

#[derive(Debug, Clone, Copy, PartialEq)]
pub enum VitessVersion {
V5_7,
V8_0,
}

Expand All @@ -42,7 +41,6 @@ impl FromStr for VitessVersion {

fn from_str(s: &str) -> Result<Self, Self::Err> {
let version = match s {
"5.7" => Self::V5_7,
"8.0" => Self::V8_0,
_ => return Err(TestError::parse_error(format!("Unknown Vitess version `{s}`"))),
};
Expand All @@ -54,7 +52,6 @@ impl FromStr for VitessVersion {
impl Display for VitessVersion {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Self::V5_7 => write!(f, "5.7"),
Self::V8_0 => write!(f, "8.0"),
}
}
Expand Down
3 changes: 0 additions & 3 deletions query-engine/connector-test-kit-rs/test-configs/vitess_5_7

This file was deleted.

2 changes: 1 addition & 1 deletion query-engine/driver-adapters/src/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ mod proxy_test {
let s = "13:02:20.321";
let json_value = serde_json::Value::String(s.to_string());
let quaint_value = js_value_to_quaint(json_value, column_type, "column_name").unwrap();
let time: NaiveTime = NaiveTime::from_hms_milli_opt(13, 02, 20, 321).unwrap();
let time: NaiveTime = NaiveTime::from_hms_milli_opt(13, 2, 20, 321).unwrap();
assert_eq!(quaint_value, QuaintValue::time(time));
}

Expand Down
2 changes: 1 addition & 1 deletion query-engine/query-engine-wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ serde_json.workspace = true
serde.workspace = true
tokio = { version = "1.25", features = ["macros", "sync", "io-util", "time"] }
futures = "0.3"
wasm-bindgen = "=0.2.87"
wasm-bindgen = "=0.2.88"
wasm-bindgen-futures = "0.4"
serde-wasm-bindgen = "0.5"
js-sys = "0.3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use indoc::indoc;
use sql_introspection_tests::test_api::*;
use test_macros::test_connector;

// Note: MySQL 5.6 ad 5.7 do not support check constraints, so this test is only run on MySQL 8.0.
// Note: MySQL 5.6 and 5.7 do not support check constraints, so this test is only run on MySQL 8.0.
#[test_connector(tags(Mysql8), exclude(Vitess))]
async fn check_constraints_stopgap(api: &mut TestApi) -> TestResult {
let raw_sql = indoc! {r#"
Expand Down
4 changes: 2 additions & 2 deletions schema-engine/sql-migration-tests/tests/native_types/mysql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -697,8 +697,8 @@ fn filter_from_types(api: &TestApi, cases: Cases) -> Cow<'static, [Case]> {
return Cow::Owned(
cases
.iter()
.filter(|&(ty, _, _)| !type_is_unsupported_mariadb(ty))
.cloned()
.filter(|(ty, _, _)| !type_is_unsupported_mariadb(ty))
.collect(),
);
}
Expand All @@ -707,8 +707,8 @@ fn filter_from_types(api: &TestApi, cases: Cases) -> Cow<'static, [Case]> {
return Cow::Owned(
cases
.iter()
.filter(|&(ty, _, _)| !type_is_unsupported_mysql_5_6(ty))
.cloned()
.filter(|(ty, _, _)| !type_is_unsupported_mysql_5_6(ty))
.collect(),
);
}
Expand Down

0 comments on commit 33cdf77

Please sign in to comment.