Sqoosel
SQL-based Application Framework for Node.js
Installation
$ npm install sqoosel --save
Usage
Define your SQL engine
var sqoosel = ;;
The passing callback exec
will receive 4 arguments, then they are: exec(err, queryfn, closefn, client)
.
Define your schema and model
var sqoosel = ;var UserSchema = 'id': sqooseltypes 'username': sqooseltypes 'password': sqooseltypes 'createDate': sqooseltypes; moduleexports = sqoosel;
So close to mongoose ?
Using your model in your controller or anywhere that you want to use
var User = ; router;
For more function-based SQL generation, you should move forward to brianc/node-sql
createReadStream
with your model
It's SQL database, we need to apply your schemas, very simple to call Now show you howto generate .sql
init script:
// load your modelsvar User = ;User;
Then you will get the .sql
script like:
NOT EXIST user( ...);
How to pipe multiple models to one file? dominictarr/event-stream is the anwser:
var es = ;es;
If you want to check your SQL schema string, toString
are available for you as well:
var Model = ;console;
License
MIT