3 ms·
This is really great! Maybe I'll incorporate this into my own software (scratchdata/scratchdb) Question: it looks like you wrote the parser by hand. How did yo
by memset 3y ago
This is really great! Maybe I'll incorporate this into my own software (scratchdata/scratchdb)
Question: it looks like you wrote the parser by hand. How did you decide that that was the right approach? I myself am new to parsers and am working on implementing the PostgREST syntax in go using PEG to translate to Clickhouse, which is to say, a similar mission as this project. Would love to learn how you approached this problem!
- seer 3y agoI 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)