Code Monkey home page Code Monkey logo

sequelize-fastify's People

Contributors

calteran avatar hsynlms avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

sequelize-fastify's Issues

Incorrect sequelizeOptions structure

According to the Sequelize v6 API Documentation, the host and port keys should be top level, but the documentation for this library shows them nested in a deeper options instance.

For example:

Current state

await fastify.register(
  sequelizeFastify,
  {
    instance: 'db',
    sequelizeOptions: {
      dialect: 'DIALECT_NAME',
      database: 'DATABASE_NAME',
      username: 'DATABASE_USER_NAME',
      password: 'DATABASE_USER_PASSWORD',
      options: { // This nesting level appears incorrect
        host: 'DATABASE_HOST_OR_SERVER',
        port: 'DATABASE_PORT'
      }
    }
  }
)

Correct state

await fastify.register(
  sequelizeFastify,
  {
    instance: 'db',
    sequelizeOptions: {
      dialect: 'DIALECT_NAME',
      database: 'DATABASE_NAME',
      username: 'DATABASE_USER_NAME',
      password: 'DATABASE_USER_PASSWORD',
      host: 'DATABASE_HOST_OR_SERVER',  // nested at same level as other options
      port: 'DATABASE_PORT'  // nested at same level as other options
    }
  }
)

Docs regarding creating models

I decided to go ahead with this plugin, only to find out that there's no documentation telling how and where to define models.
There is a define method available on the instance, but however that doesn't help as there's no elaborate constructor or method to define models. Please help.

Please support fastify `^4.0.0`

FastifyError [Error]: fastify-plugin: sequelize-fastify - expected '3.x' fastify version, '4.0.0' is installed
    at Object.checkVersion (/project/node_modules/fastify/lib/pluginUtils.js:108:11)
    at Object.registerPlugin (/project/node_modules/fastify/lib/pluginUtils.js:123:16)
    at Boot.override (/project/node_modules/fastify/lib/pluginOverride.js:28:57)
    at Plugin.exec (/project/node_modules/avvio/plugin.js:80:33)
    at Boot.loadPlugin (/project/node_modules/avvio/plugin.js:273:10)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  code: 'FST_ERR_PLUGIN_VERSION_MISMATCH',
  statusCode: 500
}

Typescript support

Some TypeScript declarations would help with development in TS. If anyone wants I can implement this myself.

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.