forked from simendsjo/mysqln
-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
queryValue returns a Nullable!Variant. Let's say it returns a long (In my case, I was querying a COUNT(*) to get the total rows)
My code I put was:
auto total = conn.queryValue("select count(*) from ...").get!longBut this doesn't work, because Nullable intercepts the get call! So instead I have to do:
auto total = conn.queryValue("select count(*) from ...").get.get!longWhich IMO is ugly and annoying. Really this is an issue with Nullable and Variant reusing the same member name, but I doubt that will change.
Is it possible to instead specify the type to queryValue itself, and have it return a Nullable!T? something like:
// no need for get here, I know I'm going to get a value
long total = conn.queryValue!long("select count(*) from ...");Metadata
Metadata
Assignees
Labels
No labels