Open philiplee13 opened 1 year ago
I am using the node-postgres adapter as well, and running the migrations on the database before creating an adapter worked for me:
import { newDb } from 'pg-mem';
const db = newDb();
await db.public.migrate(/* config, etc. */);
const { Client } = db.adaptors.createPg();
const client = new Client();
// run queries, etc.
Hope this helps.
@philiplee13 have you managed to sort this out? I have a similar issue (https://github.com/oguimbal/pg-mem/issues/364) where I cannot access the schema from the adapter query.
This is more of a question than anything - but was there support for using migrations using one of the adapters?
I was trying something like the below
Folder structure
The contents of init.sql would be something like...
Got a little confused on how I would apply the migrate - from the docs here
I wasn't sure if I could do db.public.migrate({}) because wouldn't that apply to the default?
Please let me know if I need to add additional info