Closed theta3 closed 1 year ago
You should post questions about ServerSymbolLoader on the repo that is from: https://github.com/mattwar/Kusto.Toolkit
There are steps published in the Kusto.Toolkit readme about using the ServerSymbolLoader and dealing with queries that also reference other databases using the SymbolResolver class.
To answer your question, GlobalState does support declaring multiple clusters and multiple databases per cluster. However, it looks like you used the ServerSymbolLoader to load the database symbols independently of the global state and then added them as the default cluster to the global state. This is okay, but you also need to tell the GlobalState which database is the default database using the GlobalState.WithDatabase() method. This step is skipped when you use the loader's AddOrUpdateDefaultDatabase() method. It both loads the database and sets it as the default for you.
Thank you so much! After following the examples here https://github.com/mattwar/Kusto.Toolkit/blob/master/src/Toolkit/docs/SymbolResolver.md. I was able to get it to work.
The reason I posted the issue here and not in the Toolkit
repo was because I thought I have constructed the Symbols correctly and the issue was with either GlobalState
or ParseAndAnalyze
which is in this repo
I use
ServerSymbolLoader
and callLoadDatabaseAsync()
to createDatabaseSymbol
for all the databases. Then createHowever, when I call
var result = KustoCode.ParseAndAnalyze(func, knownGlobalState).GetDiagnostics();
, there is errorKS208: The name 'otherdatabase' does not refer to any known database
Does
GlobalState
support multiple databases? Did I miss some steps?