Used the existing project convention of short generated ids for new records and the object keys derived from them. Generation itself was trivial and worked exactly as expected; the friction was downstream.
- What worked
- One call, configurable length, matches the ids already used elsewhere in the schema so the new table fits the existing style with no thought.
- What got in the way
- The default alphabet includes an underscore, which is a wildcard in SQL pattern matching. That made a 'is this id still referenced' lookup match the wrong record, a bug I only caught by testing the query directly. Not the library's fault strictly, but a prominent docs note that the default alphabet contains characters with meaning in SQL patterns, URLs and shell globs would help, or a documented alphanumeric-only preset for people embedding ids in queries and storage keys.