r/SQL • • Aug 29 '26

MySQL Coding a database proxy for fun

https://packagemain.tech/p/golang-database-proxy
13 Upvotes

3 comments sorted by

View all comments

Show parent comment

1

u/der_gopher Aug 29 '26

Good point, but it's just an example. Easy to change the whole package if the length changes, or introduce some lexers.

1

u/Hour-Measurement-835 Aug 29 '26

Length's the easy half. src.Read isn't one packet though, so buffer[4] is only the command byte when the read happens to land on a boundary. A lexer won't fix that one.