-
-
Notifications
You must be signed in to change notification settings - Fork 624
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handling infileStreamFactory
at connection-level
#2151
Comments
hi @loozhengyuan I'm keen to have this fixed on mysql2 side, can we start with a simple repro example? |
Sure, I have created a repro of the issue, using Separately, I also created a draft version of the patch and managed to get it working in the |
the change looks ok. We might actually not need extra sql parameter. My thinking was more of a "virtual file system": given query X and a file name Y (from that query), return a way to read the data. But in reality most use cases is just a security gate / allowlist: an INFILE query wants a file XYZ, if it's a safe path read the file under the same name from fs Feel free to open a PR. It's probably a minor version bump ( not patch ): clients using updated mysql2 library might not work with the version before your fix. |
The
infileStreamFactory
option only works when callingconnection.query()
orconnection.execute()
, which is as documented.However, if I set it on a connection-level as suggested in #1080, the configuration is currently not propagated when calling
connection.query()
orconnection.execute()
. Since I am using Sequelize, which only exposes the connection configuration viadialectOptions
, there is no other way I can set theinfileStreamFactory
option.To help move this forward, I am keen to know where the change should be made:
infileStreamFactory
connection option inmysql2
and pass it when callingCommands.Execute()
/Commands.Query()
; orAny comments/feedback is deeply appreciated, thanks!
The text was updated successfully, but these errors were encountered: