wwwouter / typed-knex

A TypeScript wrapper for Knex.js
MIT License
112 stars 13 forks source link

Extending Tables #66

Open freddieerg opened 1 year ago

freddieerg commented 1 year ago

Issue type:

[-] Question [ ] Bug report [ ] Feature request [ ] Documentation issue

Database system/driver:

[x] Postgres [ ] MSSQL [ ] MySQL [ ] MariaDB [ ] SQLite3 [ ] Oracle [ ] Amazon Redshift

typed-knex version:

[x] latest [ ] @next [ ] 0.x.x (or put your version here)

Is there a way to extend a class so that multiple tables can inherit columns from an abstract class?

wwwouter commented 1 year ago

Hi, typed-knex is using decorators and those aren't inherited.

I am looking at different ways of creating table classes, mainly to support types created by TypeBox (https://www.npmjs.com/package/@sinclair/typebox). But that is still very preliminary.