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.

lack of support for non-primitive primary keys

See original GitHub issue

I’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:open
  • Created 8 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ricardogracacommented, Feb 15, 2016

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.

0reactions
adnanonercommented, Nov 4, 2016

@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.

Read more comments on GitHub >

github_iconTop 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 >

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