<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Node.js on shocksolution.com</title><link>https://shocksolution.com/tags/node.js/</link><description>Recent content in Node.js on shocksolution.com</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Thu, 22 Apr 2021 18:54:25 +0000</lastBuildDate><atom:link href="https://shocksolution.com/tags/node.js/index.xml" rel="self" type="application/rss+xml"/><item><title>Node.js: Connecting to MySQL on a socket with Sequelize</title><link>https://shocksolution.com/posts/node-js-connecting-to-mysql-on-a-socket-with-sequelize/</link><pubDate>Thu, 22 Apr 2021 18:54:25 +0000</pubDate><guid>https://shocksolution.com/posts/node-js-connecting-to-mysql-on-a-socket-with-sequelize/</guid><description>&lt;p&gt;According to its official description, &amp;ldquo;&lt;a href="https://sequelize.org/master/index.html"&gt;Sequelize is a promise-based Node.js ORM for Postgres, MySQL, MariaDB, SQLite and Microsoft SQL Server.&lt;/a&gt;&amp;rdquo; Sequelize is widely used in Node.js web applications to abstract the database layer. I recently found a &amp;ldquo;corner case&amp;rdquo; for Sequelize which is possible to accomplish, but is not well documented anywhere on the web. I need to use Sequelize to connect to a MySQL server via a UNIX socket. I&amp;rsquo;m developing some plugins for Confluence that use the &lt;a href="https://bitbucket.org/atlassian/atlassian-connect-express/src/master/"&gt;atlassian-connect-express&lt;/a&gt; toolkit, which has a datastore that wraps Sequelize. The way Atlassian has chosen to wrap Sequelize is rather unfortunate, probably because they are trying to maintain backwards compatibility with JugglingDB. Essentially, the Atlassian Connect Express only looks at the URL, and ignores any option passed to Sequelize. Therefore, you have to pass everything you need via the URL, and this is where it&amp;rsquo;s tricky. Here&amp;rsquo;s the form of the URL that you need to connect to MySQL via a UNIX socket with Sequelize:&lt;/p&gt;</description></item></channel></rss>