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

feat: SQLA factory #369

Merged
merged 6 commits into from
Sep 18, 2023

Conversation

adhtruong
Copy link
Collaborator

@adhtruong adhtruong commented Sep 17, 2023

Pull Request Checklist

  • New code has 100% test coverage
  • (If applicable) The prose documentation has been updated to reflect the changes introduced by this PR
  • (If applicable) The reference documentation has been updated to reflect the changes introduced by this PR
  • Pre-Commit Checks were ran and passed
  • Tests were ran and passed

Description

  • Add SQLA persistence implementations
  • Harmonise class attributes

Close Issue(s)

@adhtruong adhtruong requested review from a team as code owners September 17, 2023 13:45
@adhtruong adhtruong changed the base branch from main to sqlalchemy-factory September 17, 2023 13:46
@guacs
Copy link
Member

guacs commented Sep 17, 2023

Few points:

  • could you target this against main?
  • could you add documentation for the factory and its usage?
  • could you run pre-commit run --all-files on this?

@adhtruong
Copy link
Collaborator Author

Yep, can do.

Note I did not have permissions to push to the existing branch so made a new branch.

Goldziher and others added 4 commits September 17, 2023 17:56
* feat: Add SQLAlchemyFactory table column parsing

* docs: Add SQLAlchemy reference

* docs: amend link

* doc: amend link

* Revert type updates

* feat: add SQLAlchemy relationship configuration

* feat: improve mapping for SQLAlchemy ARRAY

* feat: SQLAlchemy test hints for 3.8

* feat: SQLAlchemy test hints for 3.8

* feat: SQLAlchemy test hints for 3.8

* feat: SQLAlchemy factory hints for 3.8

* feat: add extra attributes for SQLAlchemyFactory

* feat: resolve SQLAlchemyFactory type issues

* feat: fix rebase errors
@adhtruong adhtruong force-pushed the sqlalchemy-factory-add-persistence branch from 0d89d72 to ad5a267 Compare September 17, 2023 16:56
@adhtruong adhtruong changed the title feat: SQLA factory add persistence feat: SQLA factory Sep 17, 2023
@adhtruong adhtruong changed the base branch from sqlalchemy-factory to main September 17, 2023 16:57
@adhtruong
Copy link
Collaborator Author

Changes include

  • Changing base branch and syncing
  • Adding docs. I added a new page as felt specific factory configuration vs existing pages that were more generally applicable.

Screenshot 2023-09-17 175854

@adhtruong adhtruong force-pushed the sqlalchemy-factory-add-persistence branch from 83638a1 to a91c564 Compare September 17, 2023 17:11
@adhtruong adhtruong force-pushed the sqlalchemy-factory-add-persistence branch from a91c564 to fb38107 Compare September 17, 2023 17:22
@guacs
Copy link
Member

guacs commented Sep 18, 2023

@adhtruong does this work for SQLA v1? If so, can you add tests specifically for v1 and add pytest markers skipping the v2 tests if in v1 and skipping v1 tests if in v2?

@guacs
Copy link
Member

guacs commented Sep 18, 2023

@adhtruong does this work for SQLA v1? If so, can you add tests specifically for v1 and add pytest markers skipping the v2 tests if in v1 and skipping v1 tests if in v2?

Nevermind. I just saw that you've kept sqlalchemy constrained to v2. You can ignore what I said before.

@adhtruong
Copy link
Collaborator Author

@adhtruong does this work for SQLA v1? If so, can you add tests specifically for v1 and add pytest markers skipping the v2 tests if in v1 and skipping v1 tests if in v2?

This feels reasonable to support. I tried locally and implementation on factory currently works with SQLA1.4. I'll update the bounds and CI to test this.

@adhtruong
Copy link
Collaborator Author

@adhtruong does this work for SQLA v1? If so, can you add tests specifically for v1 and add pytest markers skipping the v2 tests if in v1 and skipping v1 tests if in v2?

This feels reasonable to support. I tried locally and implementation on factory currently works with SQLA1.4. I'll update the bounds and CI to test this.

This is a bit more involved due to some typing issues. Happy for this to be left to a separate issue/PR?

@guacs
Copy link
Member

guacs commented Sep 18, 2023

Great work @adhtruong!

@guacs
Copy link
Member

guacs commented Sep 18, 2023

@adhtruong does this work for SQLA v1? If so, can you add tests specifically for v1 and add pytest markers skipping the v2 tests if in v1 and skipping v1 tests if in v2?

This feels reasonable to support. I tried locally and implementation on factory currently works with SQLA1.4. I'll update the bounds and CI to test this.

This is a bit more involved due to some typing issues. Happy for this to be left to a separate issue/PR?

Yupp that's fine.

@guacs guacs merged commit c76ffc9 into litestar-org:main Sep 18, 2023
15 checks passed
@guacs
Copy link
Member

guacs commented Sep 18, 2023

@all-contributors add @adhtruong for docs, test, code

@allcontributors
Copy link
Contributor

@guacs

I've put up a pull request to add @adhtruong! 🎉

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.

Enhancement: Add SQLModelFactory
3 participants