Conversation
|
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
📝 Walkthrough## Walkthrough
This change introduces a new sqlc bulk-insert code generation plugin, generates specialized bulk insert methods for various database entities, and refactors existing code to use these new methods instead of a generic bulk insert utility. The update includes new plugin source, test, and documentation files, modifies API handlers to use the generated methods, and enhances SQL insert statements with upsert semantics where needed.
## Changes
| File(s) | Change Summary |
|---------|---------------|
| `go/apps/api/routes/v2_identities_create_identity/handler.go`,<br>`go/apps/api/routes/v2_identities_update_identity/handler.go`,<br>`go/apps/api/routes/v2_keys_create_key/handler.go`,<br>`go/apps/api/routes/v2_keys_update_key/handler.go`,<br>`go/internal/services/auditlogs/insert.go` | Refactored to replace generic `db.BulkInsert` calls with specialized bulk insert methods generated by the new plugin (e.g., `InsertIdentityRatelimits`, `InsertKeyRatelimits`, etc.). |
| `go/pkg/db/bulk_insert.go` | Removed the generic bulk insert utility function. |
| `go/pkg/db/queries.go` | Added `BulkQueries` struct and `BulkQuery` variable for bulk operations. |
| `go/pkg/db/querier_bulk_generated.go` | Added generated `BulkQuerier` interface with methods for all bulk insert operations. |
| `go/pkg/db/bulk_*_insert.sql.go`,<br>`go/pkg/db/bulk_*_upsert.sql.go` | Added generated Go files implementing bulk insert/upsert methods for various entities (e.g., keys, identities, permissions, roles, projects, builds, etc.). |
| `go/pkg/db/identity_insert_ratelimit.sql_generated.go`,<br>`go/pkg/db/queries/identity_insert_ratelimit.sql`,<br>`go/pkg/db/querier_generated.go` | Modified SQL to add "ON DUPLICATE KEY UPDATE" (upsert) behavior for ratelimit inserts; updated comments accordingly. |
| `go/pkg/db/doc.go` | Expanded documentation to describe bulk insert features and usage examples. |
| `go/pkg/db/generate.go` | Added go:generate directive to build the bulk-insert plugin. |
| `go/pkg/db/sqlc.json` | Configured sqlc to use the new bulk-insert plugin with DB argument emission; registered the plugin. |
| `go/go.mod` | Added direct dependencies for the plugin and YAML parsing; promoted `gopkg.in/yaml.v2` to direct dependency. |
| `go/pkg/db/plugins/bulk-insert/*` | Added new bulk-insert sqlc plugin implementation, including generator, parser, template, utilities, and comprehensive tests. |
| `go/pkg/db/plugins/bulk-insert/README.md` | Added documentation for the bulk-insert plugin. |
| `go/pkg/db/queries/branch_upsert.sql` | Added trailing newline for formatting consistency. |
## Sequence Diagram(s)
```mermaid
sequenceDiagram
participant Handler
participant BulkQuery
participant DB
Handler->>BulkQuery: Insert<Entity>(ctx, tx, []Params)
BulkQuery->>DB: Executes bulk INSERT ... VALUES (...), (...), ... [ON DUPLICATE KEY UPDATE ...]
DB-->>BulkQuery: Result/Error
BulkQuery-->>Handler: Error (if any)Possibly related PRs
Suggested reviewers
Learnt from: Flo4604 Learnt from: ogzhanolguncu Learnt from: Flo4604 Learnt from: ogzhanolguncu Learnt from: chronark Learnt from: Flo4604 Learnt from: ogzhanolguncu Learnt from: ogzhanolguncu Learnt from: Flo4604 Learnt from: chronark Learnt from: Flo4604 Learnt from: Flo4604 Learnt from: ogzhanolguncu Learnt from: ogzhanolguncu Learnt from: chronark Learnt from: ogzhanolguncu |
|
Thank you for following the naming conventions for pull request titles! 🙏 |
There was a problem hiding this comment.
Actionable comments posted: 5
♻️ Duplicate comments (12)
go/pkg/db/bulk_keyring_insert.sql.go (2)
23-25: Hardcoded values issue remains unresolved.The value clauses still contain hardcoded
0, 0values forsize_approxandsize_last_updated_atfields instead of using parameters from the input struct. This will result in incorrect data being inserted.
29-38: Missing arguments for size_approx and size_last_updated_at.The argument collection only includes 6 fields but the SQL query expects 8 values. The missing
SizeApproxandSizeLastUpdatedAtarguments should be added to match the SQL columns.go/pkg/db/bulk_audit_log_insert.sql.go (1)
29-46: Argument collection properly addresses previous feedback.The code correctly uses
[]anyinstead of[]interface{}as suggested in past reviews, and properly flattens all 14 arguments in the correct order to match the SQL column sequence.go/pkg/db/bulk_audit_log_target_insert.sql.go (1)
29-42: Argument collection addresses previous feedback correctly.The code properly uses
[]anyinstead of[]interface{}as suggested in past reviews, and correctly flattens all 10 arguments in the proper order to match the SQL column sequence.go/pkg/db/bulk_permission_insert.sql.go (1)
40-43: Fix indentation inconsistency as mentioned in previous reviews.The database execution logic is correct, but the indentation inconsistency with spaces instead of tabs should be fixed as previously identified.
- _, err := db.ExecContext(ctx, bulkQuery, allArgs...) - return err + _, err := db.ExecContext(ctx, bulkQuery, allArgs...) + return errgo/pkg/db/bulk_ratelimit_namespace_insert.sql.go (1)
38-41: Fix indentation inconsistency as mentioned in previous reviews.The database execution logic correctly handles the soft-delete pattern, but the indentation inconsistency with spaces instead of tabs should be fixed as previously identified.
- _, err := db.ExecContext(ctx, bulkQuery, allArgs...) - return err + _, err := db.ExecContext(ctx, bulkQuery, allArgs...) + return errgo/pkg/db/bulk_role_permission_insert.sql.go (1)
39-40: Fix the indentation inconsistency.The indentation uses spaces instead of tabs, which is inconsistent with Go formatting standards.
go/pkg/db/bulk_key_role_insert.sql.go (1)
39-40: Fix the indentation inconsistency.The indentation uses spaces instead of tabs, which is inconsistent with Go formatting standards.
go/pkg/db/bulk_ratelimit_override_insert.sql.go (1)
12-12: Simplify the SQL string construction for better readability.The string concatenation with backticks could be simplified while maintaining MySQL compatibility.
go/pkg/db/bulk_identity_insert.sql.go (1)
12-12: Table name concatenation reduces readability.The table name escaping using string concatenation with backticks is unconventional and reduces readability compared to using a raw string literal.
go/pkg/db/plugins/bulk-insert/bulk_insert.go.tmpl (1)
35-38: Parameter count validation concern remains valid.The template appends arguments based on the
.Fieldsslice without validating that its length matches the number of placeholders in.ValuesPart. This could lead to runtime parameter mismatch errors.Consider adding validation during code generation to ensure field count consistency between
.Fieldsand.ValuesPartplaceholders.go/pkg/db/bulk_identity_insert_ratelimit.sql.go (1)
17-17: Critical issue: incorrect updated_at logic in upsert.The ON DUPLICATE KEY UPDATE clause sets
updated_at = VALUES(created_at), which means the update timestamp will always reflect the creation time instead of the actual update time. This is a data integrity issue.The fix requires:
- Adding
updated_atto theInsertIdentityRatelimitParamsstruct- Including
updated_atin the VALUES clause- Changing the conflict clause to
updated_at = VALUES(updated_at)This ensures proper timestamp tracking for record updates.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (25)
go/pkg/db/bulk_api_insert.sql.go(1 hunks)go/pkg/db/bulk_audit_log_insert.sql.go(1 hunks)go/pkg/db/bulk_audit_log_target_insert.sql.go(1 hunks)go/pkg/db/bulk_branch_insert.sql.go(1 hunks)go/pkg/db/bulk_branch_upsert.sql.go(1 hunks)go/pkg/db/bulk_build_insert.sql.go(1 hunks)go/pkg/db/bulk_build_step_insert.sql.go(1 hunks)go/pkg/db/bulk_identity_insert.sql.go(1 hunks)go/pkg/db/bulk_identity_insert_ratelimit.sql.go(1 hunks)go/pkg/db/bulk_key_encryption_insert.sql.go(1 hunks)go/pkg/db/bulk_key_insert.sql.go(1 hunks)go/pkg/db/bulk_key_insert_ratelimit.sql.go(1 hunks)go/pkg/db/bulk_key_permission_insert.sql.go(1 hunks)go/pkg/db/bulk_key_role_insert.sql.go(1 hunks)go/pkg/db/bulk_keyring_insert.sql.go(1 hunks)go/pkg/db/bulk_permission_insert.sql.go(1 hunks)go/pkg/db/bulk_project_insert.sql.go(1 hunks)go/pkg/db/bulk_ratelimit_namespace_insert.sql.go(1 hunks)go/pkg/db/bulk_ratelimit_override_insert.sql.go(1 hunks)go/pkg/db/bulk_role_insert.sql.go(1 hunks)go/pkg/db/bulk_role_permission_insert.sql.go(1 hunks)go/pkg/db/bulk_route_insert.sql.go(1 hunks)go/pkg/db/bulk_version_insert.sql.go(1 hunks)go/pkg/db/bulk_workspace_insert.sql.go(1 hunks)go/pkg/db/plugins/bulk-insert/bulk_insert.go.tmpl(1 hunks)
🧰 Additional context used
🧠 Learnings (22)
go/pkg/db/bulk_key_insert.sql.go (1)
Learnt from: chronark
PR: unkeyed/unkey#3420
File: go/pkg/hydra/store/gorm/gorm.go:486-498
Timestamp: 2025-07-02T11:51:58.572Z
Learning: The Hydra package (go/pkg/hydra) is planned to be migrated from GORM to sqlc for database operations, which explains why raw SQL queries are acceptable in the current implementation.
go/pkg/db/bulk_key_permission_insert.sql.go (2)
Learnt from: chronark
PR: unkeyed/unkey#3420
File: go/pkg/hydra/store/gorm/gorm.go:486-498
Timestamp: 2025-07-02T11:51:58.572Z
Learning: The Hydra package (go/pkg/hydra) is planned to be migrated from GORM to sqlc for database operations, which explains why raw SQL queries are acceptable in the current implementation.
Learnt from: chronark
PR: unkeyed/unkey#3560
File: go/deploy/metald/internal/database/repository.go:0-0
Timestamp: 2025-07-15T14:59:30.212Z
Learning: go/deploy/metald cannot currently import helpers from go/pkg/db because it is not yet part of the main Go module; avoid suggesting such imports until the modules are unified.
go/pkg/db/bulk_ratelimit_namespace_insert.sql.go (3)
Learnt from: chronark
PR: unkeyed/unkey#3420
File: go/pkg/hydra/store/gorm/gorm.go:486-498
Timestamp: 2025-07-02T11:51:58.572Z
Learning: The Hydra package (go/pkg/hydra) is planned to be migrated from GORM to sqlc for database operations, which explains why raw SQL queries are acceptable in the current implementation.
Learnt from: Flo4604
PR: unkeyed/unkey#3606
File: go/pkg/db/replica.go:8-11
Timestamp: 2025-07-16T15:38:53.464Z
Learning: For debugging database replica usage in go/pkg/db/replica.go, it's acceptable to mark QueryRowContext operations as "success" even though SQL errors only surface during row.Scan() calls. The timing metrics are the primary concern for debugging replica performance patterns.
Learnt from: ogzhanolguncu
PR: unkeyed/unkey#2872
File: apps/dashboard/lib/trpc/routers/ratelimit/createNamespace.ts:36-39
Timestamp: 2025-04-08T09:34:24.576Z
Learning: When querying or updating namespaces in the Unkey dashboard, always scope the operations to the current workspace using `eq(table.workspaceId, ctx.workspace.id)` to prevent cross-workspace access.
go/pkg/db/bulk_key_insert_ratelimit.sql.go (3)
Learnt from: chronark
PR: unkeyed/unkey#2294
File: apps/api/src/pkg/keys/service.ts:268-271
Timestamp: 2024-10-20T07:05:55.471Z
Learning: In `apps/api/src/pkg/keys/service.ts`, `ratelimitAsync` is a table relation, not a column selection. When querying, ensure that table relations are included appropriately, not as columns.
Learnt from: chronark
PR: unkeyed/unkey#3420
File: go/pkg/hydra/store/gorm/gorm.go:486-498
Timestamp: 2025-07-02T11:51:58.572Z
Learning: The Hydra package (go/pkg/hydra) is planned to be migrated from GORM to sqlc for database operations, which explains why raw SQL queries are acceptable in the current implementation.
Learnt from: Flo4604
PR: unkeyed/unkey#3606
File: go/pkg/db/replica.go:8-11
Timestamp: 2025-07-16T15:38:53.464Z
Learning: For debugging database replica usage in go/pkg/db/replica.go, it's acceptable to mark QueryRowContext operations as "success" even though SQL errors only surface during row.Scan() calls. The timing metrics are the primary concern for debugging replica performance patterns.
go/pkg/db/bulk_ratelimit_override_insert.sql.go (7)
Learnt from: chronark
PR: unkeyed/unkey#3420
File: go/pkg/hydra/store/gorm/gorm.go:486-498
Timestamp: 2025-07-02T11:51:58.572Z
Learning: The Hydra package (go/pkg/hydra) is planned to be migrated from GORM to sqlc for database operations, which explains why raw SQL queries are acceptable in the current implementation.
Learnt from: Flo4604
PR: unkeyed/unkey#3606
File: go/pkg/db/replica.go:8-11
Timestamp: 2025-07-16T15:38:53.464Z
Learning: For debugging database replica usage in go/pkg/db/replica.go, it's acceptable to mark QueryRowContext operations as "success" even though SQL errors only surface during row.Scan() calls. The timing metrics are the primary concern for debugging replica performance patterns.
Learnt from: chronark
PR: unkeyed/unkey#3560
File: go/deploy/metald/internal/database/repository.go:0-0
Timestamp: 2025-07-15T14:59:30.212Z
Learning: go/deploy/metald cannot currently import helpers from go/pkg/db because it is not yet part of the main Go module; avoid suggesting such imports until the modules are unified.
Learnt from: chronark
PR: unkeyed/unkey#2294
File: apps/api/src/pkg/keys/service.ts:268-271
Timestamp: 2024-10-20T07:05:55.471Z
Learning: In `apps/api/src/pkg/keys/service.ts`, `ratelimitAsync` is a table relation, not a column selection. When querying, ensure that table relations are included appropriately, not as columns.
Learnt from: ogzhanolguncu
PR: unkeyed/unkey#2918
File: apps/dashboard/lib/trpc/routers/api/overview-api-search.ts:0-0
Timestamp: 2025-02-27T14:35:15.251Z
Learning: When using Drizzle ORM with LIKE queries, use the sql`` tagged template syntax (e.g., sql`${table.name} LIKE ${`%${input.query}%`}`) instead of direct string interpolation to prevent SQL injection attacks.
Learnt from: CR
PR: unkeyed/unkey#0
File: go/deploy/CLAUDE.md:0-0
Timestamp: 2025-07-09T08:42:29.316Z
Learning: Applies to go/deploy/**/*.{go,js,ts,tsx,py,sh,md,txt,json,yaml,yml,ini,rb,java,c,cpp,h,cs,rs,php,html,css,scss,xml} : Make sure to add relevant anchor comments whenever a file or piece of code is too complex, very important, confusing, or could have a bug.
Learnt from: ogzhanolguncu
PR: unkeyed/unkey#2872
File: apps/dashboard/lib/trpc/routers/ratelimit/createNamespace.ts:36-39
Timestamp: 2025-04-08T09:34:24.576Z
Learning: In the Unkey dashboard, when making database queries involving workspaces, use `ctx.workspace.id` directly instead of fetching the workspace separately for better performance and security.
go/pkg/db/bulk_permission_insert.sql.go (2)
Learnt from: chronark
PR: unkeyed/unkey#3420
File: go/pkg/hydra/store/gorm/gorm.go:486-498
Timestamp: 2025-07-02T11:51:58.572Z
Learning: The Hydra package (go/pkg/hydra) is planned to be migrated from GORM to sqlc for database operations, which explains why raw SQL queries are acceptable in the current implementation.
Learnt from: Flo4604
PR: unkeyed/unkey#3606
File: go/pkg/db/replica.go:8-11
Timestamp: 2025-07-16T15:38:53.464Z
Learning: For debugging database replica usage in go/pkg/db/replica.go, it's acceptable to mark QueryRowContext operations as "success" even though SQL errors only surface during row.Scan() calls. The timing metrics are the primary concern for debugging replica performance patterns.
go/pkg/db/bulk_key_role_insert.sql.go (2)
Learnt from: chronark
PR: unkeyed/unkey#3420
File: go/pkg/hydra/store/gorm/gorm.go:486-498
Timestamp: 2025-07-02T11:51:58.572Z
Learning: The Hydra package (go/pkg/hydra) is planned to be migrated from GORM to sqlc for database operations, which explains why raw SQL queries are acceptable in the current implementation.
Learnt from: Flo4604
PR: unkeyed/unkey#3606
File: go/pkg/db/replica.go:8-11
Timestamp: 2025-07-16T15:38:53.464Z
Learning: For debugging database replica usage in go/pkg/db/replica.go, it's acceptable to mark QueryRowContext operations as "success" even though SQL errors only surface during row.Scan() calls. The timing metrics are the primary concern for debugging replica performance patterns.
go/pkg/db/bulk_api_insert.sql.go (2)
Learnt from: chronark
PR: unkeyed/unkey#3420
File: go/pkg/hydra/store/gorm/gorm.go:486-498
Timestamp: 2025-07-02T11:51:58.572Z
Learning: The Hydra package (go/pkg/hydra) is planned to be migrated from GORM to sqlc for database operations, which explains why raw SQL queries are acceptable in the current implementation.
Learnt from: chronark
PR: unkeyed/unkey#3560
File: go/deploy/metald/internal/database/repository.go:0-0
Timestamp: 2025-07-15T14:59:30.212Z
Learning: go/deploy/metald cannot currently import helpers from go/pkg/db because it is not yet part of the main Go module; avoid suggesting such imports until the modules are unified.
go/pkg/db/bulk_project_insert.sql.go (2)
Learnt from: chronark
PR: unkeyed/unkey#3560
File: go/deploy/metald/internal/database/repository.go:0-0
Timestamp: 2025-07-15T14:59:30.212Z
Learning: go/deploy/metald cannot currently import helpers from go/pkg/db because it is not yet part of the main Go module; avoid suggesting such imports until the modules are unified.
Learnt from: chronark
PR: unkeyed/unkey#3420
File: go/pkg/hydra/store/gorm/gorm.go:486-498
Timestamp: 2025-07-02T11:51:58.572Z
Learning: The Hydra package (go/pkg/hydra) is planned to be migrated from GORM to sqlc for database operations, which explains why raw SQL queries are acceptable in the current implementation.
go/pkg/db/bulk_route_insert.sql.go (1)
Learnt from: chronark
PR: unkeyed/unkey#3420
File: go/pkg/hydra/store/gorm/gorm.go:486-498
Timestamp: 2025-07-02T11:51:58.572Z
Learning: The Hydra package (go/pkg/hydra) is planned to be migrated from GORM to sqlc for database operations, which explains why raw SQL queries are acceptable in the current implementation.
go/pkg/db/bulk_identity_insert.sql.go (2)
Learnt from: chronark
PR: unkeyed/unkey#3420
File: go/pkg/hydra/store/gorm/gorm.go:486-498
Timestamp: 2025-07-02T11:51:58.572Z
Learning: The Hydra package (go/pkg/hydra) is planned to be migrated from GORM to sqlc for database operations, which explains why raw SQL queries are acceptable in the current implementation.
Learnt from: ogzhanolguncu
PR: unkeyed/unkey#2918
File: apps/dashboard/lib/trpc/routers/api/overview-api-search.ts:0-0
Timestamp: 2025-02-27T14:35:15.251Z
Learning: When using Drizzle ORM with LIKE queries, use the sql`` tagged template syntax (e.g., sql`${table.name} LIKE ${`%${input.query}%`}`) instead of direct string interpolation to prevent SQL injection attacks.
go/pkg/db/bulk_audit_log_insert.sql.go (2)
Learnt from: Flo4604
PR: unkeyed/unkey#3606
File: go/pkg/db/replica.go:8-11
Timestamp: 2025-07-16T15:38:53.464Z
Learning: For debugging database replica usage in go/pkg/db/replica.go, it's acceptable to mark QueryRowContext operations as "success" even though SQL errors only surface during row.Scan() calls. The timing metrics are the primary concern for debugging replica performance patterns.
Learnt from: mcstepp
PR: unkeyed/unkey#3242
File: apps/dashboard/app/(app)/apis/[apiId]/keys/[keyAuthId]/[keyId]/components/controls/components/logs-search/index.tsx:7-43
Timestamp: 2025-05-15T16:09:49.243Z
Learning: For type safety issues involving `any` type assertions, the team prefers to address these systematically with linter updates rather than fixing them individually in code reviews.
go/pkg/db/bulk_workspace_insert.sql.go (3)
Learnt from: ogzhanolguncu
PR: unkeyed/unkey#2872
File: apps/dashboard/lib/trpc/routers/ratelimit/createNamespace.ts:36-39
Timestamp: 2025-04-08T09:34:24.576Z
Learning: In the Unkey dashboard, when making database queries involving workspaces, use `ctx.workspace.id` directly instead of fetching the workspace separately for better performance and security.
Learnt from: chronark
PR: unkeyed/unkey#2180
File: apps/dashboard/lib/constants/workspace-navigations.tsx:56-118
Timestamp: 2024-10-04T20:44:38.489Z
Learning: When typing the `workspace` parameter in functions like `createWorkspaceNavigation`, prefer importing the `Workspace` type from the database module and picking the necessary keys (e.g., `features`) instead of redefining the interface.
Learnt from: ogzhanolguncu
PR: unkeyed/unkey#2872
File: apps/dashboard/lib/trpc/routers/ratelimit/createNamespace.ts:36-39
Timestamp: 2025-04-08T09:34:24.576Z
Learning: When querying or updating namespaces in the Unkey dashboard, always scope the operations to the current workspace using `eq(table.workspaceId, ctx.workspace.id)` to prevent cross-workspace access.
go/pkg/db/bulk_version_insert.sql.go (1)
Learnt from: CR
PR: unkeyed/unkey#0
File: go/deploy/CLAUDE.md:0-0
Timestamp: 2025-07-09T08:42:29.316Z
Learning: Applies to go/deploy/{assetmanagerd,billaged,builderd,metald}/**/*.go : When a service's `*.go` code changes significantly, increase the patch-level version number.
go/pkg/db/bulk_role_permission_insert.sql.go (2)
Learnt from: chronark
PR: unkeyed/unkey#3420
File: go/pkg/hydra/store/gorm/gorm.go:486-498
Timestamp: 2025-07-02T11:51:58.572Z
Learning: The Hydra package (go/pkg/hydra) is planned to be migrated from GORM to sqlc for database operations, which explains why raw SQL queries are acceptable in the current implementation.
Learnt from: Flo4604
PR: unkeyed/unkey#3606
File: go/pkg/db/replica.go:8-11
Timestamp: 2025-07-16T15:38:53.464Z
Learning: For debugging database replica usage in go/pkg/db/replica.go, it's acceptable to mark QueryRowContext operations as "success" even though SQL errors only surface during row.Scan() calls. The timing metrics are the primary concern for debugging replica performance patterns.
go/pkg/db/plugins/bulk-insert/bulk_insert.go.tmpl (1)
Learnt from: CR
PR: unkeyed/unkey#0
File: go/deploy/CLAUDE.md:0-0
Timestamp: 2025-07-09T08:42:29.316Z
Learning: Applies to go/deploy/**/*.{go,js,ts,tsx,py,sh,md,txt,json,yaml,yml,ini,rb,java,c,cpp,h,cs,rs,php,html,css,scss,xml} : Make sure to add relevant anchor comments whenever a file or piece of code is too complex, very important, confusing, or could have a bug.
go/pkg/db/bulk_build_insert.sql.go (2)
Learnt from: chronark
PR: unkeyed/unkey#3420
File: go/pkg/hydra/store/gorm/gorm.go:486-498
Timestamp: 2025-07-02T11:51:58.572Z
Learning: The Hydra package (go/pkg/hydra) is planned to be migrated from GORM to sqlc for database operations, which explains why raw SQL queries are acceptable in the current implementation.
Learnt from: chronark
PR: unkeyed/unkey#3560
File: go/deploy/metald/internal/database/repository.go:0-0
Timestamp: 2025-07-15T14:59:30.212Z
Learning: go/deploy/metald cannot currently import helpers from go/pkg/db because it is not yet part of the main Go module; avoid suggesting such imports until the modules are unified.
go/pkg/db/bulk_audit_log_target_insert.sql.go (2)
Learnt from: mcstepp
PR: unkeyed/unkey#3242
File: apps/dashboard/app/(app)/apis/[apiId]/keys/[keyAuthId]/[keyId]/components/controls/components/logs-search/index.tsx:7-43
Timestamp: 2025-05-15T16:09:49.243Z
Learning: For type safety issues involving `any` type assertions, the team prefers to address these systematically with linter updates rather than fixing them individually in code reviews.
Learnt from: CR
PR: unkeyed/unkey#0
File: go/deploy/CLAUDE.md:0-0
Timestamp: 2025-07-09T08:42:29.316Z
Learning: Applies to go/deploy/**/*.{go,js,ts,tsx,py,sh,md,txt,json,yaml,yml,ini,rb,java,c,cpp,h,cs,rs,php,html,css,scss,xml} : Use `AIDEV-NOTE:`, `AIDEV-TODO:`, `AIDEV-BUSINESS_RULE:`, or `AIDEV-QUESTION:` (all-caps prefix) as anchor comments aimed at AI and developers.
go/pkg/db/bulk_identity_insert_ratelimit.sql.go (2)
Learnt from: chronark
PR: unkeyed/unkey#3420
File: go/pkg/hydra/store/gorm/gorm.go:486-498
Timestamp: 2025-07-02T11:51:58.572Z
Learning: The Hydra package (go/pkg/hydra) is planned to be migrated from GORM to sqlc for database operations, which explains why raw SQL queries are acceptable in the current implementation.
Learnt from: Flo4604
PR: unkeyed/unkey#3606
File: go/pkg/db/replica.go:8-11
Timestamp: 2025-07-16T15:38:53.464Z
Learning: For debugging database replica usage in go/pkg/db/replica.go, it's acceptable to mark QueryRowContext operations as "success" even though SQL errors only surface during row.Scan() calls. The timing metrics are the primary concern for debugging replica performance patterns.
go/pkg/db/bulk_build_step_insert.sql.go (1)
Learnt from: CR
PR: unkeyed/unkey#0
File: go/deploy/CLAUDE.md:0-0
Timestamp: 2025-07-09T08:42:29.316Z
Learning: Applies to go/deploy/{assetmanagerd,billaged,builderd,metald}/**/*.go : When a service's `*.go` code changes significantly, increase the patch-level version number.
go/pkg/db/bulk_branch_upsert.sql.go (3)
Learnt from: chronark
PR: unkeyed/unkey#3560
File: go/deploy/metald/internal/database/repository.go:0-0
Timestamp: 2025-07-15T14:59:30.212Z
Learning: go/deploy/metald cannot currently import helpers from go/pkg/db because it is not yet part of the main Go module; avoid suggesting such imports until the modules are unified.
Learnt from: chronark
PR: unkeyed/unkey#3420
File: go/pkg/hydra/store/gorm/gorm.go:486-498
Timestamp: 2025-07-02T11:51:58.572Z
Learning: The Hydra package (go/pkg/hydra) is planned to be migrated from GORM to sqlc for database operations, which explains why raw SQL queries are acceptable in the current implementation.
Learnt from: Flo4604
PR: unkeyed/unkey#3606
File: go/pkg/db/replica.go:8-11
Timestamp: 2025-07-16T15:38:53.464Z
Learning: For debugging database replica usage in go/pkg/db/replica.go, it's acceptable to mark QueryRowContext operations as "success" even though SQL errors only surface during row.Scan() calls. The timing metrics are the primary concern for debugging replica performance patterns.
go/pkg/db/bulk_branch_insert.sql.go (2)
Learnt from: chronark
PR: unkeyed/unkey#3420
File: go/pkg/hydra/store/gorm/gorm.go:486-498
Timestamp: 2025-07-02T11:51:58.572Z
Learning: The Hydra package (go/pkg/hydra) is planned to be migrated from GORM to sqlc for database operations, which explains why raw SQL queries are acceptable in the current implementation.
Learnt from: chronark
PR: unkeyed/unkey#3560
File: go/deploy/metald/internal/database/repository.go:0-0
Timestamp: 2025-07-15T14:59:30.212Z
Learning: go/deploy/metald cannot currently import helpers from go/pkg/db because it is not yet part of the main Go module; avoid suggesting such imports until the modules are unified.
🧬 Code Graph Analysis (17)
go/pkg/db/bulk_key_permission_insert.sql.go (2)
go/pkg/db/queries.go (1)
Queries(3-3)go/pkg/hydra/store/db.go (1)
DBTX(8-13)
go/pkg/db/bulk_role_insert.sql.go (2)
go/pkg/db/queries.go (1)
Queries(3-3)go/pkg/hydra/store/db.go (1)
DBTX(8-13)
go/pkg/db/bulk_ratelimit_namespace_insert.sql.go (2)
go/pkg/db/queries.go (1)
Queries(3-3)go/pkg/hydra/store/db.go (1)
DBTX(8-13)
go/pkg/db/bulk_key_insert_ratelimit.sql.go (3)
go/pkg/db/queries.go (1)
Queries(3-3)go/pkg/hydra/store/db.go (1)
DBTX(8-13)go/pkg/db/key_insert_ratelimit.sql_generated.go (1)
InsertKeyRatelimitParams(35-44)
go/pkg/db/bulk_ratelimit_override_insert.sql.go (2)
go/pkg/db/queries.go (1)
Queries(3-3)go/pkg/hydra/store/db.go (1)
DBTX(8-13)
go/pkg/db/bulk_permission_insert.sql.go (2)
go/pkg/db/queries.go (1)
Queries(3-3)go/pkg/hydra/store/db.go (1)
DBTX(8-13)
go/pkg/db/bulk_key_role_insert.sql.go (2)
go/pkg/db/queries.go (1)
Queries(3-3)go/pkg/hydra/store/db.go (1)
DBTX(8-13)
go/pkg/db/bulk_key_encryption_insert.sql.go (3)
go/pkg/db/queries.go (1)
Queries(3-3)go/pkg/hydra/store/db.go (1)
DBTX(8-13)go/pkg/db/key_encryption_insert.sql_generated.go (1)
InsertKeyEncryptionParams(18-24)
go/pkg/db/bulk_project_insert.sql.go (3)
go/pkg/db/queries.go (1)
Queries(3-3)go/pkg/hydra/store/db.go (1)
DBTX(8-13)go/pkg/db/project_insert.sql_generated.go (1)
InsertProjectParams(30-41)
go/pkg/db/bulk_workspace_insert.sql.go (3)
go/pkg/db/queries.go (1)
Queries(3-3)go/pkg/hydra/store/db.go (1)
DBTX(8-13)go/pkg/db/workspace_insert.sql_generated.go (1)
InsertWorkspaceParams(37-42)
go/pkg/db/bulk_version_insert.sql.go (3)
go/pkg/db/queries.go (1)
Queries(3-3)go/pkg/hydra/store/db.go (1)
DBTX(8-13)go/pkg/db/version_insert.sql_generated.go (1)
InsertVersionParams(45-58)
go/pkg/db/bulk_role_permission_insert.sql.go (2)
go/pkg/db/queries.go (1)
Queries(3-3)go/pkg/hydra/store/db.go (1)
DBTX(8-13)
go/pkg/db/bulk_build_insert.sql.go (3)
go/pkg/db/queries.go (1)
Queries(3-3)go/pkg/hydra/store/db.go (1)
DBTX(8-13)go/pkg/db/build_insert.sql_generated.go (1)
InsertBuildParams(46-52)
go/pkg/db/bulk_audit_log_target_insert.sql.go (3)
go/pkg/db/queries.go (1)
Queries(3-3)go/pkg/hydra/store/db.go (1)
DBTX(8-13)go/pkg/db/audit_log_target_insert.sql_generated.go (1)
InsertAuditLogTargetParams(40-51)
go/pkg/db/bulk_build_step_insert.sql.go (3)
go/pkg/db/queries.go (1)
Queries(3-3)go/pkg/hydra/store/db.go (1)
DBTX(8-13)go/pkg/db/build_step_insert.sql_generated.go (1)
InsertVersionStepParams(29-35)
go/pkg/db/bulk_keyring_insert.sql.go (2)
go/pkg/db/queries.go (1)
Queries(3-3)go/pkg/hydra/store/db.go (1)
DBTX(8-13)
go/pkg/db/bulk_branch_insert.sql.go (3)
go/pkg/db/queries.go (1)
Queries(3-3)go/pkg/hydra/store/db.go (1)
DBTX(8-13)go/pkg/db/branch_insert.sql_generated.go (1)
InsertBranchParams(26-33)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: Build / Build
- GitHub Check: Test Go API Local / Test
- GitHub Check: Test Agent Local / test_agent_local
- GitHub Check: Test API / API Test Local
- GitHub Check: Test Packages / Test
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (58)
go/pkg/db/bulk_key_insert_ratelimit.sql.go (4)
1-9: Generated code structure looks correct.The file header, package declaration, and imports are appropriate for a generated bulk insert function.
11-12: SQL query structure is correct.The bulk insert query properly handles the MySQL reserved keyword
limitwith backticks and includes all necessary columns for the ratelimits table.
14-19: Function signature and early return are well-designed.The function properly handles the empty slice case and uses appropriate parameter types for bulk operations.
21-45: Bulk insert implementation is correct and efficient.The query building logic properly constructs parameterized queries with the correct number of placeholders, and the argument collection matches the SQL column order. The execution uses
ExecContextappropriately.go/pkg/db/bulk_project_insert.sql.go (4)
1-9: Generated code structure is consistent.The file header, package declaration, and imports follow the same pattern as other generated bulk insert files.
11-12: SQL query structure is appropriate for projects table.The bulk insert query includes all necessary columns for the projects table without requiring backticks for reserved keywords.
14-19: Function signature follows the established pattern.The function uses the correct parameter type for project inserts and maintains the same early return optimization.
21-47: Bulk insert implementation is correct.The query building uses the correct number of placeholders (10) for the projects table, and the argument collection order matches the SQL column order perfectly.
go/pkg/db/bulk_keyring_insert.sql.go (3)
1-9: Generated code structure is consistent.The file header, package declaration, and imports follow the established pattern for generated bulk insert files.
11-12: SQL query structure is correct.The bulk insert query properly includes all 8 columns for the key_auth table with appropriate backticks.
14-19: Function signature follows the established pattern.The function uses the correct parameter type for keyring inserts and maintains the same early return optimization.
go/pkg/db/bulk_key_insert.sql.go (4)
1-9: Generated code structure is consistent.The file header, package declaration, and imports follow the established pattern for generated bulk insert files.
11-12: SQL query structure is comprehensive.The bulk insert query properly includes all 16 columns for the keys table with appropriate backticks for reserved keywords.
14-19: Function signature follows the established pattern.The function uses the correct parameter type for key inserts and maintains the same early return optimization.
24-24: Hardcoded null for owner_id is intentionalThe
InsertKeyParamsstruct for single-row inserts does not include anOwnerIDfield, and its generatedinsertKeySQL omitsowner_idas a parameter. The bulk-insert implementation mirrors this design by hardcodingnullforowner_id. You can safely ignore this review comment.Likely an incorrect or invalid review comment.
go/pkg/db/bulk_branch_insert.sql.go (4)
1-9: Generated code structure is consistent.The file header, package declaration, and imports follow the established pattern for generated bulk insert files.
11-12: SQL query structure is clean and appropriate.The bulk insert query includes all necessary columns for the branches table without requiring backticks for reserved keywords.
14-19: Function signature follows the established pattern.The function uses the correct parameter type for branch inserts and maintains the same early return optimization.
21-43: Bulk insert implementation is correct and complete.The query building uses the correct number of placeholders (6) for the branches table, and the argument collection order matches the SQL column order perfectly without any hardcoded values.
go/pkg/db/bulk_role_insert.sql.go (5)
1-9: Generated code structure looks good.The file header appropriately indicates this is generated code with clear "DO NOT EDIT" instructions. The imports are minimal and necessary for the bulk insert functionality.
11-12: SQL template correctly structured for bulk insert.The constant properly defines the base INSERT query with placeholder for dynamic VALUES clause generation.
14-19: Function signature and early return optimization are well-designed.The function correctly uses the DBTX interface for database operations and includes an efficient early return for empty input slices.
21-27: Query building logic is correctly implemented.The dynamic generation of value clauses with proper placeholder count (5) matches the column count in the SQL template. The string manipulation is efficient and secure.
29-37: Argument collection correctly uses modern Go conventions.The code properly uses
[]anyinstead of[]interface{}and correctly flattens all arguments in the proper order to match the SQL placeholder sequence.go/pkg/db/bulk_audit_log_insert.sql.go (4)
1-9: Generated code structure is consistent and appropriate.The file header and imports follow the same pattern as other generated bulk insert files, with proper "DO NOT EDIT" instructions and necessary imports.
11-12: SQL template correctly handles audit_log table structure.The constant properly defines the bulk insert template with backtick escaping for the table name and comprehensive column listing for the audit_log table.
14-19: Function signature follows established pattern correctly.The method signature is consistent with other bulk insert methods and includes the efficient early return optimization for empty input slices.
21-27: Query building correctly handles JSON casting and column count.The dynamic generation of value clauses properly includes 14 placeholders matching the column count, with appropriate
CAST(? AS JSON)for the actor_meta field.go/pkg/db/bulk_audit_log_target_insert.sql.go (4)
1-9: Generated code structure is consistent.The file header and imports maintain consistency with other generated bulk insert files, properly indicating the generated nature and including necessary imports.
11-12: SQL template correctly structured for audit_log_target table.The constant properly defines the bulk insert template with appropriate backtick escaping and complete column listing for the audit_log_target table.
14-19: Function signature follows established pattern.The method signature is consistent with other bulk insert methods and includes the efficient early return optimization for empty input slices.
21-27: Query building correctly handles JSON casting and column count.The dynamic generation of value clauses properly includes 10 placeholders matching the column count, with appropriate
CAST(? AS JSON)for the meta field.go/pkg/db/bulk_permission_insert.sql.go (5)
1-9: Generated code structure is consistent.The file header and imports maintain consistency with other generated bulk insert files, properly indicating the generated nature and including necessary imports.
11-12: SQL template correctly structured for permissions table.The constant properly defines the bulk insert template with complete column listing for the permissions table.
14-19: Function signature follows established pattern.The method signature is consistent with other bulk insert methods and includes the efficient early return optimization for empty input slices.
21-27: Query building correctly matches column count.The dynamic generation of value clauses properly includes 6 placeholders matching the column count in the permissions table INSERT statement.
29-38: Argument collection correctly implemented.The code properly uses
[]anyand correctly flattens all 6 arguments in the proper order to match the SQL column sequence.go/pkg/db/bulk_ratelimit_namespace_insert.sql.go (5)
1-9: Generated code structure is consistent.The file header and imports maintain consistency with other generated bulk insert files, properly indicating the generated nature and including necessary imports.
11-12: SQL template correctly structured for ratelimit_namespaces table.The constant properly defines the bulk insert template with backtick escaping and includes the soft-delete columns (updated_at_m, deleted_at_m) in the column listing.
14-19: Function signature follows established pattern.The method signature is consistent with other bulk insert methods and includes the efficient early return optimization for empty input slices.
21-27: Query building correctly implements soft-delete pattern.The value clauses properly include 6 placeholders with the last two hardcoded as NULL for updated_at_m and deleted_at_m, which is appropriate for the soft-delete pattern where these fields are only populated on updates/deletes.
29-36: Argument collection correctly handles soft-delete pattern.The code properly uses
[]anyand correctly flattens only the 4 non-NULL arguments (id, workspace_id, name, created_at) while the soft-delete columns are handled as NULL in the SQL template.go/pkg/db/bulk_role_permission_insert.sql.go (1)
15-41: Bulk insert implementation is correct.The function properly constructs a multi-row INSERT statement with correct placeholder usage and argument ordering that matches the SQL column sequence.
go/pkg/db/bulk_key_role_insert.sql.go (1)
15-41: Bulk insert implementation is correct.The function properly constructs a multi-row INSERT statement with correct placeholder usage and argument ordering that matches the SQL column sequence.
go/pkg/db/bulk_api_insert.sql.go (1)
15-44: Bulk insert implementation correctly handles soft delete column.The function properly constructs the bulk insert query with
deleted_at_mhardcoded to NULL for new records, which is the expected behavior for soft-delete columns during creation.go/pkg/db/bulk_ratelimit_override_insert.sql.go (1)
24-24: Hardcoded async value is appropriate.Setting
asynctofalsefor all bulk inserted ratelimit overrides is correct behavior for synchronous rate limiting.go/pkg/db/bulk_key_permission_insert.sql.go (1)
15-41: Bulk insert implementation follows correct pattern.The function properly constructs a multi-row INSERT statement with correct placeholder usage, assuming the field name verification passes.
go/pkg/db/bulk_build_step_insert.sql.go (1)
1-45: Generated bulk insert implementation looks correct.The implementation follows the expected pattern with proper parameter handling, SQL construction, and MySQL-specific upsert semantics using
ON DUPLICATE KEY UPDATE. The argument flattening matches the SQL column order and the empty slice check prevents unnecessary database calls.go/pkg/db/bulk_route_insert.sql.go (1)
1-45: Generated bulk insert implementation looks correct.The implementation follows the expected pattern with proper parameter handling and SQL construction. The 8-parameter structure matches the hostname_routes table schema, and the argument flattening maintains the correct column order.
go/pkg/db/bulk_build_insert.sql.go (1)
1-42: Generated bulk insert implementation with mixed static/dynamic values looks correct.The implementation correctly handles the builds table structure where some columns have default values ('pending' status, 'docker' build tool, various NULL values) while others are parameterized. The argument flattening matches only the dynamic parameters, which is appropriate for this use case.
go/pkg/db/bulk_identity_insert.sql.go (1)
24-24: JSON casting is appropriately handled.The
CAST(? AS JSON)for the meta column is correctly implemented to ensure proper type handling for JSON data in the database.go/pkg/db/bulk_key_encryption_insert.sql.go (1)
1-42: Generated bulk insert implementation looks correct.The implementation follows the expected pattern with proper parameter handling and SQL construction. The 5-parameter structure matches the encrypted_keys table schema, and the argument flattening maintains the correct column order.
go/pkg/db/bulk_version_insert.sql.go (1)
1-49: LGTM! Well-structured bulk insert implementation.The implementation correctly:
- Uses parameterized queries to prevent SQL injection
- Returns early for empty inputs to avoid unnecessary database calls
- Flattens all arguments into a single slice for efficient execution
- Maintains proper field ordering consistent with
InsertVersionParamsgo/pkg/db/bulk_workspace_insert.sql.go (1)
12-12: No action required:created_at_mmapping is correctThe
workspacestable schema definescreated_at_m(notcreated_at), andInsertWorkspaceParams.CreatedAtintentionally maps to that column. The bulk insert query and struct field are consistent with the database.go/pkg/db/plugins/bulk-insert/bulk_insert.go.tmpl (1)
15-19: LGTM! Clean conditional logic for DB argument handling.The template properly handles both cases - methods with and without explicit DB arguments using clean Go template conditionals.
go/pkg/db/bulk_branch_upsert.sql.go (2)
12-14: LGTM! Proper upsert implementation.The ON DUPLICATE KEY UPDATE clause correctly updates only the
updated_atfield usingVALUES(updated_at), which ensures the timestamp reflects the actual update time.
22-28: Efficient bulk query construction.The implementation properly constructs the bulk query by creating the right number of placeholder groups and joining them efficiently.
go/pkg/db/bulk_identity_insert_ratelimit.sql.go (1)
12-15: Proper handling of MySQL reserved words.Good use of backticks around the table name
ratelimitsand column namelimitto handle MySQL reserved words correctly.
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
go/pkg/db/plugins/bulk-insert/utils_test.go(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
go/pkg/db/plugins/bulk-insert/utils_test.go (1)
Learnt from: Flo4604
PR: unkeyed/unkey#3631
File: go/pkg/db/bulk_keyring_insert.sql.go:23-25
Timestamp: 2025-07-17T14:24:20.359Z
Learning: In go/pkg/db/bulk_keyring_insert.sql.go and similar bulk insert generated files, hardcoded zero values for fields like size_approx and size_last_updated_at are intentional and reflect the original SQL query structure, not missing parameters.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: Test Agent Local / test_agent_local
- GitHub Check: Test Go API Local / Test
- GitHub Check: Build / Build
- GitHub Check: Test API / API Test Local
- GitHub Check: Test Packages / Test
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (1)
go/pkg/db/plugins/bulk-insert/utils_test.go (1)
7-46: Comprehensive test coverage for the ToCamelCase function.The test cases provide excellent coverage of the
ToCamelCasefunction, including:
- Basic snake_case to CamelCase conversion
- Special abbreviation handling (id → ID)
- URL suffix handling (url → Url when not at the beginning)
- Multiple underscores and compound names
- Edge cases (empty strings, single characters)
- Numbers in field names
The test structure follows Go testing best practices with table-driven tests and proper subtest naming.
Graphite Automations"Notify author when CI fails" took an action on this PR • (07/17/25)1 teammate was notified to this PR based on Andreas Thomas's automation. "Post a GIF when PR approved" took an action on this PR • (07/18/25)1 gif was posted to this PR based on Andreas Thomas's automation. |
|
can you make this a draft? |
|
huh that was just a main |
|
main update* |
|
it's fine to review sorry 😅 |
|
ok cool |
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (10)
go/pkg/db/bulk_role_permission_insert.sql.go (1)
39-40: Fix indentation inconsistency.The database execution logic is correct, but there's an indentation formatting issue that should be addressed.
- _, err := db.ExecContext(ctx, bulkQuery, allArgs...) - return err + _, err := db.ExecContext(ctx, bulkQuery, allArgs...) + return errgo/pkg/db/bulk_audit_log_target_insert.sql.go (1)
45-46: Fix indentation inconsistency.The execution logic is correct but has the same indentation formatting issue as other bulk insert files.
- _, err := db.ExecContext(ctx, bulkQuery, allArgs...) - return err + _, err := db.ExecContext(ctx, bulkQuery, allArgs...) + return errgo/pkg/db/bulk_key_permission_insert.sql.go (1)
35-35: Field name mismatch between SQL column and struct field.The SQL column is
created_at_mbut the code accessesarg.CreatedAt, which may cause a field mapping issue.Based on past review feedback, ensure the struct field matches the SQL column name or update the field access accordingly.
go/pkg/db/bulk_key_role_insert.sql.go (1)
39-40: Fix indentation inconsistency.The execution logic is correct but has the same indentation formatting issue as other bulk insert files.
- _, err := db.ExecContext(ctx, bulkQuery, allArgs...) - return err + _, err := db.ExecContext(ctx, bulkQuery, allArgs...) + return errgo/pkg/db/plugins/bulk-insert/utils.go (1)
38-53: CamelCase conversion with proper special case handling.The function correctly handles sqlc naming conventions with "id" → "ID" and "url" → "Url" (only in compound names). However, the function could be more robust against edge cases.
Consider adding a guard for empty segments to make the function more robust:
func ToCamelCase(name string) string { + if name == "" { + return "" + } + out := "" for i, p := range strings.Split(name, "_") { + if p == "" { + continue + } if p == "id" { out += "ID" } else if p == "url" && i > 0 {go/pkg/db/bulk_identity_insert.sql.go (1)
12-12: Table name escaping with string concatenation.The table name escaping using string concatenation with backticks is unconventional and reduces readability compared to a raw string literal.
go/pkg/db/bulk_workspace_insert.sql.go (1)
1-42: Implementation looks correct for the generated pattern.The bulk insert follows the expected structure with the hardcoded default values reflecting the original SQL query design.
go/pkg/db/plugins/bulk-insert/bulk_insert.go.tmpl (1)
1-49: Template structure is well-designed.The template correctly handles both DB argument and non-DB argument emission patterns, and properly iterates through fields for argument collection.
go/pkg/db/bulk_identity_insert_ratelimit.sql.go (1)
12-17: The updated_at timestamp issue needs attention.As previously noted, setting
updated_at = VALUES(created_at)will use the creation timestamp instead of the actual update time.go/pkg/db/plugins/bulk-insert/generator.go (1)
106-108: Silent error handling makes debugging difficult.When parse or render errors occur, the function returns nil without any indication of what went wrong.
Also applies to: 126-128

What does this PR do?
Fixes # (issue)
If there is not an issue for this, please create one first. This is used to tracking purposes and also helps use understand why this PR exists
Type of change
How should this be tested?
Checklist
Required
pnpm buildpnpm fmtconsole.logsgit pull origin mainAppreciated
Summary by CodeRabbit
New Features
Refactor
Chores
Documentation
Tests
Style