Versions in this module Expand all Collapse all v2 v2.0.2 May 3, 2026 Changes in this version + var ErrConfigMismatch = errors.New("usid: database config does not match application config") + func GenerateSQL(cfg Config) string + func Migrate(ctx context.Context, db DB, cfgs ...Config) error + func NextNode(ctx context.Context, db DB) (int64, error) + type Config struct + CreateDomain bool + Epoch int64 + NodeBits uint8 + SeqBits uint8 + func DefaultConfig() Config + func GetConfig(ctx context.Context, db DB) (Config, error) + func (c Config) MaxNode() int64 + func (c Config) MaxSeq() int64 + func (c Config) NodeMask() int64 + func (c Config) SeqMask() int64 + func (c Config) TimeShift() uint8 + type DB interface + ExecContext func(ctx context.Context, query string, args ...any) (sql.Result, error) + QueryRowContext func(ctx context.Context, query string, args ...any) *sql.Row