-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Add IColumnModification and IModificationCommand to allow the implementations to be replaced easily #12169
Comments
What I have right now: I override RelationalCommand::CreateCommand method and build all parameters of command.
So generation of OUT-parameters it is not problem. The problem in the OUT-parameter value processing after executing the command. Could you point me - what I should override for processing OUT-parameters values? |
@dmitry-lipetsk |
Seem, you are right. I think, need:
One moment. ConsumeResultSetWithPropagation obtaines the RelationalDataReader. This class contains the reference to command object, but not allow to access it from outside. |
I rewrited ConsumeResultSetWithPropagation and get expected behaviour. Prototype:
I think, this ticket can be closed. One small suggestion for EFCore - add to RelationalDataReader the public property:
Or I should create my own class based on RelationalDataReader? |
I seem understood why your CoreEF provider uses EXECUTE BLOCK in AppendUpdateOperation and AppendDeleteOperation :) |
I'm going to an event ... when I return I can pass on some information and experiences that I already had with Efcore + Firebird |
Original idea - usage OUT-parameters instead DataReader is good from perfomance point of view. But has the some problems. ColumnModification::set_Value requires exact type of data. This type defined in ColumnModification::Property::ClrType, if I understood correctly. I should transform DbParameter.Value to this type. Otherwise I get an error like "Message: System.InvalidCastException : Unable to cast object of type 'System.Int16' to type 'System.Nullable`1[System.Int32]'." Stack:
Need upgrade ColumnModification::set_Value (or added new Method) for transformation of "generic" value to required ClrType. Or need create this code byself in my data provider :( |
New property RelationalDataReader::DbCommand allow to read OUTPUT-parameters of modification commands (INSERT, UPDATE). It used from ConsumeResultSetWithPropagation method.
New property RelationalDataReader::DbCommand allow to read OUTPUT-parameters of modification commands (INSERT, UPDATE). It used from ConsumeResultSetWithPropagation method.
@dmitry-lipetsk For full support for update commands with output parameters in EF you'd need to add something like |
Remaining work tracked in #21433 |
EF Core version: dev
My implementation of AppendInsertOperation generates following SQL text:
INSERT INTO "DECI" ("D_6_1") VALUES (:p0) RETURNING "TEST_ID" INTO :p1;
Where
"p0" - (input) parameter from writeOperations
"p1" - (output) parameter from readOperations
My data provider returns values of OUT-parameters through parameters object, not through DataReader.
So, For this query ExecuteReader returns "empty" DataReader, without columns.
EntityFrameworkCore returns the error
Question: In theory, it is possible override EFCore classes for support OUT-parameters?
The text was updated successfully, but these errors were encountered: