Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. var config = {
  2. client: 'mysql',
  3. connection: {
  4. host: '192.168.1.3', // Linux VM
  5. port: 3306,
  6. user: 'sandalphon',
  7. password: '*****',
  8. database: 'sandalphon'
  9. }
  10. }
  11.  
  12. var storage = require('knex')(config);
  13. var Promise = require('bluebird');
  14.  
  15. storage('information_schema.tables')
  16. .select(storage.raw('count(*) as count'))
  17. .where('table_schema', 'sandalphon')
  18. .then((response) => {
  19. console.log(response);
  20. }); // returning 4
  21.  
  22. storage('information_schema.tables')
  23. .select('*')
  24. .then((response) => {
  25. console.log(response);
  26. }); // returning [ Object ]
  27. process.exit(0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement