An open API service indexing awesome lists of open source software.

https://github.com/lrf141/mysql-ulid-plugin

MySQL UDF Plugin for generating ULIDs
https://github.com/lrf141/mysql-ulid-plugin

mysql plugin udf ulid

Last synced: 3 months ago
JSON representation

MySQL UDF Plugin for generating ULIDs

Awesome Lists containing this project

README

          

# mysql-ulid-plugin
MySQL UDF Plugin for generating ULIDs

# How to build
## Install mysql_config
For Ubuntu.
```bash
$ sudo apt install libmysqlclient-dev
```

For macOS with homebrew
```bash
$ brew install mysql-connector-c
```

## Build
```bash
$ mkdir build && cd $_
$ cmake ../
$ make
```

## Run test
```bash
$ mkdir build && cd $_
$ cmake ../
$ make test
```
or
```bash
$ mkdir build && cd $_
$ cmake ../
$ ./ulid-gtest
```

# Use ULID()
```sql
CREATE FUNCTION ulid RETURNS STRING SONAME 'ulid.so';
SELECT ULID();
```

Warning: If mysql client run with --binary-as-hex=1, Return string is represent as hex.