<commit_before># node-db-query

Create SQL queries programatically in Node.js. Loosely based on Rails' ActiveRelation.

## Getting Started
Install the module with: `npm install db-query`

## Examples
```javascript
var Query = require('db-query');

var options = { id: [1,2,3,4] };
// or options = { id: '1,2,3,4' };

var q = new Query()
  .select('*')
  .from('users')
  .join('LEFT JOIN posts ON posts.user_id = users.id')<commit_msg>Updated README.md to show any-db usage<commit_after># node-db-query

Create SQL queries programatically in Node.js. Loosely based on Rails' ActiveRelation.

## Getting Started
Install the module with: `npm install db-query`

## Examples
```javascript
var Query = require('db-query');
var anyDB = require('any-db');
var database = 'postgres://user@host:5432/database_name';

var dbPool = anyDB.createPool(database, {
  min: 5,
  max: 15,
  onConnect: function (conn, done) {
    done(null, conn);
  },
  reset: function (conn, done) {
    done(null);
  }
});

var options = { id: [1,2,3,4] };
// or options = { id: '1,2,3,4' };

var q = new Query(dbPool)
  .select('*')
  .from('users')
  .join('LEFT JOIN posts ON posts.user_id = users.id')
{'fraction_non_alphanumeric': 0.16595744680851063, 'fraction_numerical': 0.01957446808510638, 'mean_word_length': 4.047210300429184, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2781458', 'n_tokens_mistral': 429, 'n_tokens_neox': 415, 'n_words': 122}