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

prepare command is not implemented #495

Open
dragonemp opened this issue Jul 27, 2022 · 1 comment
Open

prepare command is not implemented #495

dragonemp opened this issue Jul 27, 2022 · 1 comment
Assignees
Labels
feature status-triage_done Initial triage done, will be further handled by the driver team

Comments

@dragonemp
Copy link

Issue description

using parameter and prepare is usually the best way to avoid sql injection. but when i try to call command.prepare(), i'm getting not implemented exception

Example code

var param = cmd.CreateParameter();
param.ParameterName = "nameQuery";
param.DbType = DbType.String;
param.Value = model.Query;
cmd.Parameters.Add(param);
...
cmd.CommandText = $"{sql}";
cmd.Prepare();
reader = cmd.ExecuteReader();

Error log

{System.NotImplementedException: The method or operation is not implemented.
   at Snowflake.Data.Client.SnowflakeDbCommand.Prepare()
   at Integrate.Reports.Service.SnowflakeCalls.GetAccountList(AccountListRequestModel model) in /app/Integrate.Reports.Service/Snowflake.cs:line 102
   at Integrate.Reports.Gateway.ReportsModuleController.GetAccountList(AccountListRequestModel model) in /app/Integrate.Reports.Gateway/ModuleControllers/ReportsModuleController.cs:line 500
   at Integrate.Reports.ReportsModuleV2.<.ctor>b__3_3(Object context, CancellationToken cancel) in /app/Integrate.Reports.Gateway/Modules/ReportsModuleV2.cs:line 122}

There is an example in READMD.md file showing you how to enable logging.

Configuration

*Driver version: 2.0.15

*Dotnet framework and version: .net core 3.1

Server version: E.g. 1.90.1
You may get the server version by running a query:

SELECT CURRENT_VERSION();

Client OS: E.g. Debian 8.1 (Jessie), Windows 10

@sfc-gh-dszmolka sfc-gh-dszmolka self-assigned this Jun 8, 2023
@sfc-gh-dszmolka sfc-gh-dszmolka added the status-triage Issue is under initial triage label Jun 8, 2023
@sfc-gh-dszmolka
Copy link
Contributor

hello and thank you for raising this issue. apologies for the long period without response. Prepare() is indeed not implemented even in the latest version of the driver, so we'll take a look.

@sfc-gh-dszmolka sfc-gh-dszmolka removed the status-triage Issue is under initial triage label Jun 8, 2023
@sfc-gh-dszmolka sfc-gh-dszmolka added the status-triage_done Initial triage done, will be further handled by the driver team label Feb 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature status-triage_done Initial triage done, will be further handled by the driver team
Projects
None yet
Development

No branches or pull requests

4 participants