Open jkone27 opened 3 years ago
Hi there @jkone27 thanks for filing the issue. My initial thoughts is that the analyser isn't able to detect the referenced query using the fully qualified name Queries.getArticles. can you try just getArticles without the full module? Or simply use an inline query string to see If that fixes the issue?
I will give this a try later and will let you know how it goes
You can also use triple quotes when writing multi-line SQL queries without having to all \n to each line
Tried your suggestions but I still was unlucky.. no error for non existing x column
The issue is related to nested modules in FSI
when there is nested modules, either in the same module or in an external module, query string resolution doesn't seem to work
Proposed solution is enhance the way we are detecting the literal queries: traverse the AST and detect this pattern
[<Literal>]
let query = "<SQL>"
while keeping track of the original module, so
module Queries =
let [<Literal> getFiles = "SELECT * FROM films"
Should keep track of the fact that getFiles
is coming from Queries
etc. The same should hold for deeply nested queries too
Since this is quite difficult to implement, it is easier to just not use nested modules in fsx queries and to keep things simple
Describe the bug I followed the setup for the analyzer in ionide, windows 10 and net5, but I cannot make it work...
if i change the db name the analyzer complains, so he is alive (?) but he cannot check issues with db columns...![image](https://user-images.githubusercontent.com/10419217/120896194-c6b5fa00-c620-11eb-8f71-8250e943bd53.png)
in postgres i then run this
i installed pgsql analyzer (see sql errors at edit time) at root of where the .fsx file is
and the NPGSQL_FSHARP file (which seems to work as wrong connection triggers)
i also tried to run Ubik on the file, but it reports no error, while the column name x does not exist in practice.
To Reproduce
Expected behavior Should underline the non existing column X and give a warning
Screenshots
Desktop (please complete the following information):