wojcikstefan

Joined 14 years ago

Karma
341
Submissions
107
Member since
Jun 29
Software Engineer at Close (YC W11).

https://twitter.com/wojcikstefan https://github.com/wojcikstefan

View on Hacker News

Recent submissions

Comment · 1 year ago
> A diet of mostly-plants can be just as delicious as one with a lot of beef.

I strongly disagree – as a person who's eaten vegan for over a year, tried all the fancy meat alternatives, and has gone back because a good grass-fed steak is just 10x more delicious.

Comment · 2 years ago
Thank you very much! :) I still advise that you try really, really hard to avoid using `pg_hint_plan` if you can, but it's nice that it exists if all else fails or if you need temporary relief at a time of crisis.
Comment · 2 years ago
Comment · 2 years ago
Agreed, event sourcing is a pretty good match for call flows. You could first store every call leg / conference / recording / etc. webhook Twilio sends you as an event and then derive the state of the final "call" concept from those pieces of data.
Comment · 2 years ago
Hi HN community, author of the post here. Let me know please if you have any questions, comments, or feedback!
Comment · 2 years ago
Comment · 3 years ago
Hiya Aidan! :D

> Is this behaviour new?

Don't think so. Even the docs for SQLA v1.3 ([0]) mention it:

> native_enum – Use the database’s native ENUM type when available. Defaults to True. When False, uses VARCHAR + check constraint for all backends. The VARCHAR length can be controlled with Enum.length

[0]: https://docs.sqlalchemy.org/en/13/core/type_basics.html#sqla...

--

> Or is it that alembic still doesn't pick up changes to the enum to recreate the constraint?

Off the top of my head, I believe Alembic doesn't pick it up automatically. We make a lot of manual tweaks to our auto-generated Alembic migrations and I believe adding / modifying the CHECK constrains is part of it.

Comment · 3 years ago
Whew, good to know! Another point towards the `CHECK` constraint approach. Thanks! :)
Comment · 3 years ago
Comment · 3 years ago
> I usually use C# Enums translated by EF Core now (...)

Does this approach ensure data consistency? Or could you accidentally insert a number value into your table which is not represented by any of the enum values?

Comment · 3 years ago
Apologies for my ignorance, but what does "FDW" stand for in your comment? :)
Comment · 3 years ago
Just to make sure I understand your suggestion fully, you're saying: 1. Use `smallint` instead of `text` for the column type. 2. Otherwise follow our "`CHECK` constraint" approach (without it we're jeopardizing data consistency because we can store anything between -32768 and 32767 in that column). 3. Translate the int to the enum in your application.

Right?

Comment · 3 years ago
Coca Cola & Red Bull are massive, they surely have tiny marketing spend… Right?

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton