Skip to content

fix: example is broken, this fixes it#14

Merged
kalbasit merged 2 commits intomainfrom
fix-example-is-broken-this-fixes
Mar 23, 2026
Merged

fix: example is broken, this fixes it#14
kalbasit merged 2 commits intomainfrom
fix-example-is-broken-this-fixes

Conversation

@kalbasit
Copy link
Copy Markdown
Owner

No description provided.

@kalbasit
Copy link
Copy Markdown
Owner Author

kalbasit commented Mar 23, 2026

This change is part of the following stack:

Change managed by git-spice.

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves issues in the example application by updating core dependencies and significantly refining the database code generation process. The changes standardize how bulk inserts are handled across different SQL drivers and align the generated code with the latest sqlc version, ensuring the example functions correctly and robustly within the sqlc-multi-db framework. Additionally, the development environment is made more consistent through Nix updates.

Highlights

  • Go Module Updates: The Go version in the example module has been updated to 1.25.7, and the github.com/lib/pq dependency was introduced to support PostgreSQL operations.
  • Code Generation Refactoring: The //go:generate directive was moved from example/pkg/database/generate.go (which was removed) to example/pkg/database/database.go, streamlining the code generation setup.
  • Database Parameter Standardization: The AddBookTagsParams structure in the generated models and wrappers was adjusted to use generic Column1 and Column2 fields, enhancing compatibility across different database drivers (MySQL, PostgreSQL, SQLite).
  • Generated Code Alignment: All generated SQL query files for MySQL, PostgreSQL, and SQLite were updated to reflect sqlc v1.30.0, including more explicit query formatting, improved error handling, and the addition of BookTag structs.
  • Bulk Insert Logic Enhancement: The generator/templates.go logic for bulk insert parameter mapping was improved to support both name-based and positional field matching, making the generation process more robust.
  • Nix Devshell Integration: The Nix devshell configuration now includes pkgs.sqlc and automatically updates the example/go.mod Go version, ensuring a consistent development environment.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 28.83%. Comparing base (17902e2) to head (5652589).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #14   +/-   ##
=======================================
  Coverage   28.83%   28.83%           
=======================================
  Files           6        6           
  Lines         697      697           
=======================================
  Hits          201      201           
  Misses        485      485           
  Partials       11       11           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

The pull request updates the Go version to 1.25.7 and adds the github.com/lib/pq dependency. It introduces a multi-database sqlc-multi-db generation setup, leading to changes in generated code across mysql, postgres, and sqlite database packages. Key changes include renaming AddBookTagsParams fields to Column1 and Column2 in generated_models.go and corresponding updates in wrapper functions, along with extensive reformatting and duplication of SQL queries as comments in generated querier.go and query.*.sql.go files. Review comments highlight the need to improve the descriptiveness of Column1 and Column2 by using sqlc.arg() in SQL queries, and point out redundant rows.Close() calls in mysqldb and sqlitedb generated code that should be removed.

- Use sqlc.arg() to name unnest parameters in AddBookTags query, generating
  BookIds/TagIds instead of Column1/Column2
- Remove redundant rows.Close() calls in MySQL and SQLite generated files
  for GetBookTags, GetBooksByAuthor, and ListBooks functions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@kalbasit kalbasit merged commit 7fd9eca into main Mar 23, 2026
6 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.

2 participants