It has been a puzzle. Sometimes fun, sometimes frustrating. I have been solving this gradually when I have had time. For a while I was stuck at exactly the same place where Npgsql also fails (tried with v2.2.7 and v4.0.7). NpgsqlConnection.GetSchema("DataSourceInformation", { }); //OK NpgsqlConnection.GetSchema("Tables", { }); //OK NpgsqlConnection.GetSchema("Views", { }); //OK NpgsqlConnection.GetSchema("Columns", { "", "myschema", "mytable"}); //Invalid value (null) 
My diagnosis: M9 does not recognise Npgsql's response to GetSchema("Columns", ... At first I followed https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/sql-server-schema-collections My errors were the same as above. Then I modified the GetSchema("Columns") response to mirror GetSchemaTable (https://docs.microsoft.com/en-us/dotnet/api/system.data.datatablereader.getschematable?view=netframework-4.7.2) That seemes to work somewhat. Now M9 asks for Indexes. DummyConnection.GetSchema("DataSourceInformation", { }); //OK DummyConnection.GetSchema("Tables", { }); //OK DummyConnection.GetSchema("Views", { }); //OK DummyConnection.GetSchema("Columns", { "", "DummySchema", "DummyTable"}); //OK DummyConnection.GetSchema("Indexes", { "", "DummySchema", "DummyTable"}); //Invalid value (null), if not empty I can return empty table of indexes. Then I do not get any error, but schema and table windows remain empty. 
Then these commands get created and called ExecuteDbDataReader : SELECT COUNT(*) FROM "DummySchema"."DummyTable" SELECT 0 FROM "DummySchema"."DummyTable" I think, I correctly fake these results. Then I expect, but do not see a command: SELECT * FROM "DummySchema"."DummyTable" I'm out of ideas how to proceed. Should I even bother (ADO.NET is dead)? I wanted to create an "adapter" that would work with M9 Viewer also. Now I feel that it may be pointless and if I really need it, then an "importer" that reads a file and creates M9 tables directly is more sane approach. Attachments:
DummyTable.PNG
emptySchema.PNG
invalid_value_null.PNG
|