Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fork new sequelize-ts to support Sequelize v6 #876

Closed
hsluoyz opened this issue Jan 10, 2021 · 4 comments
Closed

Fork new sequelize-ts to support Sequelize v6 #876

hsluoyz opened this issue Jan 10, 2021 · 4 comments

Comments

@hsluoyz
Copy link

hsluoyz commented Jan 10, 2021

New fork: https://github.com/node-casbin/sequelize-ts

We have an urgent need to support Sequelize v6. We have to fork it because the current PRs are not handled very quickly. Currently we are testing this PR: #868 (comment) but encountered some issue.

I also saw the current PR doesn't use CI to run all tests. Maybe need to add a Travis CI or GitHub Actions to the repo.

Hope somebody also interested in it can join us, thanks!

@theoludwig
Copy link
Contributor

@hsluoyz Instead to create a fork, we should continue to work on this repo, [email protected] has been released, so it supports sequelize >= 6.0.0. 😄

@hsluoyz
Copy link
Author

hsluoyz commented Jan 18, 2021

@divlo hi, did v2.0.0 release resolve this issue? #868

I asked this because we encountered a similar issue here: node-casbin/sequelize-adapter#34

I also tried by myself but still has error even for sequelize 6.2.0:

    "sequelize": "^6.2.0",
    "sequelize-typescript": "^2.0.0"
$ jest --forceExit
 FAIL  test/adapter.test.ts
  ● Test suite failed to run

    src/adapter.ts:46:31 - error TS2769: No overload matches this call.
      The last overload gave the following error.
        Type 'typeof CasbinRule' is not assignable to type 'string | ModelCtor<Model<any, any>>'.
          Type 'typeof CasbinRule' is not assignable to type 'ModelCtor<Model<any, any>>'.
            Type 'typeof CasbinRule' is not assignable to type 'typeof Model'.
              Types of parameters 'values' and 'values' are incompatible.
                Type 'TCreationAttributes | undefined' is not assignable to type 'CasbinRule | undefined'.
                  Type 'TCreationAttributes' is not assignable to type 'CasbinRule | undefined'.
                    Type '{}' is not assignable to type 'CasbinRule'.
                      Type 'TCreationAttributes' is not assignable to type 'CasbinRule'.
                        Type '{}' is missing the following properties from type 'CasbinRule': ptype, v0, v1, v2, and 39 more.

    46     this.sequelize.addModels([CasbinRule]);
                                     ~~~~~~~~~~

      node_modules/sequelize-typescript/dist/sequelize/sequelize/sequelize.d.ts:16:5
        16     addModels(arg: Array<ModelCtor | string>): any;
               ~~~~~~~~~
        The last overload is declared here.

Can you help me have a look? Thanks!

@theoludwig
Copy link
Contributor

@hsluoyz Hey, I don't know if it has been fixed, but please open issues/PR so we can improve sequelize-typescript together.
Also you could provider "steps to reproduce so we can fix it easier".

@hsluoyz
Copy link
Author

hsluoyz commented Jan 18, 2021

@divlo here's the PR: #868

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants