Re:Psql-describe: \d ported to JavaScript
by gmac on Wednesday May 08, 2024 @02:25PM
(#40301378)
Some commands issue multiple queries and include logic for stitching the results into a nice table. There’s not a one-to-one mapping from commands to queries by any means.
[ Parent
| on HN ]
Yeah, that's right; but the "glue code" I've had to write for this has been really minimal. Certainly less effort than translating C to JavaScript with regexps (that on its own is something of an accomplishment). I didn't port everything so maybe I missed some more complex bits.
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.