Is there a close method?
See original GitHub issueI’m using your great library and it seems there is no close
method.
I’m developing an app using multiple databases (I mean multiple instances of NEDB
object). Actually I’m wondering how you manage all the instances with no explicit call to close
.
Thanks in advance
Issue Analytics
- State:
- Created 10 years ago
- Comments:13 (3 by maintainers)
Top Results From Across the Web
Reader close() method in Java with Examples - GeeksforGeeks
The close() method of Reader Class in Java is used to close the stream and release the resources that were busy in the...
Read more >Java Scanner close() Method - Javatpoint
The close () is a method of Java Scanner class which is used to closes this scanner. Syntax. Following is the declaration of...
Read more >What is the writer.close() method in Java? - Educative.io
The close () or writer.close() method is used to close the writer. close() flushes and then closes the stream. Once the stream has...
Read more >Java.util.Scanner.close() Method - Tutorialspoint
The java.util.Scanner.close() method closes this scanner.If this scanner has not yet been closed then if its underlying readable also implements the ...
Read more >Python File close() Method - W3Schools
The close() method closes an open file. You should always close your files, in some cases, due to buffering, changes made to a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Not coupled via shared db object instances, for God’s sake. If I
setUp
a database content, it does not mean I pass the db instance to the tested code. Tested code loads database on its own (of course). And it means that I of course need close method to knowsetUp
is finished and test can run (or, nedb should keep some internal cache and reuse the db when loaded again with the same file; but that us imo a level harder then being able to close).Never mind, if you do not want to add close, don’t, I use node-sqlite instead since it can close therefore it is nicely usable in tests.
Robert Hurst notifications@github.comnapísal/a:
@ghost, I faced similar issue, my tested function was updating database, than I wanted to check it in test, but there was still old information. When I opened db file in file system, it was updated, my function was working correctly, but tests weren’t. Than I tried to do
db.loadDatabase();
before checking in tests, it worked.