pglite icon indicating copy to clipboard operation
pglite copied to clipboard

Better error message when using extensions without a `dataDir`

Open SebastienGllmt opened this issue 7 months ago • 0 comments

Currently, if you try and use an extension without specifying a dataDir

import { citext } from '@electric-sql/pglite/contrib/citext';

const db = new PGlite(undefined, {
  extensions: { citext }
});

It will not cause any issue, but when you run

CREATE EXTENSION IF NOT EXISTS citext;

It will fail with error: extension "citext" is not available

It would be better if pglite instead fast-failed when specifying an extension without a dataDir telling you that you need a dataDir to use extensions (even if it's just memory://)

SebastienGllmt avatar Apr 18 '25 20:04 SebastienGllmt