Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I've made a library that generates Typescript types from a PG database and I see a variation of this problem: since the "reflection" capabilities on views don't tell me about references in their source tables, I lose the ability to see where a foreign key points to. I normally use this to create nominal ID types, but in views I can just create strings or numbers.

I am trying to work around this but so far my only solution is to parse the SQL of the view definition and extract the information from there. I have it somewhat working but it's a bit complex for my liking..



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: