Giter Club home page Giter Club logo

Comments (3)

valtlfelipe avatar valtlfelipe commented on August 24, 2024

Hi @jberall

What do you mean? Can you give an example?

from hapi-sequelizejs.

jberall avatar jberall commented on August 24, 2024

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.

valtlfelipe avatar valtlfelipe commented on August 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.