Skip to content

Add whoami_random_name() to generate random readable name#102

Open
carlopi wants to merge 1 commit into
duckdb:v1.5-variegatafrom
carlopi:whoami_name
Open

Add whoami_random_name() to generate random readable name#102
carlopi wants to merge 1 commit into
duckdb:v1.5-variegatafrom
carlopi:whoami_name

Conversation

@carlopi
Copy link
Copy Markdown
Member

@carlopi carlopi commented May 10, 2026

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:

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"} │
└──────────────────┴──────────┴──────────┴─────────┴─────────────────┴───────────────────────────────┴────────────────────────────────────────────────────┘

User that want to opt-out can already to so via SET GLOBAL whoami_name = '' or SET 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:

  bold        brave       bright      cheery      clever      copper      crisp       dapper
  downy       dreamy      eager       gentle      glossy      golden      hardy       jaunty
  jolly       mellow      merry       plucky      quick       scrappy     sharp       silver
  sleek       sleepy      snug        sturdy      sunny       swift       witty       zesty

Nouns:

  andium      aylesbury   bufflehead  canvasback  cayuga      drake       eatoni      eider
  gadwall     garganey    goldeneye   harlequin   mallard     mandarin    merganser   muscovy
  nivis       pintail     pochard     redhead     ringneck    rouen       scaup       shelduck
  shoveler    smew        steamer     teal        torrent     variegata   whistler    wigeon

```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).
@hannes
Copy link
Copy Markdown
Member

hannes commented May 12, 2026

crispy oi! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants