lack of support for non-primitive primary keys
See original GitHub issueI’m using uuids as primary keys, so they are stored in db as binary and in models as Buffer
. I’ve overridden set()
and toJSON()
of the base model methods and it made it somewhat working, however there are still some bits of logic (especially in collections and maybe in relations) related to primary key comparison that basically does if(id === someOtherId)
under the hood which obviously fails for Buffer
keys.
Is there a plan on getting those bits fixed?
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Developers - lack of support for non-primitive primary keys -
I'm using uuids as primary keys, so they are stored in db as binary and in models as Buffer . I've overridden set()...
Read more >Composite primary key with not primitive attributes
I've got problem with composite key. I am trying to do something like that: @Entity class A { @Id int id; } @Entity...
Read more >Error conditions in Azure Databricks - Microsoft Learn
Databricks Runtime and Databricks SQL; Delta Lake; Autoloader ... Foreign key parent columns do not match primary key child columns .
Read more >Achievements and Weaknesses of Object-Oriented Databases
In this section we will discuss some of the achievements of OODBs so far: OODBs allow users to define abstractions, facilitate the development...
Read more >Handbook - Basic Types - TypeScript
In TypeScript, we support the same types as you would expect in ... object is a type that represents the non-primitive type, i.e....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes, there’s #552, but I don’t think there’s any talk about that particular feature. Composite primary keys are very requested, but you’re actually the first person to request Buffer type primary keys.
I’m not sure it would be easy to implement, particularly when it comes to associations, so given the limited resources and the fact that no one makes any money for this work, it’s very unlikely that it will get implemented by someone that won’t be using that feature.
If it’s just a case of a few comparisons failing you may be able to dig into the source code and implement it yourself. The code is relatively clean, commented and easy to follow nowadays.
@helios1138 do you have an example of how you handle selects in your model? Got the parsing to work but not the selecting and formatting.