1. Why it's `.cpp` file?
This code does not work when added to `.h` file (emscripten does not parse it then and has no reflection in generated module).
2. Why it's called `SQLiteQueryExecutorBindings.cpp`?
This code to work (for some reason) needs to be placed along with binding, in next diff I am adding `SQLiteQueryExecutor` bindings to this file.
3. Why this idea?
We can automate using JS array <-> std::vector marshalling. Without this will need to:
- bind each vector type (for emscripten `std::vector<int>` and `std::vector<std::string>` are two different types.
- passing data to `.wasm` module, we will have to create vector objects in JS, add data to it using `put()` method
- parse data returned from `.wasm` module
This makes this process cleaner and easier for devs.
4. Inspiration
This issue: [11070](https://github.com/emscripten-core/emscripten/issues/11070)
5. How it works?
- It uses Template Specialization concept
- it uses SFINAE to ensure it behaves properly for `std::vector` and ignores other types without an error
6. Sources:
- [definition and type specialization for other types](https://github.com/emscripten-core/emscripten/blob/87b495148dc361a5cbdc020408e7a0420f730a0b/system/include/emscripten/wire.h#L244)
- [TypeID definition](https://github.com/emscripten-core/emscripten/blob/87b495148dc361a5cbdc020408e7a0420f730a0b/system/include/emscripten/wire.h#L99C44-L100C1).
Depends on D8551