Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
b920b56
work
rayakame Feb 11, 2026
bdd8995
feat: complete generator rewrite with enum and pydantic support
rayakame Jul 18, 2026
bbad6be
fix: exclude generated enums.py from ruff formatting
rayakame Jul 18, 2026
8f670a8
feat: make generated code ruff-format-clean, drop format excludes
rayakame Jul 18, 2026
3ff9b49
feat: make omit_kwargs_limit opt-in
rayakame Jul 18, 2026
4c8237e
fix: apply opt-in behavior to query_parameter_limit, revert omit_kwar…
rayakame Jul 18, 2026
2f30367
fix: resolve ten code-review findings in the generator
rayakame Jul 18, 2026
734b4f2
perf: drop runtime generic subscription on QueryResults construction
rayakame Jul 18, 2026
a1470ca
refactor: consolidate sqlite drivers and unify the conversion catalog
rayakame Jul 18, 2026
b2d077d
chore: remove dead code and reduce exhaustruct noise
rayakame Jul 18, 2026
05e4a18
chore: tune coderabbit config
rayakame Jul 18, 2026
e041766
fix: address coderabbit review findings
rayakame Jul 18, 2026
f69c74e
fix: resolve final self-review findings around type overrides
rayakame Jul 18, 2026
d90bb75
fix: place sqlite conversion imports exactly where the emitted setup …
rayakame Jul 18, 2026
d95a9a1
test: cover type-override interactions with imports and sqlite conver…
rayakame Jul 18, 2026
897cb8f
chore: replace typographic unicode with plain ASCII across the repo
rayakame Jul 18, 2026
aa03936
Merge branch 'main' into feature/rewrite
rayakame Jul 18, 2026
9ad5ef5
fix: correct bash array syntax and path separators in build.sh
rayakame Jul 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changes/unreleased/Added-20260718-120000.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Added
body: Support for PostgreSQL enums - enum columns now generate an `enums.py` module with `str`-based enum classes, including schema-qualified naming and runtime value coercion
time: 2026-07-18T12:00:00.0000000Z
custom:
Author: rayakame
PR: "148"
6 changes: 6 additions & 0 deletions .changes/unreleased/Added-20260718-120001.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Added
body: New `model_type` option `pydantic` generating `pydantic.BaseModel` models (requires pydantic >= 2.9)
time: 2026-07-18T12:00:01.0000000Z
custom:
Author: rayakame
PR: "148"
6 changes: 6 additions & 0 deletions .changes/unreleased/Added-20260718-120002.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Added
body: '`query_parameter_limit` is now implemented and opt-in: when set to a non-negative value, queries with more parameters than the limit take a single `params: <Query>Params` argument; unset or negative values keep parameters expanded'
time: 2026-07-18T12:00:02.0000000Z
custom:
Author: rayakame
PR: "148"
6 changes: 6 additions & 0 deletions .changes/unreleased/Breaking-20260718-120003.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Breaking
body: Model and row class fields now escape reserved names like function parameters already did - a column named `id` generates the field `id_`
time: 2026-07-18T12:00:03.0000000Z
custom:
Author: rayakame
PR: "148"
6 changes: 6 additions & 0 deletions .changes/unreleased/Changed-20260718-120004.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Changed
body: Complete rewrite of the code generator internals into a config/transform/render/driver pipeline
time: 2026-07-18T12:00:04.0000000Z
custom:
Author: rayakame
PR: "148"
6 changes: 6 additions & 0 deletions .changes/unreleased/Fixed-20260718-120006.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixed
body: '`:many` query functions no longer subscript the generic at runtime (`QueryResults(...)` instead of `QueryResults[T](...)`). The subscripted call went through `typing`''s `_GenericAlias.__call__` and raised-and-swallowed an `AttributeError` on every invocation (the class uses `__slots__`, so `__orig_class__` was never actually stored), costing roughly 10x the plain constructor call while providing no runtime or type-checking benefit - the function''s return annotation already carries the full `QueryResults[T]` type'
time: 2026-07-18T12:00:06.0000000Z
custom:
Author: rayakame
PR: "148"
6 changes: 6 additions & 0 deletions .changes/unreleased/Fixed-20260719-090000.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Fixed
body: 'sqlite modules now register only the conversion halves they need: parameters register an adapter, non-overridden return columns register a converter. Previously every used conversion type registered both, so a module could install a global `register_converter` as a side effect - changing what overridden return columns receive under `PARSE_DECLTYPES`. Import resolution follows the same split: `ciso8601` is imported exactly when an emitted converter body references it, `datetime`/`decimal` stay in the `TYPE_CHECKING` block when the emitted setup does not reference them at runtime, and `from <package> import enums` is now also emitted when an overridden enum parameter is converted back via `enums.X(...)` at runtime'
time: 2026-07-19T09:00:00.0000000Z
custom:
Author: rayakame
PR: "148"
263 changes: 263 additions & 0 deletions .coderabbit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,263 @@
language: en-US
tone_instructions: ''
early_access: false
enable_free_tier: true
inheritance: false
reviews:
profile: chill
request_changes_workflow: false
high_level_summary: true
high_level_summary_instructions: ''
high_level_summary_placeholder: '`@coderabbitai` summary'
high_level_summary_in_walkthrough: false
auto_title_placeholder: '`@coderabbitai`'
auto_title_instructions: ''
review_status: true
review_details: false
review_progress: true
commit_status: true
fail_commit_status: false
collapse_walkthrough: true
changed_files_summary: true
sequence_diagrams: true
estimate_code_review_effort: true
assess_linked_issues: true
related_issues: true
related_prs: true
suggested_labels: true
labeling_instructions: []
mutually_exclusive_groups: {}
auto_apply_labels: false
suggested_reviewers: true
auto_assign_reviewers: false
suggested_reviewers_instructions: []
in_progress_fortune: true
poem: false
enable_prompt_for_ai_agents: true
path_filters:
- "!test/driver_*/*/classes/**"
- "!test/driver_*/*/functions/**"
- "!**/*.wasm"
path_instructions: []
abort_on_close: true
disable_cache: false
slop_detection:
enabled: true
auto_review:
enabled: true
description_keyword: ''
auto_incremental_review: true
auto_pause_after_reviewed_commits: 5
ignore_title_keywords: []
labels: []
drafts: false
base_branches: []
ignore_usernames: []
finishing_touches:
docstrings:
enabled: true
unit_tests:
enabled: false
simplify:
enabled: false
autofix:
enabled: true
fix_ci:
enabled: true
resolve_merge_conflict:
enabled: true
custom: []
pre_merge_checks:
override_requested_reviewers_only: false
docstrings:
mode: warning
threshold: 80
title:
mode: warning
requirements: ''
description:
mode: warning
issue_assessment:
mode: warning
custom_checks: []
post_merge_actions: []
tools:
ast-grep:
rule_dirs: []
util_dirs: []
essential_rules: true
packages: []
shellcheck:
enabled: true
ruff:
enabled: true
markdownlint:
enabled: true
github-checks:
enabled: true
timeout_ms: 90000
languagetool:
enabled: true
enabled_rules: []
disabled_rules: []
enabled_categories: []
disabled_categories: []
enabled_only: false
level: default
biome:
enabled: true
hadolint:
enabled: true
swiftlint:
enabled: true
phpstan:
enabled: true
level: default
phpmd:
enabled: true
phpcs:
enabled: true
golangci-lint:
enabled: true
yamllint:
enabled: true
gitleaks:
enabled: true
trufflehog:
enabled: true
checkov:
enabled: true
tflint:
enabled: true
detekt:
enabled: true
eslint:
enabled: true
e18e:
enabled: true
flake8:
enabled: false
fbinfer:
enabled: true
enable_java: false
fortitudeLint:
enabled: true
rubocop:
enabled: true
buf:
enabled: true
regal:
enabled: true
actionlint:
enabled: true
zizmor:
enabled: true
pmd:
enabled: true
clang:
enabled: true
cppcheck:
enabled: true
opengrep:
enabled: true
semgrep:
enabled: true
circleci:
enabled: true
clippy:
enabled: true
sqlfluff:
enabled: false
squawk:
enabled: true
trivy:
enabled: true
prismaLint:
enabled: true
pylint:
enabled: false
oxc:
enabled: true
shopifyThemeCheck:
enabled: true
luacheck:
enabled: true
brakeman:
enabled: true
dotenvLint:
enabled: true
htmlhint:
enabled: true
stylelint:
enabled: true
checkmake:
enabled: true
osvScanner:
enabled: true
oasdiff:
enabled: true
reactDoctor:
enabled: true
presidio:
enabled: true
blinter:
enabled: true
smartyLint:
enabled: true
emberTemplateLint:
enabled: true
skillspector:
enabled: true
psscriptanalyzer:
enabled: true
chat:
art: true
allow_non_org_members: true
auto_reply: true
integrations:
jira:
usage: auto
linear:
usage: auto
knowledge_base:
opt_out: false
web_search:
enabled: true
code_guidelines:
enabled: true
filePatterns: []
learnings:
scope: auto
approval_delay: 0
issues:
scope: auto
jira:
usage: auto
project_keys: []
linear:
usage: auto
team_keys: []
pull_requests:
scope: auto
mcp:
usage: auto
disabled_servers: []
automatic_repository_linking: false
linked_repositories: []
code_generation:
docstrings:
language: en-US
path_instructions: []
unit_tests:
path_instructions: []
issue_enrichment:
auto_enrich:
enabled: false
planning:
enabled: true
auto_planning:
enabled: true
labels: []
labeling:
labeling_instructions: []
auto_apply_labels: false
Binary file removed .coverage
Binary file not shown.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: testdb
ports:
- 5432/tcp # hostport is picked automatically
- 5432/tcp # host-port is picked automatically
options: >-
--health-cmd="pg_isready -U postgres -d testdb"
--health-interval=10s
Expand All @@ -52,7 +52,7 @@ jobs:

- name: Run tests via nox
env:
# GitHub tells you which hostport was assigned via the `job.services` context
# GitHub tells you which host-port was assigned via the `job.services` context
POSTGRES_URI: postgres://postgres:postgres@localhost:${{ job.services.postgres.ports['5432'] }}/testdb
run: |
uv run nox -s pytest -- --coverage
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/fragments-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ jobs:

for file in $changelog_fragments; do
if grep -qE "PR: *\"?$pr_number\"?" "$file"; then
echo " Found PR number $pr_number in $file"
echo "OK: Found PR number $pr_number in $file"
found_match=true
fi
done

if [ "$found_match" = false ]; then
echo " No matching PR number found in changelog fragments."
echo "ERROR: No matching PR number found in changelog fragments."
exit 1
fi

Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/prepare_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,16 @@ jobs:
args: latest

- name: Set version
env:
NEW_VERSION: ${{ steps.latest.outputs.output }}
run: |
sed -i 's/^const PluginVersion = ".*"/const PluginVersion = "'"${{ steps.latest.outputs.output }}"'"/' internal/core/config.go

echo "✅ Updated PluginVersion to $new_version"
if ! [[ "$NEW_VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "unexpected version format: $NEW_VERSION" >&2
exit 1
fi
sed -i 's/^const PluginVersion = ".*"/const PluginVersion = "'"$NEW_VERSION"'"/' internal/config/constants.go

echo "OK: Updated PluginVersion to $NEW_VERSION"


- name: Create Pull Request
Expand Down
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,21 @@ go.work.sum
.env

__pycache__/

# Python tooling caches and outputs
.venv/
.nox/
.pytest_cache/
.ruff_cache/
.coverage
coverage.xml
public/

# local test scratch artifacts
sqlite.db
test/log.json
test/log.txt
test/models.py
test/queries.py
test/enums.py
/sqlc-gen-better-python.wasm
Loading
Loading