can node-mysql be browserified?

637 views
Skip to first unread message

Kiril Kartunov

unread,
May 8, 2014, 11:33:22 AM5/8/14
to node-...@googlegroups.com
For instance with browserify?

I have tested/tried to do it but failed because browseify said something in the sense of: 
Can not find module ....xxxxxx.

Of course node-myslq was installed previously via npm.

Felix Geisendoerfer

unread,
May 8, 2014, 11:36:41 AM5/8/14
to node-...@googlegroups.com
What's your use case?

https://github.com/felixge/node-mysql/blob/master/lib/protocol/packets/index.js currently prevents browserify from working, but it could be fixed.

That being said, there is no TCP API in the browser, so you wouldn't be able to connect to a MySql Server without some proxy. In which case parsing the MySQL protocol itself would be better done on the proxy.


--
You received this message because you are subscribed to the Google Groups "node-mysql" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-mysql+...@googlegroups.com.
To post to this group, send email to node-...@googlegroups.com.
Visit this group at http://groups.google.com/group/node-mysql.
For more options, visit https://groups.google.com/d/optout.



--
Felix Geisendörfer (felixge.de)
Co-Founder, Debuggable Limited (debuggable.com)

// ravi

unread,
May 8, 2014, 12:15:36 PM5/8/14
to node-...@googlegroups.com
On May 8, 2014, at 11:36 AM, Felix Geisendoerfer <fe...@debuggable.com> wrote:
What's your use case?

https://github.com/felixge/node-mysql/blob/master/lib/protocol/packets/index.js currently prevents browserify from working, but it could be fixed.

That being said, there is no TCP API in the browser, so you wouldn't be able to connect to a MySql Server without some proxy. In which case parsing the MySQL protocol itself would be better done on the proxy.

On Thu, May 8, 2014 at 11:33 AM, Kiril Kartunov <kir...@gmail.com> wrote:
For instance with browserify?

I have tested/tried to do it but failed because browseify said something in the sense of: 
Can not find module ....xxxxxx.

Of course node-myslq was installed previously via npm.



Also keep in mind the security implications of allowing MySQL access from the browser (including supplying credentials).

—ravi


Kiril Kartunov

unread,
May 8, 2014, 1:27:31 PM5/8/14
to node-...@googlegroups.com, fe...@debuggable.com
Use case is achieving same functionality but from the client side (the browser).
There is no client side driver for Mysql from Javascript, this is what I'm after.
i think it will be very interesting project and also helpful. Communication would go via WebSockets or Ajax.

Emil Hagbarth Rasmussen

unread,
Oct 5, 2015, 6:23:02 AM10/5/15
to node-mysql, fe...@debuggable.com
Hey!
So I have a use case where I'm using the JAWS stack to create an API on top of a MySQL db.
So the issue is that the Lambda  (AWS)  functions' performance suffer significantly from a large codebase, so JAWS's solution is to browserify the package to make it smaller.
So none of the code runs on the client and everything is in a node environment, but still browserified.
Reply all
Reply to author
Forward
0 new messages