diff --git a/sql-odbc/src/PowerBIConnector/SqlOdbcPBIConnector.mproj b/sql-odbc/src/PowerBIConnector/SqlOdbcPBIConnector.mproj index b2b177c461f..53dff961de6 100644 --- a/sql-odbc/src/PowerBIConnector/SqlOdbcPBIConnector.mproj +++ b/sql-odbc/src/PowerBIConnector/SqlOdbcPBIConnector.mproj @@ -98,6 +98,8 @@ archiveOut.CreateEntryFromFile(fullPath, filename, CompressionLevel.Optimal); } } + + File.Copy(OutputFile, Path.Combine(Environment.GetEnvironmentVariable("USERPROFILE"), @"Documents\Power BI Desktop\Custom Connectors", Path.GetFileName(OutputFile)), true); ]]> diff --git a/sql-odbc/src/PowerBIConnector/SqlOdbcPBIConnector.pq b/sql-odbc/src/PowerBIConnector/SqlOdbcPBIConnector.pq index ba10c39e494..0a4bbf09eb4 100644 --- a/sql-odbc/src/PowerBIConnector/SqlOdbcPBIConnector.pq +++ b/sql-odbc/src/PowerBIConnector/SqlOdbcPBIConnector.pq @@ -106,8 +106,8 @@ SqlOdbcPBIConnectorImpl = (Server as text) as table => SupportsOdbcTimestampLiterals = true ]), - OdbcDatasource = Odbc.DataSource(ConnectionString & CredentialConnectionString & EncryptedConnectionString, [ - // Do not view the tables grouped by their schema names. + OdbcOptions = [ + // Do not view the tables grouped by their schema names. HierarchicalNavigation = false, // Prevents execution of native SQL statements. Extensions should set this to true. HideNativeQuery = true, @@ -129,7 +129,11 @@ SqlOdbcPBIConnectorImpl = (Server as text) as table => // Connection string properties used for encrypted connections. CredentialConnectionString = EncryptedConnectionString - ]) + ], + + FullConnectionString = Diagnostics.LogValue("Connection String", ConnectionString & CredentialConnectionString & EncryptedConnectionString), + + OdbcDatasource = Odbc.DataSource(FullConnectionString, OdbcOptions) in OdbcDatasource; @@ -206,7 +210,7 @@ SqlOdbcPBIConnector.Publish = [ LearnMoreUrl = "https://www.opensearch.org/", // Disabling direct query due to limited SQL query support - SupportsDirectQuery = false, + SupportsDirectQuery = true, SourceImage = SqlOdbcPBIConnector.Icons, SourceTypeImage = SqlOdbcPBIConnector.Icons diff --git a/sql-odbc/src/PowerBIConnector/SqlOdbcPBIConnector.query.pq b/sql-odbc/src/PowerBIConnector/SqlOdbcPBIConnector.query.pq index bde4c98a34e..e2254d231af 100644 --- a/sql-odbc/src/PowerBIConnector/SqlOdbcPBIConnector.query.pq +++ b/sql-odbc/src/PowerBIConnector/SqlOdbcPBIConnector.query.pq @@ -4,18 +4,27 @@ section SqlOdbcPBIConnector.UnitTests; shared MyExtension.UnitTest = [ // Common variables for all tests - Host = "localhost", - Port = 9200, + Host = "localhost:9200", facts = { Fact("Connection Test", 7, let - Source = SqlOdbcPBIConnector.Contents(Host,Port), + Source = SqlOdbcPBIConnector.Contents(Host), no_of_columns = Table.ColumnCount(Source) in no_of_columns + ), + Fact("calcs_data:bool0", + #table(type table [bool0 = logical], + { {null}, {false}, {true} }), + let + Source = SqlOdbcPBIConnector.Contents(Host), + calcs_null_null = Source{[Item="calcs",Schema=null,Catalog=null]}[Data], + grouped = Table.Group(calcs_null_null, {"bool0"}, {}) + in + grouped ) }, @@ -33,11 +42,13 @@ Fact = (_subject as text, _expected, _actual) as record => resultOp = if result = "Success ✓" then " = " else " <> ", addendumEvalAttempt = if attempt[HasError] then @ValueToText(attempt[Error]) else "", addendumEvalExpected = try @ValueToText(safeExpected) otherwise "...", - addendumEvalActual = try @ValueToText (safeActual) otherwise "...", + addendumEvalActual = try @ValueToText(safeActual) otherwise "...", + ShortenedAddendumEvalExpected = if Text.Length(addendumEvalExpected) > 20 then Text.Range(addendumEvalExpected, 0, 20) & "..." else addendumEvalExpected, + ShortenedAddendumEvalActual = if Text.Length(addendumEvalActual) > 20 then Text.Range(addendumEvalActual, 0, 20) & "..." else addendumEvalActual, fact = - [ Result = result &" "& addendumEvalAttempt, + [ Result = result & " " & addendumEvalAttempt, Notes =_subject, - Details = " ("& addendumEvalExpected & resultOp & addendumEvalActual &")" + Details = ShortenedAddendumEvalExpected & resultOp & ShortenedAddendumEvalActual ] ][fact]; diff --git a/sql-odbc/src/PowerBIConnector/bin/Release/SqlOdbcPBIConnector.mez b/sql-odbc/src/PowerBIConnector/bin/Release/SqlOdbcPBIConnector.mez index 2dc7d88dde0..e830c80222d 100644 Binary files a/sql-odbc/src/PowerBIConnector/bin/Release/SqlOdbcPBIConnector.mez and b/sql-odbc/src/PowerBIConnector/bin/Release/SqlOdbcPBIConnector.mez differ