Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Determine DATETIME2 precision based on parameter description #793

Open
detule opened this issue Apr 23, 2024 · 0 comments
Open

Determine DATETIME2 precision based on parameter description #793

detule opened this issue Apr 23, 2024 · 0 comments
Labels
feature a feature request or enhancement mssql Microsoft SQL Server

Comments

@detule
Copy link
Collaborator

detule commented Apr 23, 2024

Related to: #790 #208 #130

When writing to a datetime/datetime2 target, we use a fixed precision of three decimals to avoid needing to know the user-configurable precision of the datetime2 field.

However, when writing, we attempt to discover the target table column descriptions and pass these down to nanodbc via statement::describe_parameters. We do this to avoid (nanodbc) needing to call SQLDescribeParams for each of the individual columns/parameters when binding the data buffers.

If we already have the column descriptions, we could have nanodbc::statement expose these - see for example nanodbc::statement::parameter_size(int) that already does something similar. Then we can use this API endpoint in odbc_result to maybe deduce the parameter precision.

@detule detule added feature a feature request or enhancement mssql Microsoft SQL Server labels Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement mssql Microsoft SQL Server
Projects
None yet
Development

No branches or pull requests

1 participant