question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't query table with optional key

See original GitHub issue

Hi guys,

I’m trying to query following statement.

let enmsSichtKstEnergiezentrale = table<EnmsSicht_KstEnergiezentrale>
let enmsSichtKstErzeuger = table<EnmsSicht_KstErzeuger>
let! plants =
                select {
                    for ez in enmsSichtKstEnergiezentrale do
                    join erz in enmsSichtKstErzeuger on (ez.KstStelle = erz.USER_KstUebergeordnet.Value)
                    orderBy ez.KstStelle
                }
                |> conn.SelectAsync<EnmsSicht_KstEnergiezentrale,EnmsSicht_KstErzeuger>

Sadly I run into following error: Could not get data "The given key was not present in the dictionary."

I have to join on a optional key. In this case erz.USER_KstUebergeordnet.Value.

Do you guys have an idea what could be the reason for that error message?

Thanks,

Tim

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
JordanMarrcommented, May 26, 2021

Incoming PR…

0reactions
JordanMarrcommented, May 27, 2021

FYI, I just checked and groupBy worked fine with option types (I added a new unit test to make sure). So no other fix is needed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

I can't query a table without primary key
I'm trying to query through a model in Django that has no Primary Key . I need to query though it so I...
Read more >
Not being able to query non-materialized tables should be ...
I just can't find another way to create a mat table with rekeyed topic. Ultimately, I would want a join by a foreign...
Read more >
Can't add a foreign key constraint in a table on Postgresql
A foreign key constraint specifies that the values in a column ... Adding foreign key is not mandatory and you can do every...
Read more >
Query partitioned tables | BigQuery
The key to address a range partition is the start of the range. ... Cannot query over table 'project_id.dataset.table' without a filter that...
Read more >
Add or change a table's primary key in Access
To set a table's primary key, open the table in Design view. Select the field (or fields) that you want to use, and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found