4 ms·
I also wrote a parser (in typescript) for postgres (https://github.com/ivank/potygen https://github.com/ivank/potygen), and it turned out quite the educational
by seer 3y ago
I also wrote a parser (in typescript) for postgres (https://github.com/ivank/potygen https://github.com/ivank/potygen), and it turned out quite the educational experience - Learned _a lot_ about the intricacies of SQL, and how to build parsers in general.
Turned out in webdev there are a lot of instances where you actually want a parser - legacy places where they used to save things in plain text for example, and I started seeing the pattern everywhere.
Where I would have reached for some monstrosity of a regex to solve this, now I just whip out a recursive decent parser and call it a day, takes surprisingly small amount of code! (https://github.com/dmaevsky/rd-parse https://github.com/dmaevsky/rd-parse)