D
Deno

help

Can you recommend a mysql driver for deno that isn't a complete dead end?

BBairdy10/23/2023
mysql2 port: never updated. mysql driver: doesn't support strings mysql connector from Oracle: no one cares to port to Deno. ALL, I mean ALL I can think about is going back to superb PHP PDO. What a challenge...
TTehShrike12/22/2023
Did you ever end up finding anything @Bairdy? I'm trying to get it to work but having issues connecting https://discord.com/channels/684898665143206084/684898665151594506/1187550860746698833
ASAntonio Sampaio12/22/2023
i'm using knex with mysql2 from npm: and it just works
TTehShrike12/22/2023
does your server have SSL disabled?
ASAntonio Sampaio12/22/2023
yep (internal only) maybe its something with the ssl implementation and node compat
TTehShrike12/22/2023
Yeah, probably.
KWKevin Whinnery12/22/2023
If the mysql2 npm module isn't working, that's definitely a compatibility issue we should jump on - @toninho do deno if you have a reproduction case we could use to validate, that would be awesome
ASAntonio Sampaio12/22/2023
i guess @TehShrike can help with a reproduction case
TTehShrike12/22/2023
yeah, I can try to write up something more thorough, though about half the details are here: https://discord.com/channels/684898665143206084/684898665151594506/1187550860746698833 the rest of the details are: mysql 8.0.35, from the default macOS installer from https://dev.mysql.com/downloads/mysql/ with no my.cnf file. At some point I guess the default mysql settings started requiring TLS Besides passing in (or not) that ssl property to createConnection, I also passed in host, user, database, password Let me know if you want me to try anything else When I try connecting to PlanetScale with ssl: { rejectUnauthorized: false }, I get an error with the message "unavailable: unable to connect to branch tcancv32qlrt" and then "Uncaught Error: read UNKNOWN"
KWKevin Whinnery12/22/2023
So if I try to connect to a PlanetScale DB with the options you mention using mysql2 on npm, I should probably see what you are seeing
TTehShrike12/22/2023
hah, my PlanetScale database was asleep. One moment I am successfully able to connect to PlanetScale with ssl: { rejectUnauthorized: false } I am also able to connect to PS with ssl: { rejectUnauthorized: true } So everything seems cool there. The issue seems to be when connecting to a local database that requires SSL.
ASAntonio Sampaio12/22/2023
so... are u providing SSL on the local db and the server?
TTehShrike12/22/2023
I'm not providing a cert, but I am enabling SSL. When connecting to local:
error: Uncaught (in promise) Error: Bad handshake
at Object.createConnection (file:///Users/joshduff/git/photoquoter/node_modules/.deno/mysql2@2.3.3/node_modules/mysql2/promise.js:242:31)
at default (file:///Users/joshduff/git/photoquoter/server/mysql.ts:21:22)
at file:///Users/joshduff/git/photoquoter/server/index.ts:9:32
at eventLoopTick (ext:core/01_core.js:181:11)
error: Uncaught (in promise) Error: Bad handshake
at Object.createConnection (file:///Users/joshduff/git/photoquoter/node_modules/.deno/mysql2@2.3.3/node_modules/mysql2/promise.js:242:31)
at default (file:///Users/joshduff/git/photoquoter/server/mysql.ts:21:22)
at file:///Users/joshduff/git/photoquoter/server/index.ts:9:32
at eventLoopTick (ext:core/01_core.js:181:11)
KWKevin Whinnery12/22/2023
Yeah, I feel like now we are in the land of certificate handling, and Deno and Node have different mechanisms of handling SSL handshakes (if indeed Node is able to connect to your local DB)
TTehShrike12/22/2023
Yes, I am able to connect to the local db with node. I was also to connect to the local db in Deno using this native Deno library: https://github.com/denodrivers/mysql
KWKevin Whinnery12/22/2023
Hm, got it.
TTehShrike12/22/2023
Want me to create an issue?

Looking for more? Join the community!

Recommended Posts
Help with Slack CLI DeploymentSorry if this has already been answered, but I am trying to deploy my Slack app and I keep getting tOrganizing dependencies in workspace with several project folderSuppose you have a workspace with several folder, and in each folder you have a deno project. What iGitHub CLI from denoIs it possible/how to use the GitHub cli (gh) from JavaScript on deno? Using the `Github cli` I'm abHow can I change the port in Fresh?I have tried the following in the Main.ts await start(manifest, { port: 3000 }), But I suspect this Alternative to react-selectHello is there some alternative to react-select with fresh? I don't find any working with preact/frHow does Fresh run esbuild on Deploy without cache writes?I'm trying to build some solidjs code during runtime, but I keep getting errors on Deploy because ofPyCharm notebooks syntax highlightHello. I have set up Deno to work with pycharm. I am able to run a jupyter server with Deno kernel swasmbuild & rust module pathI try to call some rust modules in a wasm project https://deno.com/blog/wasmbuild My tree project iDeno does not recognize ".node" extension files**[name].node** is C++ *(kind of)* [addons](https://nodejs.org/api/addons.html#addons_loading_addonsCan use the --cert flag in the command line, but not in deno.jsonI am trying to run my deno program with the following command: `deno run -A --cert ~/tmp/ca.crt mainDeno - Sanitize FiltersDoes Deno have anything similar to https://www.php.net/manual/en/filter.filters.sanitize.php for HTTHaving a problem while getting a file from form. Oak.I'm having a problem while getting a file from a form. I can only read it's name, but not its body.[RESOLVED] Async Route vs Sync Route: Signatures are error-proneI am new to Deno Fresh and I ran into a strange bug (on my side), when changing a sync route to an aInstalling a deno scriptI have a deno script that I've written that takes a single arg. I want to install it so that I can cHow to bundle my projectI have a mod.js file that I wrote with Deno and I want to bundle it and it depends on bunch of otherOdd server requests on my Delpoy project...I was logging the requested paths to static files yesterday while troubleshooting an issue with a seerror on installingi do not know if im doing it right or something elseDeno equivalent os.cpus().lengthWhat’s the Deno Equivalent for `os.cpus().length`?How can I get deno to access internal packages from a workspace in npm or bun?I have the following workspace setup. I would like to have a deno/oak/kv project in the same folderHow to resolve requires without `.js` extension in a very basic NPM resolver?I have an NPM resolver that without caching that expects everything to be in a `node_modules` folder