mongodb-memory-server
postgres-wasm
Our great sponsors
mongodb-memory-server | postgres-wasm | |
---|---|---|
9 | 11 | |
2,447 | 2,237 | |
- | 1.9% | |
9.3 | 2.8 | |
8 days ago | 12 days ago | |
TypeScript | Shell | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
mongodb-memory-server
-
How to test nestjs modules?
In the case of MongoDB there's jest-mongodb that use mongodb-memory-server; for other DBMS, I don't know if it's possible to run an instance in memory.
-
My first project, a Dev.to clone built with MongoDB, Express, React, and Socket.io
The only thing really messing is tests. At work we use https://github.com/nodkz/mongodb-memory-server
-
How to write tests for applications that use MongoDB as a storage
The final method tries to combine both methods, 1 and 2. It uses an external package MongoDB In-Memory Server for our MongoDB.
-
How to test mongoose models with jest and mockingoose
The above test is clear and easy to understand, but the reality is that, while this can be applied to a lot of cases, things get very complicated when you have to start to mock things like dependencies, API calls, etc... And one very tricky case is when you have to test a function that invoke some models from an ODM like Mongoose, like doing some CRUD operations against a database. In some cases a solution could be to use an actual test database, so you don't mock anything but you use real data. The only problem with that is that is assuming that you must have a database at your disposal to run unit tests, and that's not always possible, plus you have to clean the database, and a pletora of other problems. Another solution could be to use a database that lives only in memory and only for the duration of your tests, like the excellent mongodb-memory-server package. But while this will work most of the times, if you deploy your code on any CI/CD you might encounter problems (and I did!). Also a key factor of unit testing, is that you shouldn't rely on external services run them, unlike E2E tests for example. What you should do is to mock most of the dependencies you need, as your goal is to just test the function and no deeper than that.
- Show HN: Mongita is to MongoDB as SQLite is to SQL
-
Setup in-memory database for testing Node.js and Mongoose
I've been working on creating an application using Node.js and Mongoose where all data stored in the cloud MongoDB Atlas. My goal was to test API endpoints and write some unit tests, for that I found this package called mongodb-memory-server, which allows me to create a connection to the MongoDB server from my cache folder without a need to use cloud test database or installing mongodb client.
-
Testing with MongoDB-Memory-Server
In both articles, the authors refer to nodkz's mongodb-memory-server package.
-
MongoDB Animated: Adding and removing elements from arrays
mongodb-memory-server package by @nodkz
-
In memory mongoDB for testing
There are a whole lot of configuration options for you to explore with this package here -> https://github.com/nodkz/mongodb-memory-server
postgres-wasm
-
Container2wasm: Convert Containers to WASM Blobs
Also: https://github.com/copy/v86 - more productized browser x86 runtime, used by eg https://github.com/snaplet/postgres-wasm
-
Show HN: I made a SQL game to help people learn / challenge their skills
> forcing SQLite
It might be the case that it's running SQLite via wasm. If so, then other database engines would need to be runnable in a browser too.
PostgreSQL has been shown to work in the browser (eg https://www.crunchydata.com/blog/learn-postgres-at-the-playg..., and also https://github.com/snaplet/postgres-wasm), so that might be an option.
Not sure about others.
- WebAssembly: Docker Without Containers
-
Show HN: SadServers. Test your Linux troubleshooting skills
Thanks, I've been looking at WASM, for ex https://github.com/snaplet/postgres-wasm/tree/main/packages/... , it would certainly simplify everything to "download a fat file".
-
The Docker+WASM Technical Preview
Hey! Peter from Snaplet here. This is really exciting stuff. We created the OSS postgres-wasm (https://github.com/snaplet/postgres-wasm) example a few weeks ago. An idea I'm playing around with is something like:
1. Visit https://postgresql.com/try?version=14.x
-
How to test nestjs modules?
Other in-memory alternatives for PostgreSQL embedded-postgres (I haven't tried it yet) postgres-wasm (currently it only runs in the browser).
-
PostgreSQL 15 Released!
"/s" is obsolete as of now: https://github.com/snaplet/postgres-wasm I'm so sorry
-
Postgres WASM by Snaplet and Supabase
Today we're open sourcing postgres-wasm with our friends at Snaplet.
- GitHub - snaplet/postgres-wasm: A PostgresQL server running in your browser
-
Show HN: Postgres WASM
Peter from Snaplet here. A month ago I saw the CrunchyData post and wanted to play around with the code that made it happen, it wasn't OSS so I asked for help:
> If anyone out there wants to work on an open source version of this full-time please reach out to me. [0]
Paul reached out and we started working on it almost immediately. Check out the repo here: https://github.com/snaplet/postgres-wasm
We have a blog post about some of the interesting technical challenges that we faced whilst building this: https://www.snaplet.dev/post/postgresql-in-the-browser
Like most things, this is built on-top of the amazing open-source projects that made this possible, but special mention goes to v86.js and buildroot. We just glued it together.
---
[0] Request for collaboration: https://news.ycombinator.com/item?id=32500526
What are some alternatives?
mongodb-jest-testing - Tests with jest and mongodb
microservice-rust-mysql - A template project for building a database-driven microservice in Rust and run it in the WasmEdge sandbox.
Docker Compose - Define and run multi-container applications with Docker
sadservers - SadServers: Linux & DevOps Troubleshooting Scenarios SaaS
indradb - A graph database written in rust
Greenplum - Greenplum Database - Massively Parallel PostgreSQL for Analytics. An open-source massively parallel data platform for analytics, machine learning and AI.
mongita - "Mongita is to MongoDB as SQLite is to SQL"
wasmtime - A fast and secure runtime for WebAssembly
apollo-mongoose-plugin - Apollo GraphQL plugin to add MongoDB query information on the extensions node
jest-mock-extended - Type safe mocking extensions for Jest https://www.npmjs.com/package/jest-mock-extended
sortedcontainers - Python Sorted Container Types: Sorted List, Sorted Dict, and Sorted Set
litefs - FUSE-based file system for replicating SQLite databases across a cluster of machines