Hacker News new | ask | show | jobs
by Vmody2 1922 days ago
> - Booleans in the API are `true` or `undefined`. Seriously.

But why???

1 comments

Because they are not real boolean datatype, just strings probably.
Wonder what they use underneath; don't most relation dbs implement as int?
When you’re doing dynamic structure in relational dbs (traditionally) options include storing a wide row with all the data types and you choose which column to use, or storing as lowest common denominator (string) and casting in and out at runtime. These days you can work around this stuff with json / schemaless models.

Airtable allow switching data types on a column (from memory). Maybe they store everything as string and then the column definition is for display and allowed operations.

Hubspot do this (poorly) so they’re forever giving you back things like dates as string of a number representing a date.