title: How to use knexjs globally in a sails js application
body: <p>how do i get the knex object in my controllers or any other model files if i am not using waterline.</p>
  
  <p>for eg.:
  in my api/models/Users.js</p>
  
  <pre><code>module.exports = {
       find : function(id){
           // my knex query
       },
       insert : function(data){
           // my knex query again   
       } 
  }
  </code></pre>
  
  <p>So in my controllers i will just do:</p>
  
  <pre><code>var result = Users.find(id);
  </code></pre>
  
  <p>or </p>
  
  <pre><code>var result = Users.insert({username : 'sailsjs'});
  </code></pre>
  
  <p>or the knex object will be available globally with out being used in the model files itself... so that i can do the knex query in the controller it self </p>
  
  <p>// UsersController/index</p>
  
  <pre><code>index : function(req, res){
        // my knex query
  }
  </code></pre>
  
  <p>Thanks
  Arif</p>