Skip to content

feat(dto): make database-resolved defaults optional in GraphQL inputs - #193

Merged
gazorby merged 1 commit into
mainfrom
fix/sql-expresion-defaults-optional
Jun 10, 2026
Merged

feat(dto): make database-resolved defaults optional in GraphQL inputs#193
gazorby merged 1 commit into
mainfrom
fix/sql-expresion-defaults-optional

Conversation

@gazorby

@gazorby gazorby commented Jun 10, 2026

Copy link
Copy Markdown
Owner

test: add model and mutation for SQL expression defaults

Description

Types of Changes

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

Issues Fixed or Closed by This PR

Checklist

  • 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).

test: add model and mutation for SQL expression defaults
@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@gazorby, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 15 minutes and 43 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 46f10387-b05b-4729-9c95-6d87f2fe7c73

📥 Commits

Reviewing files that changed from the base of the PR and between 6b936da and 7489b23.

⛔ Files ignored due to path filters (1)
  • tests/unit/mapping/__snapshots__/test_schemas/test_mutation_schemas[sql_expression_default].gql is excluded by !**/__snapshots__/**
📒 Files selected for processing (7)
  • mise.toml
  • src/strawchemy/dto/backend/strawberry.py
  • src/strawchemy/dto/inspectors/sqlalchemy.py
  • src/strawchemy/schema/factories/base.py
  • tests/unit/mapping/test_schemas.py
  • tests/unit/models.py
  • tests/unit/schemas/mutations/sql_expression_default.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/sql-expresion-defaults-optional

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov

codecov Bot commented Jun 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.87097% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.06%. Comparing base (6fd5039) to head (7489b23).
⚠️ Report is 9 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/strawchemy/dto/inspectors/sqlalchemy.py 79.16% 2 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #193      +/-   ##
==========================================
+ Coverage   92.18%   93.06%   +0.87%     
==========================================
  Files          70       69       -1     
  Lines        6170     6215      +45     
  Branches      816      821       +5     
==========================================
+ Hits         5688     5784      +96     
+ Misses        333      288      -45     
+ Partials      149      143       -6     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@gazorby
gazorby merged commit 4c20ba3 into main Jun 10, 2026
124 of 127 checks passed
@netbek

netbek commented Jun 11, 2026

Copy link
Copy Markdown

@gazorby Thanks for turning my band-aid into a proper fix and for cutting a release. I didn't have time last week to post a minimal reproducible example here and ask what the expected behaviour is. The unit test you added

created_at: Mapped[datetime] = mapped_column(default=func.now())
demonstrates exactly what I bumped into.

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.

2 participants