Skip to content
New issue

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

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

Already on GitHub? # to your account

Feature request: ExecuteScalar<T> and ExecuteScalarAsync<T> #32

Closed
tsanton opened this issue Dec 21, 2022 · 2 comments
Closed

Feature request: ExecuteScalar<T> and ExecuteScalarAsync<T> #32

tsanton opened this issue Dec 21, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@tsanton
Copy link

tsanton commented Dec 21, 2022

Hi,

First of all; great client!
I'm wondering if you would consider altering the ExecuteScalars to accept a generic of type string, int, double, bool etc..?
Typical usages will be select count(1) and the like^^

Will make the code look cleaner if we could remove the type casting.

Wouldn't mind having a crack at it if you're pressed for time.

Speak soon!

/T

@fixer-m fixer-m added the enhancement New feature or request label Dec 28, 2022
@fixer-m
Copy link
Owner

fixer-m commented Jan 1, 2023

@tsanton Hi!
Thanks, that's a nice improvement. This is implemented now in 0.4.4. Commit: ebac54f

@fixer-m
Copy link
Owner

fixer-m commented Jan 13, 2023

So there is a new public API method ExecuteScalarAsync which can be used like this:

var result = await _snowflakeClient.ExecuteScalarAsync<int>("SELECT 1;");
Assert.AreEqual(1, result);

Don't forget to specify correct C# type according to Snowflake value type.

Closing this.

@fixer-m fixer-m closed this as completed Jan 13, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants