Skip to content

Latest commit

 

History

History
51 lines (34 loc) · 1.9 KB

CONTRIBUTING.md

File metadata and controls

51 lines (34 loc) · 1.9 KB

Contributing to Any-DB development

Want to help improve Any-DB? The right place to start depends on what you want to do:

I want to write a new adapter

Awesome! You'll probably want to review the spec, and maybe some of the existing adapters. When it's time to write some code, you can add the spec to your devDependencies and use it to test your adapter for compliance:

npm install --save-dev any-db-adapter-spec
node_modules/.bin/test-any-db-adapter --url "my-adapter://user@host/database"

I want to improve an existing adapter

Cool, then you will find the adapter code in the packages directory:

I want to improve the connection pool

It lives over here: any-db-pool

I want to improve the transaction object

It's over in this repo: any-db-transaction. Testing it is a bit weird because it's mostly tested transitively via the adapters that depend on it. This is something I'd like to improve but for now you should clone one of the adapter repos and npm link your dev copy of the transaction in place, then run the tests for the adapter to check your changes.

Creating a pull-request

For changes to an existing API please open an issue to discuss the proposed change before implementing it. Code-first-ask-questions-later is fun, but I'd really hate for anybody to put their time into something that won't be merged.

Code style

I'm not terribly picky about code-formatting, but please try to match the style of the code around your change. In particular, use two-space tabs, and keep lines under 80 characters long if you can help it.

If a patch you're working on is getting hairy, don't be afraid to refactor existing code.