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.

[Feature Request] List tables without primary key

See original GitHub issue

Tables without a primary key don’t show up in the Select Tables to Script dialog. There’s no further reason specified why the table isn’t in the dialog, even though the database projects builds fine.

Suggestion: List the tables without primary key in the dialoge, but make the checkbox unchecked and disable the control, with a note showing behind the table that the primary key is missing.

Steps to reproduce

Example: MissingTableConsole.zip

  1. Open attached solution
  2. Right-click on the MissingTableConsole project
  3. EF Core Power Tools --> Reverse Engineer
  4. Select MissingTableDatabase in the DacPac drop-down
  5. Table config.Message is not showing up

Further technical details

EF Core Power Tools version: 1.0.664.0

Database engine: None (DacPac)

Visual Studio version: Visual Studio 2017 15.8.7

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
ErikEJcommented, Oct 24, 2018

I would pick this, if you’re okay with the suggestion.

Sounds fantastic! Keep in mind, that ideally we should do the same for SQL Compact and NpgSQL (and SQL Server databases)

why the check is for .Where(t => t.PrimaryKeyConstraints.Count() > 0) instead of == 1?

Maybe in order to accomodate multi column primary keys?

0reactions
ErikEJcommented, Nov 4, 2018

I prefer to avoid that dependency (Json.net) when running under VS.

Better to keep the Tables property, but ignore the value in code. (So break, but not fail)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Feature #12598: Investigate and remediate database ...
The first step will be to analyze a list of tables without primary keys. While there are hundreds of tables without primary keys,...
Read more >
Finding MySQL Tables with no primary key OR no ...
The first will show you all constraints, and the second all tables. Any table which is in tables, but not in constraints, has...
Read more >
Feature request - Edit data and tables without a primary key
Hello, I have a feature request for the 'Edit data' window that is available for each table in pgAdmin. As the OID column...
Read more >
How to define a table without primary key with SQLAlchemy?
Oracle databases secretly store something called rowid to uniquely define each record in a table, even if the table doesn't have a primary...
Read more >
Find tables without primary keys (PKs) in SQL Server ...
Below is a list of tables in Microsoft System Center Configuration Manager database without primary keys. Is that a lot? Check out here....
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