Investigate ODBC compatibility mode via environment variable
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
まず PR #638 と、go-sqlcmd と ODBC sqlcmd の違いとして挙げられている項目を確認します。コードページの処理、出力、エラー、終了コード、変数展開、NULL、列幅を比較し、その後、どの動作を設定可能にできるかを判断します。完了には、互換性設計の文書化、実装範囲の定義、テスト、ドキュメントの更新が必要です。
索引モデルが issue の本文から書いたものです。
説明
Summary
Investigate adding an environment variable (e.g., SQLCMD_ODBC_COMPAT=1) that would make go-sqlcmd behave exactly like the original ODBC sqlcmd for maximum backward compatibility.
Motivation
go-sqlcmd has intentionally diverged from ODBC sqlcmd in several areas to provide better defaults for modern usage. However, users migrating existing scripts or workflows may need exact behavioral compatibility with the original tool.
Potential Scope
When the compatibility mode is enabled, go-sqlcmd would match ODBC sqlcmd behavior in areas including:
Codepage Handling (PR #638)
| Behavior | go-sqlcmd (current) | ODBC sqlcmd | Compat mode |
|---|---|---|---|
| Default encoding | UTF-8 | Windows ANSI (system locale) | ANSI |
| UTF-16 codepages (1200, 1201) | Not supported | Supported | Supported |
| BOM detection | Automatic | Automatic | Automatic |
Other Potential Areas (to investigate)
- Output formatting differences
- Error message formatting
- Exit code behavior
- Variable expansion edge cases
- Null handling in output
- Column width calculations
Implementation Options
- Single env var: SQLCMD_ODBC_COMPAT=1 enables all compatibility behaviors
- Granular env vars: SQLCMD_CODEPAGE_COMPAT=1, SQLCMD_OUTPUT_COMPAT=1, etc.
- Command-line flag: --odbc-compat or -y (if available)
Tasks
- Document all known behavioral differences between go-sqlcmd and ODBC sqlcmd
- Evaluate which differences can reasonably be made configurable
- Design the compatibility mode API (env var name, granularity)
- Implement compatibility mode for codepage handling
- Add tests for compatibility mode behavior
- Update documentation
Related
- PR #638: Add -f codepage flag for input/output encoding
- This issue originated from codepage investigation showing ODBC uses ANSI default vs go-sqlcmd's UTF-8 default
Labels
enhancement, documentation
- 主要言語
- Go
- スター
- 595
- フォーク
- 91
- 平均マージ
- 9時間 35分
- マージ済み PR(30日)
- 1
環境構築
このプロジェクトの環境構築ファイルはまだ確認していません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/go-sqlcmd のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
microsoft/go-sqlcmd#733 · コメント 7 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
microsoft/go-sqlcmd の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
521xueweihan/HelloGitHub#3789 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 12 日以内に返信
-
stage-fail
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
siyuan-note/bazaar#2282 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
openshift/kube-compare#307 ·
メンテナーはふだん 1 日以内に返信