If you want to support all of them, including handling all the different Postgres versions, it becomes quite a lot to implement.
I personally don't like abbreviations and prefer full queries.
\-commands look like hacks and smell like bad practice to me. It is something from the past.
Similarly, I prefer always to write --a-long-command-line-parameter-name in my scripts instead of -wTf.
But we added shorthand commands to ClickHouse for convenience, to please Postgres users.
Of course I'm not saying you can never bring up clickhouse, but at this point it's just becoming spam. High-effort spam, maybe. But still spam.
Some have \-commands, and some have .-commands, which I found hacky - because it is a micro language notation in addition to the actual language.
I will try to remember your login and not answer your comments in the future. At the same time, it is possible that I will occasionally answer your comments by mistake.
Cheers, Alexey.
I mean, if this works well for you then that's grand; just wanted to point out to others that \-commands are typically very "non-magic" and you don't need to go the route of translating C code.
I'm not sure if I entirely follow what translating C to JS gives you, other than a bit of (fairly simple) parsing of \cmd and flags? I didn't look too carefully at the code, so maybe I'm missing something.