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/
22•gm678•6h ago

Comments

acquiesce•3h 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•2h 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
IceDane•1h ago
Want to elaborate on how you're going to magically disappear the inherent polymorphism in your problem domain every time?

Sometimes you can indeed view things from a different perspective and come up with a simpler data model, but sometimes you just can't.

hot_gril•2h 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.

4b11b4•1h ago
I learned a lot in a short time, thanks

RapidRAW: A non-destructive and GPU-accelerated RAW image editor

https://github.com/CyberTimon/RapidRAW
95•l8rlump•3h ago•18 comments

Helm local code execution via a malicious chart – CVE-2025-53547

https://github.com/helm/helm/security/advisories/GHSA-557j-xg8c-q2mm
10•irke882•28m ago•0 comments

Where can I see Hokusai's Great Wave today?

https://greatwavetoday.com/
36•colinprince•2h ago•20 comments

Bootstrapping a side project into a profitable seven-figure business

https://projectionlab.com/blog/we-reached-1m-arr-with-zero-funding
419•jonkuipers•1d ago•91 comments

Breaking Git with a carriage return and cloning RCE

https://dgl.cx/2025/07/git-clone-submodule-cve-2025-48384
296•dgl•12h ago•102 comments

Phrase origin: Why do we "call" functions?

https://quuxplusone.github.io/blog/2025/04/04/etymology-of-call/
61•todsacerdoti•2h ago•35 comments

Frame of preference A history of Mac settings, 1984–2004

https://aresluna.org/frame-of-preference/
71•K7PJP•6h ago•13 comments

Supabase MCP can leak your entire SQL database

https://www.generalanalysis.com/blog/supabase-mcp-blog
663•rexpository•12h ago•335 comments

Smollm3: Smol, multilingual, long-context reasoner LLM

https://huggingface.co/blog/smollm3
268•kashifr•14h ago•50 comments

I'm Building LLM for Satellite Data EarthGPT.app

https://www.earthgpt.app/
7•sabman•1d ago•1 comments

Bulgaria to join euro area on 1 January 2026

https://www.ecb.europa.eu//press/pr/date/2025/html/ecb.pr250708~b9676a9fa8.en.html
178•toomuchtodo•5h ago•108 comments

US Court nullifies FTC requirement for click-to-cancel

https://arstechnica.com/tech-policy/2025/07/us-court-cancels-ftc-rule-that-would-have-made-canceling-subscriptions-easier/
37•gausswho•7h ago•76 comments

Radium Music Editor

http://users.notam02.no/~kjetism/radium/
182•ofalkaed•12h ago•35 comments

Surfing on a Matchbox (1999)

http://news.bbc.co.uk/2/hi/science/nature/276762.stm
13•TMWNN•2d ago•3 comments

Brut: A New Web Framework for Ruby

https://naildrivin5.com/blog/2025/07/08/brut-a-new-web-framework-for-ruby.html
156•onnnon•12h ago•52 comments

Xenharmlib: A music theory library that supports non-western harmonic systems

https://xenharmlib.readthedocs.io/en/latest/
58•retooth•7h ago•5 comments

Libpostal: C library for parsing/normalizing street addresses around the world

https://github.com/openvenues/libpostal
27•nateb2022•4h ago•6 comments

Swahili on the Road

https://www.historytoday.com/archive/behind-times/swahili-road
16•Thevet•5h ago•2 comments

Dynamical origin of Theia, the last giant impactor on Earth

https://arxiv.org/abs/2507.01826
81•bikenaga•12h ago•27 comments

Taking over 60k spyware user accounts with SQL injection

https://ericdaigle.ca/posts/taking-over-60k-spyware-user-accounts/
185•mtlynch•5d ago•58 comments

Show HN: OffChess – Offline chess puzzles app

https://offchess.com
310•avadhesh18•21h ago•138 comments

Plants monitor the integrity of their barrier by sensing gas diffusion

https://www.nature.com/articles/s41586-025-09223-4
67•Bluestein•3d ago•31 comments

Rules of good writing (2007)

https://dilbertblog.typepad.com/the_dilbert_blog/2007/06/the_day_you_bec.html
79•santiviquez•1d ago•61 comments

Can an email go 500 miles in 2025?

https://flak.tedunangst.com/post/can-an-email-go-500-miles-in-2025
285•zdw•4d ago•107 comments

New Horizons images enable first test of interstellar navigation

https://www.newscientist.com/article/2486823-new-horizons-images-enable-first-test-of-interstellar-navigation/
31•jnord•2d ago•2 comments

GlobalFoundries to Acquire MIPS

https://mips.com/press-releases/gf-mips/
199•mshockwave•13h ago•112 comments

At the frontier between two lives–the evolutionary origins of pregnancy

https://phys.org/news/2025-07-frontier-evolutionary-pregnancy.html
10•wglb•2d ago•1 comments

Show HN: A rain Pomodoro with brown noise, ASMR, and Middle Eastern music

https://forgetoolz.com/rain-pomodoro
75•ShadowUnknown•12h ago•34 comments

Choosing a Database Schema for Polymorphic Data (2024)

https://www.dolthub.com/blog/2024-06-25-polymorphic-associations/
22•gm678•6h ago•5 comments

Ceramic: A cross-platform and open-source 2D framework in Haxe

https://ceramic-engine.com/
73•-yukari•3d ago•10 comments