hyperjumptech / monika

Monika is a command line application to monitor every part of your web app using a simple YAML configuration file. Get alert not only when your site is down but also when it's slow.
https://monika.hyperjump.tech
MIT License
599 stars 66 forks source link

Spike on moving SQLite3 to another library #1303

Closed dennypradipta closed 3 months ago

dennypradipta commented 3 months ago

SQLite3 seems broken when building Monika using Docker in Apple silicone macs. So I've made a sample POC on using Better SQLite3:

index.js

const db = require("better-sqlite3")("foobar.db", {});

const row = db.prepare("SELECT * FROM users WHERE id = ?").get(1);
console.log(row.firstName, row.lastName, row.email);

Dockerfile

FROM node:20-alpine

COPY . .
RUN npm ci

CMD ["node", "index.js"]

package.json

{
  "name": "bsqlite3",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "better-sqlite3": "^11.1.1"
  }
}

I've been able to build Dockerfile, run it using NPM, run it using Docker in Apple Silicone Macs without any issues, so moving to Better SQLite3 may helps.

haricnugraha commented 3 months ago

Please check the pull request #1304, and close the issue if it solves the issue.

dennypradipta commented 3 months ago

Closed by #1304