Skip to content

Deterministic code generation for platform#92

Open
and-bezzir wants to merge 1 commit into
masterfrom
ENG-00000-fix-generated-files
Open

Deterministic code generation for platform#92
and-bezzir wants to merge 1 commit into
masterfrom
ENG-00000-fix-generated-files

Conversation

@and-bezzir

Copy link
Copy Markdown
Collaborator

Makes Datly code generation deterministic so regenerating platform assets no longer produces spurious diffs.

  • column discovery: keep the discovery SQL valid when stripping predicate-builder templates (Build("WHERE") -> WHERE 1=1, other builders dropped) and trim the wrapping ( ... ) of derived-table views before falsifying, so templated / aggregate views resolve their real column types from the DB instead of failing discovery and falling back to string/not-null. Applied in both the shape detector and discoverysql.PrepareDiscoverySQL (internal engine path).
  • gofmt generated Go (GenerateOutputCode + asset upload) so the EmbedFS method layout is stable across regenerations.
  • sort route entries by SourceURL in createPathFiles so paths.yaml is written in a deterministic order.

Made with Cursor

- column discovery: keep the discovery SQL valid when stripping predicate-builder
  templates (Build("WHERE") -> WHERE 1=1, other builders dropped) and trim the
  wrapping ( ... ) of derived-table views before falsifying, so templated /
  aggregate views resolve their real column types from the DB instead of failing
  discovery and falling back to string/not-null. Applied in both the shape
  detector and discoverysql.PrepareDiscoverySQL (internal engine path).
- gofmt generated Go (GenerateOutputCode + asset upload) so the EmbedFS method
  layout is stable across regenerations.
- sort route entries by SourceURL in createPathFiles so paths.yaml is written in
  a deterministic order.

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

1 participant