strawberry-sqlalchemy icon indicating copy to clipboard operation
strawberry-sqlalchemy copied to clipboard

Implement Standalone Convert; Enum Handling; User Edge/Connection Classes; Column Alias Handling

Open gravy-jones-locker opened this issue 1 year ago • 3 comments

Description

This includes a number of changes, including:

  1. mapper.type now calls mapper.convert - this allows mapper.convert to be called within user code, which makes the relevant functionality accessible where a decorator is not appropriate.
  2. strawberry.enum is called against SQLAlchemy Enum columns.
  3. Rather than relying on dynamically generated, model specific classes, the user can now pass Edge and Connection classes to the mapper constructor. This is necessary where those Edge/Connection classes are used elsewhere in user schemas.
  4. Relationship mapping is updated such that user-defined column names are taken into account rather than just model attribute names.

Types of Changes

  • [ ] Core
  • [ ] Bugfix
  • [ ] New feature
  • [ ] Enhancement/optimization
  • [ ] Documentation

Issues Fixed or Closed by This PR

Checklist

  • [x] My code follows the code style of this project.
  • [ ] My change requires a change to the documentation.
  • [ ] I have updated the documentation accordingly.
  • [ ] I have read the CONTRIBUTING document.
  • [ ] I have added tests to cover my changes.
  • [ ] I have tested the changes and verified that they work and don't break anything (as well as I can manage).

gravy-jones-locker avatar Sep 04 '23 11:09 gravy-jones-locker