extract table names from db.query

Hi all, I want to extract the name of a table like this this.db.query however if I were to do this
type model = typeof this.db.query
type model = typeof this.db.query
it gives me a readonly version of what I really want, and because my goal is to do something like this
async findById(id: Id) {
return await this.db.query[<dynamic key>].findFirst({});
}
async findById(id: Id) {
return await this.db.query[<dynamic key>].findFirst({});
}
however this is unsuccessful because the when I try to use the type Model from above it gets angry because this.db.query[model].findFirst gives me the readonly value, but I want a non readonly value so I can use it properly. Any help is appreciated
1 Reply
Angelelz
Angelelz16mo ago
That type looks good to me. Can you share what is the error that shows?
Want results from more Discord servers?
Add your server