Show HN: I open-sourced the in-memory PostgreSQL I built at work for E2E tests

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
surveyjs.io
featured
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
  • pgmock

    In-memory Postgres for unit/E2E tests

  • Thanks for suggesting that. Looks like they've implemented that here:

    https://github.com/stackframe-projects/pgmock/commit/f80d9fa...

    It seems to have beendeployed out to the demo already as it's working now. :)

  • pglite

    Lightweight Postgres packaged as WASM into a TypeScript library for the browser, Node.js, Bun and Deno

  • Hey HN! For a few months, I've been building pgmock at work for our E2E and unit test suite. It emulates Postgres in WebAssembly and has full feature parity with production databases.

    The cool thing about it is that you don't need any external processes or proxies. If your platform can run WASM (Node.js, browser, etc.), it can probably run pgmock. Creating a new database with mock data is as simple as creating a JavaScript object.

    It's a bit different from the amazing pglite [1] (which inspired me to open-source pgmock in the first place). While pgmock runs an x86 emulator, pglite compiles a Postgres fork to native WASM directly and is hence much faster and more lightweight. However, it only supports single-user mode and a select few extensions, so you can't connect to it with normal Postgres clients (which is quite crucial for E2E testing).

    Theoretically, it could be modified to run any Docker image on WebAssembly platforms. Anything specific you'd like to see?

    Happy hacking!

    [1] https://github.com/electric-sql/pglite

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • testcontainers-node

    Testcontainers is a NodeJS library that supports tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container.

  • I don't get it either. Why not use something like https://testcontainers.com/?

  • ffmpeg.wasm

    FFmpeg for browser, powered by WebAssembly

  • There's already ffmpeg wasm. I've used it in projects. Works great.

    https://github.com/ffmpegwasm/ffmpeg.wasm

  • pg-mem

    An in memory postgres DB instance for your unit tests

  • I've used pgmem https://github.com/oguimbal/pg-mem for the last couple of years for the same thing.

  • sox-emscripten

    WASM port of SoX (Sound eXchange) using Emscripten, for use in the browser.

  • pglite-server

  • For prisma/nodejs devs who just want postgres-in-a-can for local dev you are better off using the recently released serverizing of pglite, pglite-server: https://github.com/kamilogorek/pglite-server

    It's faster, can persist data to fs, though less stable under heavy use than the full x86 emu e2e test server. I found pglite-server uses only 150MB ram compared to 830MB for pgmock-server. You can then use dotenv to checkout a new .env.local with updated DATABASE_URL for all your nextjs/prisma package.json run scripts

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • gleam

    ⭐️ A friendly language for building type-safe, scalable systems!

  • If you use languages that compile to WASM (such as Gleam https://gleam.run), and can also run Postgres via WASM, then it opens very interesting offline scenarios with codebases which are similar on both the client and the server, for instance.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Spring Tests with TestContainers

    2 projects | dev.to | 15 May 2024
  • Handling Audit Logging in Node.js

    7 projects | dev.to | 12 May 2024
  • Multiple MongoDB Databases on Spring Boot

    1 project | dev.to | 12 Apr 2024
  • Run and test DynamoDB applications locally using Docker and Testcontainers

    3 projects | dev.to | 7 Feb 2024
  • API completa em Golang - Parte 7

    3 projects | dev.to | 3 Feb 2024