The story behind is that TiDB MySQL parser, which is by far the most MySQL compatible parser, was depending on some types called "parser_driver".
Parser Driver contains types from TiDB, but unfortunately, TiDB is not going to moving MySQL types, which is heavy entangled with TiDB, out as a independent Go package. GitHub issue:16381
To me, TiDB itself is mixing all its open-sourced modules as a very opinionated monolith.
I was porting MIST to WASM binary and TiDB syscalls will be stupidly included, compiled, and making static linking failed when targeting WASM.
Thus I spent a few days to extract the existing parser package and parser driver and re-export the entangled TiDB types into an ACTUALLY WORKING MySQL parser go package, which is truly cross-platform and ready to port to WASM.
Repository: https://github.com/abbychau/mysql-parser Interactive Parser Demo: https://abbychau.github.io/mysql-parser/