{"id":22674748,"url":"https://github.com/bitnom/ulidia","last_synced_at":"2026-03-19T23:23:33.352Z","repository":{"id":247282005,"uuid":"825443397","full_name":"bitnom/ulidia","owner":"bitnom","description":"ULID for postgres in plsql","archived":false,"fork":false,"pushed_at":"2024-07-07T20:06:38.000Z","size":9,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-02T00:46:25.675Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PLpgSQL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bitnom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-07T19:36:27.000Z","updated_at":"2024-09-29T02:00:30.000Z","dependencies_parsed_at":"2024-07-07T21:02:35.647Z","dependency_job_id":null,"html_url":"https://github.com/bitnom/ulidia","commit_stats":null,"previous_names":["bitnom/ulidia"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bitnom/ulidia","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitnom%2Fulidia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitnom%2Fulidia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitnom%2Fulidia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitnom%2Fulidia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitnom","download_url":"https://codeload.github.com/bitnom/ulidia/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitnom%2Fulidia/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29189264,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T05:07:31.176Z","status":"ssl_error","status_checked_at":"2026-02-07T05:06:15.227Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-09T17:18:02.616Z","updated_at":"2026-02-07T07:31:07.188Z","avatar_url":"https://github.com/bitnom.png","language":"PLpgSQL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ulidia\n\nUlidia is a robust, PostgreSQL-native implementation of Universally Unique Lexicographically Sortable Identifiers (ULIDs) designed for use with Supabase and other PostgreSQL-based projects.\n\n## Features\n\n- Efficient 16-byte storage using a custom `ulid` type based on UUID\n- ULID generation with cryptographically secure randomness via `pgcrypto`\n- Conversion between ULID and its 26-character string representation\n- Timestamp extraction from ULIDs\n- Lexicographic sorting and efficient indexing\n- Comprehensive test suite\n\n## Installation\n\n1. Ensure you have PostgreSQL 9.6 or later and the `pgcrypto` extension available.\n2. Run the `ulidia.sql` script in your PostgreSQL database:\n\n   ```sql\n   \\i path/to/ulidia.sql\n   ```\n\n## Usage\n\nAfter installation, you can use ULIDs in your database:\n\n```sql\n-- Create a table with a ULID primary key\nCREATE TABLE users (\n  id ulid PRIMARY KEY DEFAULT generate_ulid(),\n  name TEXT NOT NULL\n);\n\n-- Insert a record\nINSERT INTO users (name) VALUES ('Alice');\n\n-- Query using ULID\nSELECT * FROM users WHERE id = '01F8MECHZCP3RP0AQCCPD0JQBF'::ulid;\n\n-- Get string representation\nSELECT ulid_to_string(id) FROM users;\n\n-- Get timestamp\nSELECT ulid_to_timestamp(id) FROM users;\n```\n\n## Functions\n\n- `generate_ulid()`: Generate a new ULID\n- `generate_ulid_at(timestamp_ms BIGINT)`: Generate a ULID with a specific timestamp\n- `ulid_to_string(u ulid)`: Convert ULID to string\n- `string_to_ulid(s text)`: Convert string to ULID\n- `ulid_to_timestamp(u ulid)`: Extract timestamp from ULID\n- `is_valid_ulid(s text)`: Validate ULID string\n- `compare_ulids(a ulid, b ulid)`: Compare two ULIDs\n\n## Testing\n\nRun the included test suite:\n\n```sql\nSELECT * FROM test_ulid_functions();\n```\n\n## Limitations\n\n- This implementation does not guarantee strict monotonicity in high-concurrency scenarios.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Acknowledgments\n\n- Inspired by the [ULID spec](https://github.com/ulid/spec)\n- Uses PostgreSQL's `pgcrypto` for secure random number generation\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitnom%2Fulidia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitnom%2Fulidia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitnom%2Fulidia/lists"}