Skip to content

Latest commit

 

History

History
22 lines (15 loc) · 765 Bytes

README.md

File metadata and controls

22 lines (15 loc) · 765 Bytes

haikunator-plpgsql

ci License: MIT

Generate Heroku-like random names in PL/pgSQL. Inspired by usmanbashir/haikunator

Usage

You can find the function at function/001_haikunator.sql.

haikunate(token_length integer default 4, delimiter TEXT default '-', token_hex BOOLEAN default FALSE)

Examples

SELECT haikunate(); -- => "aged-band-1234"
SELECT haikunate(4, "-", false); -- => "blue-breeze-1234"
SELECT haikunate(4, "-", true); -- => "aged-band-4ab7"
SELECT haikunate(4, "_", true); -- => "autumn_bird_4ab7"