Merged
Conversation
Contributor
📝 WalkthroughウォークスルーCSV インポートの動的スキーマベース列選択が削除されました。既存の情報スキーマ列の取得、列マッピングの構築、および関連する警告・テストが除去され、INSERT 文生成がシンプル化されました。 変更内容
見積りコードレビュー工数🎯 3 (中程度) | ⏱️ ~20 分 詩
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Contributor
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@stationapi/src/import.rs`:
- Around line 115-137: Build a column-name list from headers (skipping headers
whose name starts with '#') and use that list in the INSERT statement instead of
relying on VALUES-only; specifically, where sql_lines_inner.push(format!("INSERT
INTO public.{table_name} VALUES ")); is produced, construct a comma-separated
string of the non-excluded header names in the same order you generate values
(the same filter logic used on headers inside the csv_data loop), then change
the INSERT to sql_lines_inner.push(format!("INSERT INTO public.{table_name}
({cols}) VALUES ")); ensure the cols string is derived from the same
headers/indices used when producing each row (so
csv_data.iter().enumerate()/headers filter_map remains aligned) and keep using
escape_sql_string for values.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b4401e8b-c970-4603-910e-31dadbcf1257
📒 Files selected for processing (1)
stationapi/src/import.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
実際は必要のなかったインポートコードの巻き戻し
変更の種類
変更内容
テスト
cargo fmt --all -- --checkが通ることcargo clippy -- -D warningsが通ることcargo test(SQLX_OFFLINE=true)が通ること関連Issue
スクリーンショット(任意)
Summary by CodeRabbit
Bug Fixes