-
Notifications
You must be signed in to change notification settings - Fork 333
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
When using PGlite with IndexedDB filesystem, a SERIAL primary key increments by 33 on each insert instead of incrementing by 1.
This does not happen when using the default (in-memory) storage.
To Reproduce
Code Sample
<script setup lang="ts">
import { ref } from 'vue'
import { PGlite } from '@electric-sql/pglite'
import { live } from '@electric-sql/pglite/live'
const PGliteDB = await PGlite.create('idb://my-database', {
extensions: {
live,
},
})
// Default (Memory)
// const PGliteDB = await PGlite.create({
// extensions: {
// live,
// },
// })
const todo = ref()
await PGliteDB.exec(`
CREATE TABLE IF NOT EXISTS todo (
id SERIAL PRIMARY KEY,
task TEXT
);
INSERT INTO todo (task) VALUES ('task');
`)
todo.value = await PGliteDB.exec('SELECT * FROM todo;')
</script>
<template>
<pre>{{ todo }}</pre>
</template>Repository
Minimal reproduction repository:
π on branch (vue-pglite)
Logs / Screenshots
Using IndexedDB
Using in-memory
Comparison
| Storage type | Behavior |
|---|---|
| In-memory (default) | β Increments by 1 |
IndexedDB (idb://) |
β Increments by 33 |
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working