0.10.0 • Published 10 years ago

gesundheit v0.10.0

Weekly downloads
1,047
License
MIT
Repository
github
Last release
10 years ago

Gesundheit - Concise SQL generation for node.js

.. image:: https://secure.travis-ci.org/BetSmartMedia/gesundheit.png?branch=master :target: http://travis-ci.org/BetSmartMedia/gesundheit

Gesundheit generates SQL using a sugary API for managing the abstract syntax tree of a statement. After building your statement programmatically, gesundheit can compile it to a string or execute it against your database for you, using proper bound parameters and allowing for streaming of results.

Here's a quick example to illustrate::

select = require('./lib').select
assert = require('assert')
query = select('chairs', ['chair_type', 'size'])
  .where({chair_type: 'recliner', weight: {lt: 25}})

assert.deepEqual(query.compile(), [
  'SELECT chairs.chair_type, chairs.size FROM chairs WHERE chairs.chair_type = ? AND chairs.weight < ?',
  ['recliner', 25]
])

query.execute(console.log)

See the documentation <http://betsmartmedia.github.com/gesundheit/>_ for full API documentation and more examples showing different query types, joins, query execution and more.

Install

In addition to the usual npm install gesundheit, you will need to install the driver for your database. Driver support is provided by Any-DB <https://github.com/grncdr/node-any-db>_, which currently supports MySQL, Postgres and SQLite3. So for example, if you use PostgreSQL as your database backend you would do npm install --save any-db-postgres.

License

MIT

Author

Stephen Sugden glurgle@gmail.com

0.10.0

10 years ago

0.9.0

11 years ago

0.8.10

11 years ago

0.8.9

11 years ago

0.8.8

11 years ago

0.8.7

11 years ago

0.6.0-b

11 years ago

0.8.5

11 years ago

0.8.4

11 years ago

0.8.3

11 years ago

0.8.2

11 years ago

0.8.1

11 years ago

0.8.0

11 years ago

0.7.9

11 years ago

0.7.8

11 years ago

0.7.6

11 years ago

0.7.4

11 years ago

0.7.3

11 years ago

0.7.2

11 years ago

0.7.1

11 years ago

0.7.0

11 years ago

0.6.6

11 years ago

0.6.5

11 years ago

0.6.4

11 years ago

0.6.2

11 years ago

0.6.1

11 years ago

0.6.0-rc3

11 years ago

0.6.0-rc2

11 years ago

0.6.0-rc1

11 years ago

0.6.0b

11 years ago

0.6.0

11 years ago

0.5.2

12 years ago

0.5.1

12 years ago

0.5.0

12 years ago

0.5.0-beta1

12 years ago

0.4.1

12 years ago

0.4.0

12 years ago

0.3.2

12 years ago

0.3.1

12 years ago

0.3.0

12 years ago

0.2.6

12 years ago

0.2.5

12 years ago

0.1.6

12 years ago

0.2.4

12 years ago

0.2.3

12 years ago

0.2.2

12 years ago

0.2.1

12 years ago

0.1.5

12 years ago

0.1.4

13 years ago

0.1.3

13 years ago

0.1.2

13 years ago

0.1.1

13 years ago

0.0.4

13 years ago

0.0.3

13 years ago

0.0.2

13 years ago

0.0.1

13 years ago