Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iCyberon/pg_ulid
Universally Unique Lexicographically Sortable Identifier (ULID) for PostgreSQL
https://github.com/iCyberon/pg_ulid
golang postgresql psql ulid
Last synced: 3 months ago
JSON representation
Universally Unique Lexicographically Sortable Identifier (ULID) for PostgreSQL
- Host: GitHub
- URL: https://github.com/iCyberon/pg_ulid
- Owner: iCyberon
- License: mit
- Created: 2017-12-18T23:46:51.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2021-05-12T04:26:17.000Z (over 3 years ago)
- Last Synced: 2024-10-12T09:05:30.781Z (3 months ago)
- Topics: golang, postgresql, psql, ulid
- Language: Go
- Size: 5.86 KB
- Stars: 59
- Watchers: 4
- Forks: 4
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pg_ulid
Universally Unique Lexicographically Sortable Identifier (ULID) for PostgreSQLExperimental PostgreSQL extension for generating ULIDs.
## Install
You need to have go and compiler (clang/gcc) installed on your system.```sh
$ git clone https://github.com/icyberon/pg_ulid
$ cd pg_ulid
$ make
$ sudo make install
```This will build and install the extension.
```sql
CREATE EXTENSION pg_ulid;
```## Usage
Now you can start generating ULIDs from PostgreSQL by calling `ulid`. Function returns `TEXT`
```sql
SELECT ulid(); -- 01C1P15MBWYBWDG2WYRG08VCFR
SELECT pg_typeof(ulid()); -- text
```## Todo
- [ ] Add binary support
- [ ] Add tests## Credits
All credits go to [ulid](https://github.com/oklog/ulid) and [plgo](https://github.com/microo8/plgo)