https://github.com/pfmt/serialkey
Dynamically named sequences for Go.
https://github.com/pfmt/serialkey
go golang
Last synced: 9 months ago
JSON representation
Dynamically named sequences for Go.
- Host: GitHub
- URL: https://github.com/pfmt/serialkey
- Owner: pfmt
- License: bsd-3-clause
- Created: 2022-05-13T07:46:35.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-10-24T21:51:08.000Z (over 3 years ago)
- Last Synced: 2025-10-09T12:32:19.485Z (9 months ago)
- Topics: go, golang
- Language: Go
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# serialkey
[](https://cloud.drone.io/pfmt/serialkey)
[](https://pkg.go.dev/github.com/pfmt/serialkey)
Dynamically named sequences for Go.
Source files are distributed under the BSD-style license.
## About
The software is considered to be at a alpha level of readiness,
its extremely slow and allocates a lots of memory.
## PostgreSQL
Create table `make postgresql` or
`cat psql_create_table.sql | sed --expression='s/{{\.Table}}/serialkeys/g'`
```sql
CREATE TABLE IF NOT EXISTS serialkeys (
key text primary key,
value bigint NOT NULL,
created_at timestamp with time zone NOT NULL DEFAULT now(),
updated_at timestamp with time zone
);
```
## Benchmark
```sh
$ go test -count=1 -race -bench ./...
goos: linux
goarch: amd64
pkg: github.com/pfmt/serialkey
cpu: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
BenchmarkLocalNext/main_test.go:66-8 6259942 200.5 ns/op
BenchmarkPgxNext/main_test.go:66-8 2852 362782 ns/op
PASS
ok github.com/pfmt/serialkey 3.031s
```