Skip to content

fix(pg-template): omit PkColumn(pk int64) method in *SelectSQL#53

Merged
mackee merged 1 commit intomasterfrom
fix/omit-pkcolumn-method-in-pg
Mar 28, 2025
Merged

fix(pg-template): omit PkColumn(pk int64) method in *SelectSQL#53
mackee merged 1 commit intomasterfrom
fix/omit-pkcolumn-method-in-pg

Conversation

@mackee
Copy link
Copy Markdown
Owner

@mackee mackee commented Mar 28, 2025

This pull request includes changes to the SQL query generation for PostgreSQL and MySQL within the _example directory. The main focus is on removing unnecessary methods and refining template conditions.

Refinement of SQL query generation:

  • The PkColumn method was removed because PostgreSQL's implementation does not use LastInsertId to retrieve the inserted row unlike MySQL. Since LastInsertId returns an int64, the PkColumn method was needed for MySQL; however, PostgreSQL uses RETURNING and therefore does not require the PkColumn method.
  • _example/postgresql/accounts.gen.go: Removed the PkColumn method from the accountSelectSQL struct.
  • _example/postgresql/groups.gen.go: Removed the PkColumn method from the groupSelectSQL struct.
  • _example/postgresql/identities.gen.go: Removed the PkColumn method from the identitySelectSQL struct.

Template condition improvements:

@mackee mackee merged commit cceec55 into master Mar 28, 2025
1 check passed
@mackee mackee deleted the fix/omit-pkcolumn-method-in-pg branch March 28, 2025 09:43
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