kriasoft / knex-types

Generate TypeScript definitions (types) from a PostgreSQL database schema.
MIT License
63 stars 21 forks source link

instead of enum Tables allow an object with table.value for easy access #23

Open zadokdaniel opened 2 years ago

zadokdaniel commented 2 years ago

Maybe instead of heaving an Enum of Tables create objects with all the possible keys for cases of duplicate column names on joins and selects.

some code that does that: https://gist.github.com/zadokdaniel/ea4dd31e13957c717ffb26e238f25173

look at the comments to see the results.

If done probably would be preferred to find another way to state the table name by property (or symbol) unfortunately using typescript .toString() must explicitly be called