sqlite3 icon indicating copy to clipboard operation
sqlite3 copied to clipboard

Error: Native SQLite3 library not found, try installing SQLite3.

Open bobwatcherx opened this issue 2 years ago • 5 comments

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

bobwatcherx avatar Jul 09 '22 08:07 bobwatcherx

Do you have SQLite3 library installed on your system?

DjDeveloperr avatar Jul 09 '22 09:07 DjDeveloperr

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.

raul avatar Jul 16 '22 10:07 raul

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.

DjDeveloperr avatar Jul 16 '22 12:07 DjDeveloperr

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);

bobwatcherx avatar Jul 20 '22 09:07 bobwatcherx

I have same issue on manjaro/linux.

ralyodio avatar Aug 30 '22 13:08 ralyodio

[uncaught application error]: TypeError - db.execute is not a function

ralyodio avatar Sep 03 '22 05:09 ralyodio

You have to use 1.25.x with --allow-ffi flag

ralyodio avatar Sep 03 '22 06:09 ralyodio

Readme now explicitly states --allow-env, --allow-ffi and --unstable flags are required. So I'll be closing this issue for now.

DjDeveloperr avatar Sep 03 '22 08:09 DjDeveloperr