title: Is it possible to generate knex seed files from a database dump?
body: <p>In my case, I am using mysql. However, I am looking for a general solution for generating knex seed files from either the currently running database or a database dump. </p>
  
  <p>I could do <a href="https://github.com/tgriesser/knex/issues/944#issuecomment-244346847" rel="nofollow noreferrer">something like</a>:</p>
  
  <pre><code>exports.seed = function(knex, Promise) {
      var sql = fs.readFileSync('./data/workbench.sql').toString();
      return knex.raw('DROP DATABASE workbench')
         .then(() =&gt; knex.raw('CREATE DATABASE workbench'))
         .then(() =&gt; knex.raw(sql))
  };
  </code></pre>
  
  <p>but it's not ideal ...</p>