sqlite3
sqlite3 copied to clipboard
Error: Native SQLite3 library not found, try installing SQLite3.
import { Database } from "https://deno.land/x/[email protected]/mod.ts";
// Open a database export const client = new Database("../tolol.db");
info : deno --version deno 1.23.3 (release, x86_64-unknown-linux-gnu) v8 10.4.132.8 typescript 4.7.4
error message :
error: Error: Native SQLite3 library not found, try installing SQLite3. If you have an existing installation, either add it to path or set the DENO_SQLITE_PATH
environment variable.
at https://deno.land/x/[email protected]/src/ffi.ts:425:17
Do you have SQLite3 library installed on your system?
I got the same error message despite having the SQLite3 library installed and setting the DENO_SQLITE_PATH
env. variable.
In my case the problem was that I forgot to include the --unstable
flag when running the deno
command, which caused an Uncaught TypeError: Deno.dlopen is not a function
. It got caught here, but it didn't get thrown because it's a TypeError
, generating the (this time unrelated) "Native SQLite3 library not found..." error message.
Oh right, we should show the exact error as cause of our custom error message to user. A PR would be appreciated! Or I can do it when I get home.
I installed on the system with sqlite3
sqlite3 tolol.db
in it there is a table that is already filled with data
when deno run table seems not detected with error like:
deno run -A --unstable main.ts
error: Uncaught Error: (1) SQL logic error: no such table: student
throw new Error((${result}) ${sqlite3_errstr(result)}: ${msg}
);
^
my code:
import { Database } from "https://deno.land/x/[email protected]/mod.ts";
// Open a database export const db = new Database("../tolol.db"); const siswa = db.queryArray("select * from siswa"); console.log(version);
I have same issue on manjaro/linux.
[uncaught application error]: TypeError - db.execute is not a function
You have to use 1.25.x with --allow-ffi flag
Readme now explicitly states --allow-env
, --allow-ffi
and --unstable
flags are required. So I'll be closing this issue for now.