fix(bun): support extra generated model fields #5

Merged
warkanum merged 2 commits from fix/bun-extra-fields-issue-4 into master 2026-07-09 04:53:34 +00:00
Member

Summary

  • Add Bun generator support for configured extra struct fields via metadata / CLI --extra-fields
  • Support optional target_table scoping by table name, qualified table, or model name
  • Render custom fields with Bun/JSON tags for computed scan-only columns
  • Document usage and add unit coverage for single-file and multi-file output

Test Plan

  • go test ./...
  • Built relspec and smoke-tested DBML -> Bun generation with --extra-fields

Closes #4

## Summary - Add Bun generator support for configured extra struct fields via metadata / CLI --extra-fields - Support optional target_table scoping by table name, qualified table, or model name - Render custom fields with Bun/JSON tags for computed scan-only columns - Document usage and add unit coverage for single-file and multi-file output ## Test Plan - go test ./... - Built relspec and smoke-tested DBML -> Bun generation with --extra-fields Closes #4
sgcommand added 1 commit 2026-07-09 04:28:34 +00:00
Owner

The extra fields flag must not be a string. Its hard to pass. It must be a path to a file and we need to read that file for the flags

The extra fields flag must not be a string. Its hard to pass. It must be a path to a file and we need to read that file for the flags
sgcommand added 1 commit 2026-07-09 04:39:36 +00:00
Author
Member

Addressed review feedback: --extra-fields now expects a path to a JSON file instead of inline JSON. The CLI reads and validates the file, then passes the JSON content into the Bun writer metadata. Updated README examples/docs accordingly.\n\nVerification:\n- go test ./... passes\n- git diff --check passes\n- Built CLI and smoke-tested DBML -> Bun with --extra-fields /tmp/relspec-extra-fields.json, confirming the generated model contains the computed ThoughtCount scan-only field.

Addressed review feedback: `--extra-fields` now expects a path to a JSON file instead of inline JSON. The CLI reads and validates the file, then passes the JSON content into the Bun writer metadata. Updated README examples/docs accordingly.\n\nVerification:\n- `go test ./...` passes\n- `git diff --check` passes\n- Built CLI and smoke-tested DBML -> Bun with `--extra-fields /tmp/relspec-extra-fields.json`, confirming the generated model contains the computed `ThoughtCount` scan-only field.
Author
Member

Addressed review feedback: --extra-fields now expects a path to a JSON file instead of inline JSON.

Details:

  • CLI reads and validates the JSON file from --extra-fields <path>
  • The parsed file content is passed into Bun writer metadata as extra_fields
  • README examples/docs now show --extra-fields extra-fields.json

Verification:

  • go test ./... passes
  • git diff --check passes
  • Built CLI and smoke-tested DBML -> Bun with --extra-fields /tmp/relspec-extra-fields.json
  • Confirmed generated model contains the computed ThoughtCount scan-only field
Addressed review feedback: `--extra-fields` now expects a path to a JSON file instead of inline JSON. Details: - CLI reads and validates the JSON file from `--extra-fields <path>` - The parsed file content is passed into Bun writer metadata as `extra_fields` - README examples/docs now show `--extra-fields extra-fields.json` Verification: - `go test ./...` passes - `git diff --check` passes - Built CLI and smoke-tested DBML -> Bun with `--extra-fields /tmp/relspec-extra-fields.json` - Confirmed generated model contains the computed `ThoughtCount` scan-only field
warkanum approved these changes 2026-07-09 04:53:03 +00:00
warkanum left a comment
Owner

Ok. Looks good now.

Ok. Looks good now.
warkanum merged commit 5edb004799 into master 2026-07-09 04:53:34 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: wdevs/relspecgo#5