Skip to content

Commit

Permalink
Ubik v3.19 Provide a nice error message when there is no connection s…
Browse files Browse the repository at this point in the history
…tring file or environment variable
  • Loading branch information
Zaid-Ajaj committed Dec 6, 2020
1 parent 385311d commit e062319
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/Ubik/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ let analyzeFiles (fsharpFiles: FilePath[]) =
let messages =
let connectionString = SqlAnalyzer.tryFindConnectionString context.FileName
if isNull connectionString || String.IsNullOrWhiteSpace connectionString then
[ ]
[
for block in syntacticBlocks ->
SqlAnalysis.createWarning "Missing environment variable 'NPGSQL_FSHARP'. Please set that variable to the connection string of your development database or put the connection string in a file called 'NPGSQL_FSHARP' next to your project file or in your workspace root." block.range
]
else
match SqlAnalysis.databaseSchema connectionString with
| Result.Error connectionError ->
Expand Down
4 changes: 2 additions & 2 deletions src/Ubik/Ubik.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<PackAsTool>true</PackAsTool>
<IsPackable>true</IsPackable>
<RollForward>Major</RollForward>
<Version>3.18.0</Version>
<PackageReleaseNotes>Initial release of Ubik</PackageReleaseNotes>
<Version>3.19.0</Version>
<PackageReleaseNotes>Provide a nice error message when there is no connection string file or environment variable</PackageReleaseNotes>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit e062319

Please sign in to comment.