electric-sql / electric-sql/pglite

Suspiciously fast auto-increment speed in the table

Open
#569 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
16k
Forks
442
Avg merge
20h 19m
Merged PRs (30d)
7

Description

Hi there!

I noticed that after restarting an node.js application that uses pglite and auto-increment, the auto-increment value increases by more than one—sometimes by ten, for example. I'm not sure if this is a bug or a feature, so I decided to create a sandbox and explain how to reproduce it.

Also the same case reproducible in browser with usage of IndexedDB for persistence.

Here sandbox https://codesandbox.io/p/devbox/pglite-test-case-tyzvn7 in which you can reproduce the case.

Just go to terminal and restart application with `ctrl + c` and that by re-run app by command `npm install && npm start`. You will see that the auto-increment for new rows increases by more than one.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.