Module

x/justaos_orm/src/connection/DatabaseConnection.ts>default

JUSTAOS's ORM (Object–relational mapping) tool is built for Deno and provides transparent persistence for JavaScript objects to Postgres database.
Go to Latest
class default
import { default } from "https://dotland.deno.dev/x/justaos_orm@v9.1.2/src/connection/DatabaseConnection.ts";

DatabaseConnection class manages the connection to the database.

Examples

Example 1

 new DatabaseConnection({
  host: "127.0.0.1",
  port: 5432,
  username: "postgres",
  password: "postgres",
  database: "project-management-system"

});

Constructors

new
default(configuration: DatabaseConfiguration, logger?: Logger)

Methods

closeConnection(): Promise<void>

Closes the database connection.

connect(): Promise<void>

Establishes a connection to the database.

createDatabase(databaseName: string): Promise<any>

Creates a database.

dropDatabase(databaseName: string): Promise<any>

Drops a database.

Returns the connection pool.

getDatabaseName(): string | undefined

Returns the database name.

isDatabaseExist(databaseName: string): Promise<boolean>

Checks if a database exists.