Comments (3)
Hi @jberall
What do you mean? Can you give an example?
from hapi-sequelizejs.
db.getModel('user').findall()
.then(response => ...)
.catch(err => db error)
It would be nice if their was a way to log the .catch globally.
I had an instance where my model and table didn't match and I spent a ton of time.
Also when users have errors the info they give is not very helpful.
I looked at the logging but I believe that sends all the sql queries.
from hapi-sequelizejs.
This is something that is related specifically to sequelize
lib, and in my opinion, should not have nothing todo with this plugin.
Please see sequelize/sequelize#1707.
Following their example, using this plugin, you can do like this:
// initialize sequelize externally
const sequelize = new Sequelize(config, opts);
sequelize.query = async function () {
// ...
};
// then register the plugin with hapi
server.register([
{
plugin: require('hapi-sequelizejs'),
options: [
{
name: 'dbname', // identifier
sequelize, // sequelize instance
},
],
},
]);
If you need something else, please let me know.
from hapi-sequelizejs.
Related Issues (20)
- Hapi-sequelizejs dependency of @hapi/joi HOT 2
- fix ts compatibility
- Add .npmignore HOT 2
- Improve README/Documentation HOT 4
- ValidationError: "sequelize" must be an instance of "Sequelize" HOT 3
- Registering to onClose server events to shutdown the database connections HOT 1
- require db model outside a handler HOT 5
- Add the ability to decorate different interfaces HOT 6
- Add match parameter in configuration HOT 4
- Can you push a release for hapi 21.x? HOT 2
- Models and Associations - Problem HOT 1
- Question Testing HOT 1
- Hapi 18 HOT 1
- Help needed HOT 4
- Update to hapi 19 HOT 2
- Plan to support sequelize v6? HOT 5
- Support hapi v17 HOT 8
- How do I use the Sequelize.Op & Sequelize.literal? HOT 2
- Consider adding precommit hook with prettier HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hapi-sequelizejs.