Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I get table name from model ? #54

Open
adrianowy opened this issue Apr 25, 2019 · 1 comment
Open

How can I get table name from model ? #54

adrianowy opened this issue Apr 25, 2019 · 1 comment

Comments

@adrianowy
Copy link

How can I get table name from model ?

const programName = db.model({ table: 'PROGRAM_NAME' });


console.log( programName.model.table );

???

Database Oracle

@refractalize
Copy link
Member

Hi @adrianowy

There's (currently) no way to get at the table name from the model, but there is from an instance of the model. For e.g.

const programName = db.model({ table: 'PROGRAM_NAME' });
const stuff = programName({name: 'stuff'})
console.log(stuff._meta.table) // PROGRAM_NAME

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants