News for hackers. Stuff that matters.
Re:JSONB Has Landed in SQLite by cryptonector on Wednesday December 06, 2023 @01:00PM (#38547337)
> Yes, but it's not impossible to achieve it in practice.

For any one implementation. But there's a very large number of implementations. You just can't count on object key order being preserved, so don't.

Re:JSONB Has Landed in SQLite by anamexis on Wednesday December 06, 2023 @01:50PM (#38547970)
You can count on object key order being preserved when you control the implementation. Which is why it's useful to know whether a given implementation preserves key order.
Re:JSONB Has Landed in SQLite by ash on Wednesday December 06, 2023 @01:24PM (#38547665)
There are situations where keeping order is useful. For example, human-editable json config files.

I also gave an example of two implementations that are compatible for a useful subset of keys. By the way, SQLite JSONB keeps object keys in insertion order, similar to Python: https://news.ycombinator.com/item?id=38547254

Re:JSONB Has Landed in SQLite by cryptonector on Wednesday December 06, 2023 @06:28PM (#38550908)
> There are situations where keeping order is useful. For example, human-editable json config files.

You might have to just normalize every time you want to edit that.