DataAction / AdoNetCore.AseClient

AdoNetCore.AseClient - a .NET Core DB Provider for SAP ASE
Apache License 2.0
106 stars 44 forks source link

[linq2db] DbConnection.GetSchema API support #52

Open MaceWindu opened 6 years ago

MaceWindu commented 6 years ago

Right now this API is not implemented and throws NotSupportedException from base class.

linq2db use following schema tables for ASE:

for other metadata we query system tables directly.

Why this feature is important for linq2db - schema provider used to generate data model from database using T4 templates.

Another important thing is support for CommandBehavior.SchemaOnly for procedures. Native provider (or in worst case ASE itself) has bug in this area, where it executes procedure for real which is very bad. See https://github.com/linq2db/linq2db/issues/792. We fixed it for native provider on our side by wrapping such calls in transactions with rollback.

linq2db test: SchemaProviderTest.IncludeExcludeCatalogTest

MaceWindu commented 6 years ago

I would say, it has lower priority compared to bugs, as we can try to replace those calls on our side with queries to system tables for time being

senseibaka commented 6 years ago

@MaceWindu - On your point about CommandBehaviour.SchemaOnly and using a transaction to work around the SAP driver's bug, ASE does have support for getting a procedure's (or any command's) schema via SET FMTONLY [ON|OFF]

senseibaka commented 6 years ago

Also, it might be a while before DbConnection.GetSchema is implemented completely. However, if all you rely on is DataTypes, Procedures, and ProcedureParameters then we could push out a partial implementation...

MaceWindu commented 6 years ago

Thanks for fmtonly, will try it later, if it works, it meant that native provider doesn't set it...

As for API, as I said - we can workaround it on our side, so no rush here

MaceWindu commented 6 years ago

FYI, this API is not required for linq2db anymore, as I implemented required functionality on our side. So if nobody else needs it ATM, you can postpone it