Skip to content

Commit 54cdc08

Browse files
committed
Merge pull request #73 from tmont/master
Updated README with instructions on how to use the sql-generate module
2 parents 954286a + 0655f3c commit 54cdc08

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

README.md

+36
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,42 @@ var friendsWhoUseGmailQuery = userToFriends.where(friends.email.like('%@gmail.co
8181

8282
There are a __lot__ more examples included in the `test/dialects` folder.
8383

84+
## from the command line
85+
You can use the [sql-generate module](https://github.com/tmont/node-sql-generate)
86+
to automatically generate definition files from a database instance. For example,
87+
running `node-sql-generate --dsn "mysql://user:password@host/database"` will generate
88+
something similar to:
89+
90+
```javascript
91+
// autogenerated by node-sql-generate v0.0.1 on Tue May 21 2013 01:04:12 GMT-0700 (PDT)
92+
var sql = require('sql');
93+
94+
/**
95+
* SQL definition for database.bar
96+
*/
97+
exports.bar = sql.define({
98+
name: 'bar',
99+
columns: [
100+
'id',
101+
'foo_id'
102+
]
103+
});
104+
105+
/**
106+
* SQL definition for database.foo
107+
*/
108+
exports.foo = sql.define({
109+
name: 'foo',
110+
columns: [
111+
'id',
112+
'field_1',
113+
'foo_bar_baz'
114+
]
115+
});
116+
```
117+
118+
Read the module's documentation for more details.
119+
84120
## contributing
85121

86122
I __love__ contributions. If I could, I would write __love__ 500 times, but that would be readme bloat.

0 commit comments

Comments
 (0)