denodrivers / sqlite3

The fastest and correct SQLite3 module for Deno runtime
https://jsr.io/@db/sqlite
Apache License 2.0
265 stars 22 forks source link

not working inside docker #64

Closed jqueryisamonad closed 2 years ago

jqueryisamonad commented 2 years ago

Dockerfile

FROM denoland/deno:1.26.2
WORKDIR /app
ADD . .
RUN deno cache main.ts
CMD ["run", "-A", "--unstable", "main.ts"]

main.ts

import * as sqlite from "https://deno.land/x/sqlite3@0.6.1/mod.ts";

const db = new sqlite.Database("test.db");

const [version] = db.prepare("select sqlite_version()").value<[string]>()!;
console.log(version);

db.close();

docker build and run (failed silently without any error)

image
tracker1 commented 2 years ago

This may well not work, but possibly worth a try...

Create an init.ts that creates an instance of :memory: and run it during build, just to make sure the libsqlite3.so is downloaded? Could also try installing the system library (apt?) etc.

exe-dealer commented 2 years ago

deno v1.26.2 is broken, use v1.27.0 (or v1.26.1) https://github.com/denoland/deno/issues/16348

DjDeveloperr commented 2 years ago

Is this still an issue?

DjDeveloperr commented 2 years ago

Seems like its not.