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 protobufapt-get install protobuf-compilerdnf install protobuf-compiler
cargo buildRun 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.rsthat 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 testorcargo test
- Create a new folder under
crates/query-engine/translation/tests/goldenfiles/<your-test-name>/ - Create
request.jsonandtables.jsonfiles in that folder to specify your request - Create a new test in
crates/query-engine/translation/tests/tests.rsthat 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 testorcargo 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.