Get Schema From db instance
Hey! There's a way to get a table instance just from the
Currently I have this:
await db.insert(users)...
And I want to provide a general function that performs an insert in a database:
However, I'd like to make the table dyamic (it's a plugin) so we can't depend on the
The table needs to follow a given schema (specified in our docs), so I wonder if it's possible to get the schema similar to this (just pseudo-code
):
Thanks in advance for your help!
db object?Currently I have this:
await db.insert(users)...
And I want to provide a general function that performs an insert in a database:
However, I'd like to make the table dyamic (it's a plugin) so we can't depend on the
users object to be available and I'd like to avoid asking users to provide it as a parameter. There's a way to make it work?The table needs to follow a given schema (specified in our docs), so I wonder if it's possible to get the schema similar to this (just pseudo-code
Thanks in advance for your help!