Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/justaos_orm/src/core/connection/DatabaseConnectionPool.ts>default

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

DatabaseConnectionPool class manage connections to the database.

Examples

Example 1

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

});

Constructors

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

Methods

Returns a connection to the database.

createDatabase(databaseName: string): Promise<any>

Creates a database.

dropDatabase(databaseName: string): Promise<any>

Drops a database.

end(): void
executeQuery(query: string): Promise<pg.QueryResult>
getDatabaseName(): string | undefined

Returns the database name.

on(event: string, callback: any)
testConnection(): Promise<void>

Establishes a connection to the database.

Static Methods

createConnectionPoll(configuration: TDatabaseConfiguration): Promise<DatabaseConnectionPool>

Creates a connection to the database. And test the connection.