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.

Change the PK field

See original GitHub issue

Is your feature request related to a problem? Please describe. The PK on the APIKey model is the string containing the prefix and hash. This makes it challenging to work with when referencing it in URLs in many REST-based frameworks. eg. 2TothlA4.pbkdf2_sha256$36000$dfPh6LIy7NB3$FTA61Pvuq3gres5ZsclXimNCRz70jvDRl/ygYOjEiLc=. This contains a slash and other special chars that would typically be URL encoded.

Describe the solution you’d like Either convert the model to use a standard integer PK or provide some other means to reference it in such a way

Describe alternatives you’ve considered I’m not sure, but could this be handled through the solution being considered for #34?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
curtismortecommented, Jun 7, 2019

@eagle-r, It’s a bad idea to pass an API Key in a URL. You’re essentially exposing your API Key.

With your reference to #34, that’s a solution. However, I think it’s actually a poor fix for the actual problem.

@florimondmanca, we need to normalize the table to have a generic based integer PK. With the completion of #34, those who need to change the PK to some other form of ID, say a UUID, will have the flexibility to do so.

1reaction
curtismortecommented, Jun 7, 2019

@eagle-r and @florimondmanca, In my opinion, while this is technically not a bug and is more of a feature enhancement, the issue should be considered with the same level of priority as a bug.

Using a Model View Set requires a PK. The current PK we have is not a valid form of PK.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Change Primary Key Column in SQL Server - GeeksforGeeks
Syntax: Alter table table_name add primary key (column_name); To change the Primary key column in the SQL Server, follow these steps: Drop ...
Read more >
ALTER PRIMARY KEY | CockroachDB Docs
The ALTER PRIMARY KEY statement is a subcommand of ALTER TABLE that can be used to change the primary key of a table....
Read more >
Modify Primary Keys - SQL Server | Microsoft Learn
Open the Table Designer for the table whose primary key you want to modify, right-click in the Table Designer, and choose Indexes/Keys from...
Read more >
SQL PRIMARY KEY Constraint - W3Schools
The PRIMARY KEY constraint uniquely identifies each record in a table. ... this primary key can consist of single or multiple columns (fields)....
Read more >
Change primary key column in SQL Server - Stack Overflow
Make sure there are no NULLs in that column for any row · Set the column to not allow NULLs · Add 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