File tree 1 file changed +36
-0
lines changed
1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,42 @@ var friendsWhoUseGmailQuery = userToFriends.where(friends.email.like('%@gmail.co
81
81
82
82
There are a __ lot__ more examples included in the ` test/dialects ` folder.
83
83
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
+
84
120
## contributing
85
121
86
122
I __ love__ contributions. If I could, I would write __ love__ 500 times, but that would be readme bloat.
You can’t perform that action at this time.
0 commit comments