Separate Type Contructors for (var)char and n(var)char
Los mantenedores suelen responder en 2 días
@gargsaumya ya está trabajando en esto.
Desde el 15/8/2025.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Is your feature request related to a problem? Please describe.
Python strings don't have 2 distinct data types like SQL Server (which has (var)char and n(var)char); you define a string with single quotes (') or double quote (") and they have the same inferred data type. This poses a problem with SQL Server parameters as the "safer" option is to assume the string is an nvarchar, however, this causes problems with SARGability as if the column the parameter is compared to is varchar, at the column must be implicitly converted and thus can result in (significant) performance issues due to indexes not being about to be used for seek operations.
For those using UTF-8 collations, this could be even more of a "gotcha", as UTF-8 and UTF-16 will support the same characters (unlike Windows-1252, for example, which only supports 1 byte characters), but varchar values would be UTF-8 while nvarchar UTF-16. Many users are likely writing their Python files in UTF-8 so the strings they see are also UTF-8; if they are using a UTF-8 collated database then one would assume they would want varchar parameters, not nvarchar, as it's unlikely they would be using any nvarchar columns.
Describe the solution you'd like
Provide type objects and constructors for both varchar and nvarchar datatypes. This might copy types found else where, such as the String and WString ("Wide String") objects/constructors.
Describe alternatives you've considered
The alternative is that developers would need to be explicit and CAST/CONVERT the value to a varchar in the appropriate clause(s); i.e. MyColumn = CONVERT(varchar(30), ?). Otherwise they could assign the parameter to a variable first: DECLARE @MyColumn varchar(30) = ?;. This, however, might look odd if the query has to be ported to a different language that doesn't use inferred data types, and is likely to be less obvious to do to the "inexperience" developer.
- Lenguaje dominante
- Python
- Estrellas
- 478
- Forks
- 62
- Merge medio
- 3 d 19 min
- PR fusionados (30 d)
- 28
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de microsoft/mssql-python
-
area: bulk-copy triage needed
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
microsoft/mssql-python#843 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
triage needed
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
microsoft/mssql-python#846 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
macOS: encrypted connections fail after Homebrew moved the `openssl` alias to `openssl@4`Posiblemente ocupada @bewithgaurav la tomó hace 14 días. Abiertoarea: packaging-platform bug triage needed
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
microsoft/mssql-python#826 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 2 días
-
Announcement: mssql-python is coming to Django through mssql-django 2.0Quizá libre de nuevo @bewithgaurav la tomó hace 41 días y no hay ningún pull request abierto. Abiertoannouncement
microsoft/mssql-python#748 · 1 asignado ·
Los mantenedores suelen responder en 2 días
-
Connection pool can briefly exceed max_size when pooling is disabled under loadPosiblemente ocupada @bewithgaurav la tomó hace 23 días. Abiertoarea: connectivity-auth bug triage done under development
Dificultad 4/5 3-5 días Aptitud para principiantes 62/100
microsoft/mssql-python#746 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 2 días
Todos los issues de microsoft/mssql-python
Issues similares
-
customer-reported question
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Azure/azure-sdk-for-python#49548 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
btclib-org/btclib-wallet#409 ·
Los mantenedores suelen responder en 1 día
-
Phase 2 PSA Capability & Career Profile
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
bcgov/digital-journeys#2310 ·
-
bug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
fastmachinelearning/hls4ml#1582 ·
Los mantenedores suelen responder en 3 días
-
Sort modelsAbiertoenhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día