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] Add primary key to DB tables

See original GitHub issue

Feature Area

/area backend

What feature would you like to see?

That kfp create its database with a primary key (probably here and here, with something like:

DefaultExperimentId string `gorm:"column:DefaultExperimentId; not null; primary key"`

What is the use case or pain point?

Primary keys are required for group replication (high availability) of tables in mysql. Enabling this would enable using more resilient data storage.

Is there a workaround currently?

I don’t know if this is safe, but perhaps I can separately create the database following kfp’s schema (but with a primary key) and then have kfp connect to that existing DB? I’m not sure what the consequences of this would be.

update: This appears to work (application starts without errors, etc). Haven’t stress tested it yet


Love this idea? Give it a 👍. We prioritize fulfilling features with the most 👍.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
chensuncommented, Jul 26, 2022

@Linchin given the two PRs are identical, I’d suggest we give credit to @shayancanonical and merge the PR that was created first. It’s also our responsibility to actively monitor and review PRs from community contributors.

@shayancanonical a small tip to do avoid duplicate effort in the future: while you have “Fixes issue#” in the PR title which can close the issue upon PR merged, only when you have the same text in the PR description or comment section, the open PR will then be linked to the issue, so that those who look at the issue can easily see there’s a proposed fix already.

1reaction
Linchincommented, Jul 22, 2022

I see. I will go ahead and create a PR for this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create Primary Keys in SQL Server - Microsoft Learn
In Table Designer, click the row selector for the database column you want to define as the primary key. If you want to...
Read more >
How to Create Primary Keys for MySQL Database Tables
How to Manually Add a Primary Key ; SHOW CREATE TABLE your_database_name. ; ALTER TABLE your_table_name ADD PRIMARY ; ALTER TABLE car ADD...
Read more >
Adding primary key to some exising tables in a database
1. loop through all tables · 2. select ones that do not have primary keys · 3. add an auto incremented field ·...
Read more >
MySQL Add Primary Key to MySQL Database Tables via the ...
Information on how to add primary keys to MySQL database tables using the MySQL Alter Table Add Primary Key command.
Read more >
Creating Tables with a Primary Key in SQL - YouTube
You can apply rules or constraints to your database table when you create it with CREATE TABLE, or later on with ALTER TABLE.The...
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