Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add CONTRIBUTING and LICENSE files, more doc updates

  • Loading branch information...
commit 256e64cc0e6316920929430e1915c50bdc834983 1 parent 8d456dc
Stephen Sugden authored
39 CONTRIBUTING.md
View
@@ -0,0 +1,39 @@
+# Contributing to Any-DB development
+
+Want to help improve Any-DB? You're in the right place.
+
+## Setting up
+
+To get started, clone this git repo and run `make dev_deps`. This will symlink
+all of the sub-packages into place in your local directory and then install any
+remaining dependencies from npm. This is important because it means that you can
+be sure that tests will be run against the code in source-control, and not
+packages installed from the npm registry.
+
+## Running tests
+
+After you've run `make dev_deps` you can run `make test` to run the tests. The
+tests require that *both* a MySQL and Postgres server are available and
+accessible at the Any-DB URLs defined by the environment variable
+`any_db_mysql_test_url` and `any_db_postgres_test_url`. If these env variables
+are undefined or empty, the default values of
+`mysql://root@localhost/any_db_test` and
+`postgres://postgres@localhost/any_db_test` will be used.
+
+If you wish to disable testing of a particular backend for a test run, you can
+define the environment variable `any_db_test_drivers` to a comma separated list
+of driver names.
+
+## 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 avoid mixing
+tabs and spaces, 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.
19 LICENSE
View
@@ -0,0 +1,19 @@
+Copyright (c) 2013 Stephen Sugden
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
32 README.md
View
@@ -1,11 +1,13 @@
-# Any-DB - a less-opinionated database abstraction layer.
+# Any-DB Project
[![Build Status](https://secure.travis-ci.org/grncdr/node-any-db.png?branch=master)](http://travis-ci.org/grncdr/node-any-db)
-**v1.0.0-alpha1 released**
+_The less-opinionated Node.js database abstraction layer_
-_Any-DB 1.0.*_ significantly restructures the various `any-db-*` modules and
-you *will* need to update your package.json
+## [ANN] v1.0.0-alpha1 released
+
+Any-DB 1.0 significantly restructures the various `any-db-*` modules. If you
+are updating from a previous version you *will* need to update `package.json`.
**Applications** should replace an `any-db` dependency with one or more
dependencies on `any-db-<adapter>` where `adapter` can be `mysql`, `postgres`,
@@ -18,12 +20,10 @@ that `any-db` will be pulled in transitively as a dependency on the same level
as the adapter.
**Libraries** should move their `any-db` dependency to `peerDependencies`,
-even though things will appear to operate correctly without doing so. If your
+even though things may appear to operate correctly without doing so. If your
library depends on a database connection (e.g. for tests) you should also add
a peerDependency on the corresponding `any-db-<adapter>` library.
-[query]: https://github.com/grncdr/node-any-db/blob/master/API.md
-
## Synopsis
(There's also detailed [API][API] documentation available)
@@ -73,11 +73,6 @@ The purpose of this library is to provide a consistent API for the commonly used
functionality of SQL database drivers, while avoiding altering driver behaviour
as much as possible.
-The long-term goal of this project is to serve as the testing ground for finding
-a suitable common interface, then (hopefully) convincing driver implementors to
-support it natively. In short, any-db hopes to prove it's usefulness well enough
-that most of it can be obviated by the drivers themselves.
-
### Things it does
* Supports MySQL, Postgres, and SQLite3 as equally as possible. (More driver
@@ -102,21 +97,10 @@ that most of it can be obviated by the drivers themselves.
[alternatives](https://encrypted.google.com/search?q=sql&q=site:npmjs.org&hl=en)
for that. _(send me pull requests to list your libs here)_
-## Install
+## Installation
npm install --save any-db-{pg,mysql,sqlite3}
-## Contributing
-
-For ideas that would change an existing API or behaviour please open an issue to
-propose the change before spending time on implementing it. I know it's hard (I
-code-first-ask-questions-later *way* too frequently :smile:) but I'd really hate
-for anybody to put their time into something that won't be merged.
-
-I'm not terribly picky about code-formatting, but please try and keep lines
-under 80 characters long if you can help it.
-
-
## License
MIT
16 any-db/README.md
View
@@ -0,0 +1,16 @@
+# Any-DB - a less-opinionated database abstraction layer.
+
+This is the main entry point for Any-DB. Users of the library will
+`require('any-db')` to make use of the [API](API.md) it exposes.
+
+## Installation
+
+Do not install this library directly. Instead, install one or more of the
+database adapters, which will pull in `any-db` as a peerDependency. For example:
+
+ npm install --save any-db-mysql
+ npm install --save-dev any-db-sqlite3
+
+## License
+
+MIT
10 test/helpers.js
View
@@ -6,14 +6,14 @@ require('any-db-sqlite3').verbose()
var sqliteFilename = "/tmp/any-db-test.db"
var databaseUrls = exports.databaseUrls = {
- mysql: "mysql://root@localhost/any_db_test",
- postgres: "postgres://postgres@localhost/any_db_test",
- sqlite3: "sqlite3://" + sqliteFilename
+ mysql: process.env.any_db_mysql_test_url || "mysql://root@localhost/any_db_test",
+ postgres: process.env.any_db_postgres_test_url || "postgres://postgres@localhost/any_db_test",
+ sqlite3: process.env.any_db_sqlite3_test_url || "sqlite3://" + sqliteFilename
}
-if (process.env.TEST_DRIVERS) {
+if (process.env.any_db_test_drivers) {
Object.keys(databaseUrls).forEach(function (driver) {
- if (process.env.TEST_DRIVERS.indexOf(driver) == -1) {
+ if (process.env.any_db_test_drivers.indexOf(driver) == -1) {
delete databaseUrls[driver]
}
})
Please sign in to comment.
Something went wrong with that request. Please try again.