-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
V2 API refactors #1293
Comments
heh, turns out we've already started this here - but: always good to get another round of input! |
Feels like there might be some value in keeping a I, of course, am tempted to want the |
That's actually very relevant, @kevin-montrose - because we could also take the opportunity to clarify buffered Vs non-buffered. Buffered => |
There are many times where my method's return type is |
@jnm2 we'd still have a non-buffered API - it would just be more explicit in the naming; in your case, you'd presumably just write an extension method that wraps that up for you? |
That sounds good. |
Don't know if it's the correct place, but not having the TypeMapper a singleton would be very helpful. The current behavior doesn't allow your application to be connected to two different databases at the same time. |
@vdaron valid observation, but not quite sure what that would look like in terms of usage; presumably we'd need some kind of config state, so is that an argument? or a source? i.e. is it var data = connection.Query<T>("...", ... , someConfigArg: configParam); or is it: var data = config.Query<T>(connection, "...", ... ); or is it something else? I think that's a valid discussion, but probably one to split out separately. If there is a case to add it as a parameter, for example, that would be better done "sooner" than "later". |
In terms of usage, I would prefer the first one. One other option would be to have a DapperConnection inheriting from IDbConnection and encapsulating a DbConnection , but it's probably a little too much :-) |
My concern there is that a lot of apps allocate lots of connections, which makes that - well, not impossible, but perhaps undesirable. |
So v2 is going to have to happen at some point; we will want to do as much as we can at one "break", so: thoughts here:
Virtually definite
IDbConnection
etc toDbConnection
for the async methodsCancellationToken
is used on all async methodsnetstandard1.3
SqlClient
dependency (need to fix one API only)Virtually definite (additive; not a break)
IAsyncEnumerable<T>
APIMaybe
IDbConnection
etc toDbConnection
throughoutTask<T>
toValueTask<T>
throughoutQueryAsync<T>
API toIAsyncEnumerable<T>
(wasTask<IEnumerable<T>>
)Maybe (additive; not a break)
netcoreapp3.0
and review what we can exploitWouldn't rule it out (somewhere between "maybe" and "nope")
PooledAwait
(internal implementation detail, but adds a dependency; works best withValueTask<T>
, but can have benefits onTask<T>
too)other ideas?
The text was updated successfully, but these errors were encountered: