Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_id column when working with external SQL DB has encoded id value #14885

Closed
poirazis opened this issue Oct 28, 2024 · 2 comments
Closed

_id column when working with external SQL DB has encoded id value #14885

poirazis opened this issue Oct 28, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@poirazis
Copy link
Contributor

When you query a table that is an external sql table, you always get back a column "_id" ammended, but the value in that column is not the value of the id, but rather a string encoded. So , if you attemp to update / delete record using that "_id" added column, the operation will fail as that column doesnt actually exist nor the value in it represents the actual id.

This ammended column, also appears in the "field" property types, to be selected.
Screenshot 2024-10-28 at 2 43 11 PM

Screenshot 2024-10-28 at 2 30 55 PM

Is this ammeded column necessary ?
If it is, shouldnt it be holding the same value as the id column ?

@poirazis poirazis added the bug Something isn't working label Oct 28, 2024
Copy link

linear bot commented Oct 28, 2024

@mike12345567
Copy link
Collaborator

Hi @poirazis - this is intended functionality - Budibase needs the _id field to be completely unique, in the case of tables with composite primary keys the only real way to handle this is encoding the contents into a consistent format that we can understand.

Having multiple formats for this can be quite tricky, so we decided that we should always encode it to follow a consistent format that we can expect no matter if the table has a composite key or not.

I'm going to close out this issue as a change in this area would be quite dangerous and this is fully intended behaviour - if it is causing a problem in the app building experience, please let us know with an enhancement request around the behaviour that it is causing issues with!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants