frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Choosing a Database Schema for Polymorphic Data (2024)

https://www.dolthub.com/blog/2024-06-25-polymorphic-associations/
14•gm678•4h ago

Comments

acquiesce•1h ago
I wouldn’t do this personally because the downstream code very often has to handle differences where polymorphism breaks and you end up having to query the type. Polymorphism shouldn’t be used for data, only behavior, and only in very specific circumstances. Subclassing is a different topic.
setr•50m ago
You wouldn’t do what? Have polymorphic data to begin with? I don't see how you can choose to avoid the scenario that record A has one of several possible related metadata, other than just ignoring it and allowing invalid representations
hot_gril•1h ago
Definitely don't want to store types as columns in a DB, especially because of the inevitable thing that qualifies as two different types. In this situation, I'd usually take the first one (nullable cols) without much consideration. The DB doesn't need an xor constraint, but it can if you really want. New cols can be added without much impact on existing data.

And if the info is non-scalar, it's either option 2 (nullable FK) or 5 (JSON), depending on whether or not other things join with fields inside it.

I'm a 16-Year-Old Self-Taught Developer – Built 700 Projects

1•RajGuruYadav•3m ago•0 comments

Comparing the Climate and Productivity Impacts of a Shrinking Population

https://www.nber.org/papers/w33932
1•alphabetatango•6m ago•0 comments

LM Studio is free for use at work

https://lmstudio.ai/blog/free-for-work
1•CharlesW•10m ago•0 comments

Huawei Whistleblower Alleges Pangu AI Model Plagiarized from Qwen and DeepSeek

https://github.com/HW-whistleblower/True-Story-of-Pangu
1•zero_kool•19m ago•1 comments

Myth of the Brown Recluse: Fact, Fear, and Loathing

https://spiders.ucr.edu/myth-brown-recluse-fact-fear-and-loathing
2•indigodaddy•22m ago•1 comments

Jagadish Chandra Bose

https://en.wikipedia.org/wiki/Jagadish_Chandra_Bose
2•Bluestein•22m ago•0 comments

Bash-5.3-Release Available

https://lwn.net/Articles/1029079/
2•ossusermivami•24m ago•0 comments

Quick web stack for vanilla JavaScript

https://www.npmjs.com/package/instaserve
1•throwaway20174•32m ago•0 comments

Mattel unveils first Barbie doll with type 1 diabetes

https://www.yahoo.com/news/mattel-unveils-first-barbie-doll-with-type-1-diabetes-we-knew-the-time-was-right-200026414.html
3•hbcondo714•40m ago•1 comments

Convert JSON –> SQL with a handy web tool

https://widgita.xyz/jsonsql
1•fairlight1337•40m ago•1 comments

Digital Superintelligence, Multiplanetary Life, How to Be Useful [video]

https://www.youtube.com/watch?v=cFIlta1GkiE
1•ianrahman•41m ago•0 comments

Is it still worth using jQuery in 2025?

https://waspdev.com/articles/2025-07-07/is-it-still-worth-using-jquery-in-2025
3•freediver•41m ago•0 comments

Phrase origin: Why do we "call" functions?

https://quuxplusone.github.io/blog/2025/04/04/etymology-of-call/
21•todsacerdoti•41m ago•5 comments

Oregon Programming Languages Summer School (OPLSS) 2025: Lectures

https://www.cs.uoregon.edu/research/summerschool/summer25/topics.php
2•matt_d•45m ago•0 comments

Show HN: Piplo helps you stay in touch with the people who matter

https://apps.apple.com/us/app/piplo/id6748089184
1•airpaulg•46m ago•0 comments

Agents Don't Have Agency

https://kconner.com/2025/07/08/agents-dont-have-agency.html
3•todsacerdoti•47m ago•0 comments

The latest threat from the rise of Chinese manufacturing

https://www.technologyreview.com/2025/07/07/1119658/the-latest-threat-from-the-rise-of-chinese-manufacturing/
2•walterbell•52m ago•0 comments

Show HN: A Truth Table Generator Written in Common Lisp

https://logic.manoel.dev/
11•lerax•53m ago•0 comments

Sotheby's selling operational Apple-1 computer handmade by Steve Jobs [video]

https://www.youtube.com/watch?v=XdBKuBhdZwg
1•guiambros•55m ago•0 comments

Ali Amin-Javaheri's Chemical Romance

https://www.sequoiacap.com/article/ali-amin-javaheri-knowde-spotlight/
1•andsoitis•57m ago•0 comments

Historians dispute Bayeux tapestry tally after lengthy debate

https://www.theguardian.com/world/2025/apr/25/bayeux-tapestry-historian-genitalia-dispute
1•colinprince•1h ago•0 comments

Building Neighborhood Communities (2024)

https://supernuclear.substack.com/p/building-neighborhood-communities
2•toomuchtodo•1h ago•1 comments

GitHub navbar is broken for repo URLs when logged out

1•hasithsen•1h ago•0 comments

Where can I see Hokusai's Great Wave today?

https://greatwavetoday.com/
5•colinprince•1h ago•0 comments

Tech Founders Call on Sequoia Capital to Denounce VC Shaun Maguire

https://www.cnbc.com/2025/07/07/founders-sign-letter-to-sequoia-on-shaun-maguires-mamdani-remarks.html
3•nsoonhui•1h ago•3 comments

Shift Happens – A Book About Keyboards

https://shifthappens.site/
1•colinprince•1h ago•0 comments

Free AI Earth Zoom Out: Instantly Create Cinematic Zoom Videos Online

https://aiearthzoomout.com
1•liualexander112•1h ago•1 comments

The MOS 6502 and the Best Layout Guy in the World

https://research.swtch.com/6502
2•signa11•1h ago•0 comments

From Cells to Signals: AI as the Nervous System of Our Digital Organism

https://www.memorly.ai/blog/our-blog-1/from-cells-to-signals-ai-as-the-nervous-system-of-our-digital-organism-27
1•madanram92•1h ago•0 comments

Pocket LLM Server Just Like a Pocket WiFi

2•itstomo•1h ago•0 comments