Skip to content

feat(querymate): add join_type parameter for relationship queries - #88

Merged
rafaelrds merged 3 commits into
mainfrom
feat/join-type-parameter
Jan 14, 2026
Merged

feat(querymate): add join_type parameter for relationship queries#88
rafaelrds merged 3 commits into
mainfrom
feat/join-type-parameter

Conversation

@rafaelrds

@rafaelrds rafaelrds commented Jan 13, 2026

Copy link
Copy Markdown

Adiciona parametro join_type para queries com relacionamentos.

Por padrao usa INNER JOIN (comportamento atual). Com join_type='left' ou 'outer', usa LEFT OUTER JOIN para incluir registros pai mesmo quando nao existem filhos relacionados.

Retrocompatibilidade garantida: queries antigas sem join_type continuam usando INNER JOIN (default).

Exemplo:

querymate = Querymate(
    select=['id', 'name', {'posts': ['title']}],
    join_type='left'  # inclui users sem posts
)

Testes adicionados para cobrir ambos os cenarios.

- Add join_type param to apply_select() and build() methods
- Support 'inner' (default), 'left', and 'outer' join types
- Left/outer joins include parent records with empty relationship lists
- Export JoinType type alias from main module
- Add comprehensive tests for all join type scenarios
@rafaelrds
rafaelrds marked this pull request as ready for review January 13, 2026 20:46
@codecov-commenter

codecov-commenter commented Jan 13, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 92.10526% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
querymate/core/query_builder.py 90.90% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

@rafaelrds
rafaelrds requested review from a team, banduk and hugohvf January 14, 2026 12:56

@hugohvf hugohvf left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Algumas duvidas pontuais.

Vale adicionar exemplos na docs dele tbm pra referencia futura de como usar: https://github.com/talismanai/querymate/blob/5ac8d7382bb309f395bd9469b99047128113a932/docs/source/usage

Comment thread querymate/core/query_builder.py
Comment thread querymate/core/config.py
Comment thread querymate/core/query_builder.py
@boschi

boschi commented Jan 14, 2026

Copy link
Copy Markdown

Poderia adicionar um test case com valor inválido de "join-type"?

Comment thread querymate/core/query_builder.py
@rafaelrds
rafaelrds merged commit 8c64ecd into main Jan 14, 2026
4 checks passed
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.

5 participants