limbo/bindings/javascript/docs/CONTRIBUTING.md
2025-06-05 14:42:44 -03:00

1.5 KiB

Contributing

So you want to contribute to Limbo's binding for the second best language in the world? Awesome.

First things first you'll need to install napi-rs, follow the instructions here althought is highly recommended to use yarn with:

yarn global add @napi-rs/cli

Run yarn build to build our napi project and run yarn test to run our test suite, if nothing breaks you're ready to start!

API

You can check the API docs here, it aims to be fully compatible with better-sqlite and borrows some things from libsql. So if you find some incompability in behaviour and/or lack of functions/attributes, that's an issue and you should work on it for a great good :)

Code Structure

The Rust code for the bind is on lib.rs. It's exposed to JS users through wrapper, where you can use some JS' weirdness facilities, for instance, since Rust doesn't have variadic functions the wrapper enables us to "normalize" bindParameters into an array.

All tests should be within the test folder.

Before open a PR

Please be assured that:

  • Your fix/feature has a test checking the new behaviour;
  • Your code follows Rust's conventions with cargo fmt;
  • If applicable, update the API docs to match the current implementation;