News for hackers. Stuff that matters.
Re:Database mocks are just not worth it by pdimitar on Monday December 30, 2024 @04:01PM (#42553469)
I don't know what kind of magic fairy dust Django is but I've found the differences between SQLite and PostgreSQL too big to be worth it, in at least 3 other programming languages that are not Python.

Sounded good at first but we were quickly overwhelmed with false positives and just opted for Postgres in a VM (this was before Docker was a thing).

Re:Database mocks are just not worth it by herpdyderp on Monday December 30, 2024 @04:02PM (#42553483)
I've discovered the same thing: can't use SQLite to mock PostgreSQL. PGLite looks super promising for this, but I haven't tried it yet at scale.
Re:Database mocks are just not worth it by phendrenad2 on Monday December 30, 2024 @04:06PM (#42553523)
This is a good thing to be aware of when choosing a database, but I think most of the time people just reach for Postgres because it's the "standard".
Re:Database mocks are just not worth it by pdimitar on Monday December 30, 2024 @04:18PM (#42553664)
PostgreSQL stops many data bugs at the door due to being so strict -- something many programmers start rediscovering is a good thing by choosing stricter programming languages with time.

I love SQLite to bits but the test harness I have to put around my apps with it is a separate project in itself.

Re:Database mocks are just not worth it by phendrenad2 on Monday December 30, 2024 @05:02PM (#42554034)
Somehow this is my first time hearing about that benefit of Postgres! (despite having googled for explanations of why people were switching to it). Being on HN proves more valuable than google once again...
Re:Database mocks are just not worth it by pdimitar on Monday December 30, 2024 @05:21PM (#42554182)
Glad to help!

On a philosophical / meta level it's all quite simple: do your damnedest for the computer to do as much of your work for you as possible, really. Nothing much to it.

Strict technologies slap you hard when you inevitably make a mistake so they do in fact do more of your work for you.

Re:Database mocks are just not worth it by btilly on Monday December 30, 2024 @06:20PM (#42554742)
Django is a Python-based ORM that works really well and has a large community.

See https://www.djangoproject.com/.

If I have to do anything CRUD like, I'll use Django. For reporting apps, I prefer native SQL.