Skip to content

feat: add support for association methods #59

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

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

jsindos
Copy link

@jsindos jsindos commented Oct 30, 2024

This PR adds support for sequelize association methods, as per

For example, when providing the association csv, we will also get the following properties added (from the person <-> passport test data):

    declare getPassport: HasOneGetAssociationMixin<passport>;

    declare setPassport: HasOneSetAssociationMixin<passport, number>;

    declare createPassport: HasOneCreateAssociationMixin<passport>;

Note the following hasn't been added / run:

  • linting
    • I ran npm run lint but get the following output, wondering if I can get some help on how to run automatic eslint fix on my changes using the project configuration
> [email protected] lint
> eslint --fix --ext .ts output/*.ts


Oops! Something went wrong! :(

ESLint: 8.57.0

No files matching the pattern "output/*.ts" were found.
Please check for typing mistakes in the pattern.
  • tests

    • I can run the tests and they all pass, but wasn't sure where to add testing for the new functionality. I looked into it('1:1', async () => { but it seems these tests are on the Sequelize models themselves, rather than the generated types.
  • import statements

    • The import statements for the new Mixins are always added, should these instead be added conditionally or will linting clean this up automatically?

@jsindos
Copy link
Author

jsindos commented Oct 30, 2024

It seems it also breaks when supplying -C arg

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

Successfully merging this pull request may close these issues.

1 participant