Bookshelf.Model.extend deprecation
See original GitHub issueBookshelf.Model.extend deprecation
Introduction
What are our alternatives to Bookshelf.Model.extend?
Issue Description
I used to define my models this way:
const Lembrete = Bookshelf.Model.extend({
tableName: "lembrete",
idAttribute: "idlembrete"
});
However i noticed that approach got deprecated. The docs have no news regarding how should i define my models now.
This is the best i got for now:
class StatusDoacao extends Bookshelf.Model {
get idAttribute() { return "idstatusdoacao"; }
get tableName() { return "statusdoacao"; }
}
Any guidance on how to make it cleaner using es6 is very welcome.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
API Reference - Bookshelf.js
Model. Models are simple objects representing individual database rows, specifying the tableName and any relations to other models. They can be extended with ......
Read more >api documentation for bookshelf (v0.10.3)
Model = _model2.default.extend({ _builder: builderFn, // The `Model` constructor is referenced as a property on the `Bookshelf` // instance, mixing in the ...
Read more >Node + Express + Bookshelf - Stack Overflow
I just include the files with the model in the controller, there is this node lib that basically let you include an entire...
Read more >bookshelf-secure-password - NPM Package Overview - Socket
A Bookshelf.js plugin for handling secure passwords. ... Deprecated, Install scripts ... Model.extend({ tableName: 'users', hasSecurePassword: true }).
Read more >bookshelf-0.10.3 - Yarn
Bookshelf is a JavaScript ORM for Node.js, built on the Knex SQL query builder. Featuring both promise based and traditional callback interfaces, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@ricardogama the editor gave me this hint. but now i am not sure if it’s real.
Same issue. Found the reason in my case.
Guess I’ll remove that type hint. Bookshelf does a pretty good job on its own.