Skip to content
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

Support SQLite at the network connection level #1341

Open
adamziel opened this issue Apr 29, 2024 · 2 comments
Open

Support SQLite at the network connection level #1341

adamziel opened this issue Apr 29, 2024 · 2 comments

Comments

@adamziel
Copy link
Collaborator

The SQLite database integration plugin is great when you use $wpdb, but plugin authors call mysqli_connect and new PDO() all the time.

Playground could intercept the outgoing network traffic and pretend to have a running MySQL server just like the stream wrappers support pretends to be an HTTPS server. It would implement the MySQL connection protocol and run all the transmitted queries against SQLite.

@adamziel
Copy link
Collaborator Author

Npm package implementing a MySQL server text protocol:

https://sidorares.github.io/node-mysql2/docs/documentation/mysql-server

The binary protocol isn't supported — is it required by PHP, or is the text protocol enough?

@adamziel
Copy link
Collaborator Author

adamziel commented May 20, 2024

Another idea: this MySQL "fake server" written in Rust could perhaps be compiled to WASM and used to pipe the queries back to the SQLite plugin. Or, if that's difficult to instrument, maybe it could be ported to TypeScript or even PHP?

https://github.com/jonhoo/msql-srv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant