question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Database may not be restoring?

See original GitHub issue

Not sure if I’m missing something here but:

const inMemoryDb = newDb();
inMemoryDb.public.none(fs.readFileSync('src/graphql/DB/pgMem/migrations/001-initial.sql', 'utf8'));
const backup = inMemoryDb.backup();
export { inMemoryDb, backup };

When I run this at the top of every test, it doesn’t seem like it’s resetting the DB to the initial migration because in 001-initial.sql I do not seed any ā€œCraftersā€ for the Crafter table. No crafters were created in 001-initial.sql’. My tests create crafters.

But when I run my tests, it’s not clearing crafters that were created after each test runs it seems. If I output select * from crafters, it seems to be aggregating them.

beforeEach(() => {
  backup.restore();
});

My tests are mainly mocha. A few are test. Right now I’m just talking about the ones using mocha.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
oguimbalcommented, Jan 2, 2022

pg-mem is being supported.

You’ve got some nerve saying that @dschinkel .

I’ve answerered most all of your numerous pseudo-issues, even if most of them were unrelated to pg-mem.

… Then you started sending me 5 emails per day on my personal address (still mostly unrelated to pg-mem), which were sometimes aggressive (depending on the hour they were sent).

So yes, after spending hours trying to answer you at first (and free of charge !), I began to take ā€œsome timeā€ to answer.

I’m supporting pg-mem on my free time, so if you want professional support @dschinkel, I would suggest a meaningful donation. I usually charge 300$/hr, and I think I lost at least a day answering your questions and adding the features you asked for. So do the math, and donate, before casually telling that pg-mem is not being supported.

0reactions
dschinkelcommented, Jan 3, 2022

I’m done with this. Especially due to your last reply. Good luck in 2022 šŸ‘‹.

Read more comments on GitHub >

github_iconTop Results From Across the Web

6 Ways to Fix SQL Server Restore Failed Database in Use
Error: SQL Server restore failed because the database is in use Ā· Way 1. Close existing connections to destination database Ā· Way 2....
Read more >
[Error Solved] SQL Database Restore failed, database in use
How to Fix ?can't restore SQL database because it is in use? Problem? Ā· Method 1 ? Close the existing connections to the...
Read more >
SQL Server Database Stuck in Restoring State
Another reason your database can be in restoring state is when you backup the tail of the log using the NORECOVERY option as...
Read more >
You cannot restore system database backups to a different ...
The backup of the system database on device d:\temp\master.bak cannot be restored because it was created by a different version of the server...
Read more >
[Fixed] SQL Database Restore Failed Database Is in Use
When trying to restore SQL database in Microsoft SQL Server Management Studio, you might come across an error message which suggests the SQLĀ ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found