From 9fb34076f8df97e466e2d96b45091b3692bbe023 Mon Sep 17 00:00:00 2001 From: Brian C Date: Wed, 12 Dec 2012 23:05:33 -0600 Subject: [PATCH] update readme fix formatting issues. note to self: editing readme.md on github.com is the bomb. --- README.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 0e17b21..03f6461 100644 --- a/README.md +++ b/README.md @@ -29,18 +29,21 @@ var query = user .select(user.id) .from(user) .where( - user.name.equals('boom') - .and(user.id.equals(1)) + user.name.equals('boom').and(user.id.equals(1)) ).or( user.name.equals('bang').and(user.id.equals(2)) ).toQuery(); + //query is parameterized by default console.log(query.text); //SELECT "user"."id" FROM "user" WHERE ((("user"."name" = $1) AND ("user"."id" = $2)) OR (("user"."name" = $3) AND ("user"."id" = $4))) + console.log(query.values); //['boom', 1, 'bang', 2] //how about a join? -var query = user.select(user.name, post.content).from(user.join(post).on(user.id.equals(post.userId))).toQuery(); +var query = user.select(user.name, post.content) + .from(user.join(post).on(user.id.equals(post.userId))).toQuery(); + console.log(query.text); //'SELECT "user"."name", "post"."content" FROM "user" INNER JOIN "post" ON ("user"."id" = "post"."userId")' ``` @@ -51,16 +54,16 @@ There are a __lot__ more examples under `test/dialect-tests.js` I __love__ contributions. If you want to contribute here's what you do: 1. fork the repo -2. `git pull https://github.com//node-sql +2. `git pull https://github.com/(your_username)/node-sql` 3. `cd node-sql` 4. `npm install` 5. `npm test` -At this point the tests should pass for you. If they don't pass please open an issue with the output or you can even send me an email directly. My email address is on my github profile and every commit in the repo. +At this point the tests should pass for you. If they don't pass please open an issue with the output or you can even send me an email directly. My email address is on my github profile and also on every commit I contributed in the repo. -Once the tests are passing, modify as you see fit. Make sure you write tests to cover your modifications. Once you're ready, commit your changes and submit a pull request. +Once the tests are passing, modify as you see fit. _Please_ make sure you write tests to cover your modifications. Once you're ready, commit your changes and submit a pull request. -__As long as your pull request doesn't have completely off-the-wall changes I will almost always merge it right away and push it to npm__ +__As long as your pull request doesn't have completely off-the-wall changes and it does have tests I will almost always merge it right away and push it to npm__ If you think your changes are too off-the-wall, open an issue or a pull-request without code so we can discuss them.