Investigate ODBC compatibility mode via environment variable
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 20/100
Direzione di ricerca
Inizia esaminando PR #638 e le differenze elencate tra go-sqlcmd e ODBC sqlcmd. Confronta la gestione delle code page, dell’output, degli errori, dei codici di uscita, dell’espansione delle variabili, dei valori NULL e delle larghezze delle colonne, quindi determina quali comportamenti possono essere configurati. Il completamento richiede un design di compatibilità documentato, l’ambito dell’implementazione, test e aggiornamenti alla documentazione.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Go
- Stelle
- 595
- Fork
- 91
- Merge medio
- 9h 35m
- PR unite (30g)
- 1
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoft/go-sqlcmd
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Fix CVEs in Version v1.10.0 Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
-
":Help" command not working Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 65/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 76/100
Tutte le issue di microsoft/go-sqlcmd
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
acceptance-tests phase-coding schema-coverage testing triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100