Guest User

Untitled

a guest
Dec 25th, 2018
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. !pip install pixiedust
  2. !pip install pixiedust_node
  3. import pixiedust_node
  4. npm.install('mysql')
  5.  
  6. %%node
  7. var mysql = require('mysql');
  8. var dburl = 'database-url.com';
  9. var con = mysql.createConnection({
  10. host: dburl,
  11. user: 'dbuser',
  12. password: 'dbpassword',
  13. database: 'dbdatabase'
  14. });
  15. con.connect(function(err) {
  16. if (err) throw err;
  17. });
  18. var query ='SELECT user_created_date from user LIMIT 100';
  19. con.query(query, function (err, result, fields) {
  20. if (err) throw err;
  21. console.log(result);
  22. });
  23. con.end();
  24.  
  25. ... ... ... ... ... TypeError: Converting circular structure to JSON
  26. at JSON.stringify (<anonymous>)
  27. at globalVariableChecker (/home/javier/anaconda3/lib/python3.7/site-packages/pixiedust_node/pixiedustNodeRepl.js:26:22)
  28. at REPLServer.writer (/home/javier/anaconda3/lib/python3.7/site-packages/pixiedust_node/pixiedustNodeRepl.js:67:5)
  29. at finish (repl.js:683:38)
  30. at finishExecution (repl.js:310:7)
  31. at REPLServer.defaultEval (repl.js:396:7)
  32. at bound (domain.js:395:14)
  33. at REPLServer.runBound [as eval] (domain.js:408:12)
  34. at REPLServer.onLine (repl.js:639:10)
  35. at REPLServer.emit (events.js:182:13)
  36. /home/javier/anaconda3/lib/python3.7/site- packages/pixiedust_node/pixiedustNodeRepl.js:26
  37. const j = JSON.stringify(r.context[v]);
  38. ^
  39. TypeError: Converting circular structure to JSON
  40. at JSON.stringify (<anonymous>)
  41. at Timeout.globalVariableChecker [as _onTimeout] (/home/javier/anaconda3/lib/python3.7/site-packages/pixiedust_node/pixiedustNodeRepl.js:26:22)
  42. at ontimeout (timers.js:436:11)
  43. at tryOnTimeout (timers.js:300:5)
  44. at unrefdHandle (timers.js:520:7)
  45. at Timer.processTimers (timers.js:222:12)
Add Comment
Please, Sign In to add comment