Add whoami_random_name() to generate random readable name#102
Open
carlopi wants to merge 1 commit into
Open
Conversation
```sql
SELECT whoami_random_name() FROM range(10);
```
will generate a list resembling:
```
quick-eider-56
copper-wigeon-64
snug-rouen-66
dreamy-ringneck-eb
sunny-canvasback-ce
sturdy-steamer-cd
sturdy-shelduck-74
crisp-mallard-89
jaunty-eatoni-42
witty-torrent-81
```
And now, without user input:
```sql
FROM whoami();
```
```
┌──────────────────┬──────────┬──────────┬─────────┬─────────────────┬───────────────────────────────┬────────────────────────────────────────────────────┐
│ name │ provider │ hostname │ region │ uptime │ ts_now │ meta │
│ varchar │ varchar │ varchar │ varchar │ interval │ timestamp with time zone │ json │
├──────────────────┼──────────┼──────────┼─────────┼─────────────────┼───────────────────────────────┼────────────────────────────────────────────────────┤
│ dreamy-eatoni-de │ NULL │ NULL │ NULL │ 00:00:01.115181 │ 2026-05-10 07:41:10.939381+00 │ {"duckdb_version":"v1.5.2","platform":"osx_arm64"} │
└──────────────────┴──────────┴──────────┴─────────┴─────────────────┴───────────────────────────────┴────────────────────────────────────────────────────┘
```
This is cute, clearly NOT load-bearing, but it's a sort of common convention when managing different compute instances have names assigned to them
in a readable way (Docker / Tailscale / Heroku / GitHub Codespaces).
Implementation:
32 adjectives
times 32 nouns that are duck-themed
times 256 (2 hex)
I made a pass trying to remove any negative connotation from both sides, but improvements are welcome (also, no need to stick to power of 2).
Member
|
crispy oi! :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
will generate a list resembling:
And now, without user input:
FROM whoami();User that want to opt-out can already to so via
SET GLOBAL whoami_name = ''orSET GLOBAL whoami_name = 'my-custom-name';This is mostly for the cuteness, clearly NOT load-bearing, but it's a sort of common convention when managing different compute instances have names assigned to them in a readable way. Docker / Tailscale / Heroku / GitHub Codespaces all have conventions converging to
adjective - noun [-hex digits].In our case, noun had to be duck-related, with adjective being nice / friendly and avoiding any negative connotation.
Implementation: one of 32 adjectives - one of 32 duck-themed nouns - 2 hex cypher
I made a pass trying to remove any negative association from both sides (and when combined), but improvements are welcome (also, no need to stick to power of 2).
Adjectives:
Nouns: