I'm trying to connect to Postgres sql using Deno-db, I've grabbed this code below from official documentation and edit it to connect to my local server.
import {
Database,
PostgresConnector,
} from "https://deno.land/x/[email protected]/mod.ts";
// SQLite3Connector, MySQLConnector, PostgresConnector...
const connector = new PostgresConnector({
uri: "localhost",
port: 5433,
password: "",
database: "mora",
host: "localhost",
username: "postgres",
});
// const db = new Database(connector);
// If you need debug logs, set `debug` to `true`
const db = new Database({ connector, debug: true });
The Error:
error: Module not found "https://deno.land/std/node/events.ts". at https://raw.githubusercontent.com/Zhomart/dex/930253915093e1e08d48ec0409b4aee800d8bd0c/lib-dyn/deps.ts:7:24
I've tried to change the import version from latest to the redirected version (@1.4.0)
import {
Database,
PostgresConnector,
} from "https://deno.land/x/[email protected]/mod.ts";
Still facing the same issue.
My Deno version: deno 1.35.3 (release, x86_64-apple-darwin) v8 11.6.189.12 typescript 5.1.6 Node Version: v12 to v19.
I also tried changing my IP Address using VPN.
Another question:
Is Deno-Db designed to connect to multiple Databases? Am I missing something?