Instructions for developers who wish to contribute or build upon the connector:
- Install rustup
- Install additional tools:
cargo install cargo-watch cargo-insta
- Install just
- Install Prettier
- Install Docker
- Install protoc. Here are a few options:
brew install protobuf
apt-get install protobuf-compiler
dnf install protobuf-compiler
cargo build
Run the SQL Server connector with:
cargo run serve --configuration '<directory>'
To test SQL Server, run:
cargo test
- Create a new file under
crates/ndc-sqlserver/tests/goldenfiles/<your-test-name>.json
- Create a new test in
crates/ndc-sqlserver/tests/query_tests.rs
that looks like this:#[tokio::test] async fn select_5() { let result = run_query("select_5").await; insta::assert_json_snapshot!(result); }
- Run the tests using
just test
orcargo test
- Create a new folder under
crates/query-engine/translation/tests/goldenfiles/<your-test-name>/
- Create
request.json
andtables.json
files in that folder to specify your request - Create a new test in
crates/query-engine/translation/tests/tests.rs
that looks like this:#[tokio::test] async fn select_5() { let result = common::test_translation("select_5").await; insta::assert_snapshot!(result); }
- Run the tests using
just test
orcargo test
Run just lint
to run clippy linter
run just lint-apply
to attempt to autofix all linter suggestions
Check your formatting is great with just format-check
.
Format all Rust code with just format
.