6
submitted 3 weeks ago by [email protected] to c/[email protected]

Example usage:

-- Register with default settings (41 timestamp bits, 10 type bits, 12 counter bits)
CALL snowflake.register('user_id');

-- Generate a user ID
SELECT snowflake.generate_user_id(now(), 1, 1);

-- Register with custom bit allocation
CALL snowflake.register('order_id', 42, 8, 13);

-- Generate an order ID with specific type and counter
SELECT snowflake.generate_order_id('2023-12-01 10:30:00 UTC', 5, 1000);
no comments (yet)
sorted by: hot top new old
there doesn't seem to be anything here
this post was submitted on 24 Jun 2025
6 points (100.0% liked)

PostgreSQL

1199 readers
3 users here now

The world's most advanced open source relational database

Project
Events
Podcasts
Related Fediverse communities

founded 2 years ago
MODERATORS