Coder Social home page Coder Social logo

Comments (16)

aldricnbcu avatar aldricnbcu commented on May 20, 2024 2

Haha, never mind, this is actually just a horribly unclear error message because the sequelize-cli code defaults to mysql instead of telling you what actually went wrong, to wit, it couldn't find an option.

from cli.

d11wtq avatar d11wtq commented on May 20, 2024

I'm hitting this too and can't (read, don't want to) install mysql. There used to be an option for --config so you could provide it with the path to the sequelize config, but that seems to be have gone sequelize-cli.

from cli.

sdepold avatar sdepold commented on May 20, 2024

will try to fix that during the next week! PRs are welcome though

from cli.

d11wtq avatar d11wtq commented on May 20, 2024

I fixed it locally by doing this:

var helpers   = require(__dirname)
  , _         = require('lodash')
  , _s        = require('underscore.string')
  , Sequelize = require('sequelize')
  , config    = helpers.config.readConfig()

var sequelize = new Sequelize(
  config.database,
  config.username,
  config.password,
  config
)

However, I don't think that will work with connection URLs?

from cli.

janmeier avatar janmeier commented on May 20, 2024

You should be able to pass a connection URL to the constructor (new Sequelize(uri, options))

from cli.

d11wtq avatar d11wtq commented on May 20, 2024

Yeah, but I don't want to have to figure out which variant came from the config. I happen to be using a .js file that returns a JSON object, but AFAIK other users may be using connection URLs. I'm just reading config-helper.js now to understand it better. That code is at the top of migration-helper.js, where the bug is, BTW.

from cli.

d11wtq avatar d11wtq commented on May 20, 2024

Ah no, that code should actually fix this. The config-helper parses the URL and canonicalizes to JSON. I'll send a PR.

from cli.

d11wtq avatar d11wtq commented on May 20, 2024

I think it does seem like a clumsy way of converting names though, but it's pragmatic for now in any case.

from cli.

d11wtq avatar d11wtq commented on May 20, 2024

Raised #21. Would be nice to get a release out when it's possible. Or is there some way I can use my fork in the interim, without npm install clobbering it?

from cli.

janmeier avatar janmeier commented on May 20, 2024

You can point your package.json at GH:

{
  "sequelize": "sequelize/sequelize#commit-ish"
}

from cli.

sdepold avatar sdepold commented on May 20, 2024

their is a fair chance that this issue is fixed with #22.

from cli.

sdepold avatar sdepold commented on May 20, 2024

i just released v0.2.4. can you give that a try?

from cli.

d11wtq avatar d11wtq commented on May 20, 2024

Tested, works. Thanks heaps! 👯

from cli.

sdepold avatar sdepold commented on May 20, 2024

great!

from cli.

aldricnbcu avatar aldricnbcu commented on May 20, 2024

Don't wanna be a party pooper but this just happened for me.
I'll report back with more info on why this happened for me. Running Sequelize-CLI 2.0.0 ...

from cli.

aldricnbcu avatar aldricnbcu commented on May 20, 2024

I should mention I'm trying to use postgres, and the relevant part of my config.json is

    "development": {
        "host": "localhost",
        "port": 3002,
        "cookieSecret": "cookieSecret",
        "sessionSecret": "sessionSecret",
        "database": {
            "username": "username",
            "password": "",
            "database": "database",
            "host":"localhost",
            "port": "5432",
            "dialect": "postgres"
        },
→ ./node_modules/.bin/sequelize db:migrate

Sequelize [Node: 4.1.1, CLI: 2.0.0, ORM: 3.11.0]

Loaded configuration file "config/config.json".
Using environment "development".
Using gulpfile ~/src/projects/chronos_web/node_modules/sequelize-cli/lib/gulpfile.js
Starting 'db:migrate'...
[Error: The dialect mysql is not supported. (Error: Please install mysql package manually)]
'db:migrate' errored after 26 msError: The dialect mysql is not supported. (Error: Please install mysql package manually)
    at new Sequelize (/Users/a206468627/src/projects/chronos_web/node_modules/sequelize/lib/sequelize.js:203:11)
    at getSequelizeInstance (/Users/a206468627/src/projects/chronos_web/node_modules/sequelize-cli/lib/tasks/db.js:284:12)
    at getMigrator (/Users/a206468627/src/projects/chronos_web/node_modules/sequelize-cli/lib/tasks/db.js:293:21)
    at Object.module.exports.db:migrate.task (/Users/a206468627/src/projects/chronos_web/node_modules/sequelize-cli/lib/tasks/db.js:23:7)
    at Gulp.gulp.task.aliases (/Users/a206468627/src/projects/chronos_web/node_modules/sequelize-cli/lib/helpers/gulp-helper.js:14:14)
    at module.exports (/Users/a206468627/src/projects/chronos_web/node_modules/sequelize-cli/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:34:7)
    at Gulp.Orchestrator._runTask (/Users/a206468627/src/projects/chronos_web/node_modules/sequelize-cli/node_modules/gulp/node_modules/orchestrator/index.js:273:3)
    at Gulp.Orchestrator._runStep (/Users/a206468627/src/projects/chronos_web/node_modules/sequelize-cli/node_modules/gulp/node_modules/orchestrator/index.js:214:10)
    at Gulp.Orchestrator.start (/Users/a206468627/src/projects/chronos_web/node_modules/sequelize-cli/node_modules/gulp/node_modules/orchestrator/index.js:134:8)
    at /Users/a206468627/src/projects/chronos_web/node_modules/sequelize-cli/node_modules/gulp/bin/gulp.js:129:20
    at doNTCallback0 (node.js:407:9)
    at process._tickCallback (node.js:336:13)
    at Function.Module.runMain (module.js:477:11)
    at startup (node.js:117:18)
    at node.js:951:3

from cli.

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.