←back to thread

676 points __bb | 3 comments | | HN request time: 0.75s | source

I recently released v3 of Base, my SQLite editor for macOS.

The goal of this app is to provide a comfortable native GUI for SQLite, without it turning into a massive IDE-style app.

The coolest features are

- That it can handle full altering of tables, which is quite finicky to do manually with SQLite.

- It has a more detailed display of column constraints than most editors. Each constraint is shown as an icon if active, with full details available on clicking the icon.

This update also adds support for attaching databases, which is a bit fiddly with macOS sandboxing.

I'd love to hear any feedback or answer any questions.

Show context
earthnail ◴[] No.45014961[source]
It would be amazing if it could display UUIDs. SQlite doesn't support them natively, but many people store them as binary blobs.

Jetbrains products realize that these binary values are UUIDs and let me edit them easily.

replies(4): >>45015712 #>>45015789 #>>45016676 #>>45018174 #
1. da_chicken ◴[] No.45018174[source]
See, I would be terrified of doing that because different RDBMSs and languages store and sort UUIDs differently. A UUID is not just a number. It's a structured data format.

Both MariaDB and SQL Server have dedicated data types for UUIDs, and they sort in an unexpected order if you're unfamiliar with the structure of a UUID or the endianness of certain portions of it. Oracle assumes it's going to be binary, but the generating function SYS_GUID() has some endianness issues you can run into. Meanwhile, PostgreSQL kist sorts them like a string!

Similarly, if you're using .Net to generate a native GUID type and passing that through your RDBMS provider, it may arrive and be stored differently due to that endianness problem.

Expecting that every SQLite database is going to be storing UUIDs in an identical manner seems insane to me.

replies(1): >>45022723 #
2. throwaway2037 ◴[] No.45022723[source]
Is it incorrect to simply sort the alphanumeric version of UUIDs? I am unsure if UUIDs have special sorting rules like Unicode.
replies(1): >>45034907 #
3. da_chicken ◴[] No.45034907[source]
It's not really about that.

It's the fact that, as the Base author, you don't really know how a given application might present a 16-byte binary version of a UUID to the database. If you don't know that, how can you reverse it to display the correct string representation? There are complications with byte groups potentially being in different places, and even the potential of mixed byte ordering.

How can Base make a 16-byte binary format that display both a GUID stored from a .Net application from person A, and also a UUID from a Python application from person B, and have the string representation be accurate in both cases? I don't think you can.