gajus / gajus/postgres-bridge

typescript support

Open
#7 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
28
Forks
3
PR merge metrics
No merged PRs in 30d

Description

```ts
declare module 'postgres-bridge' {
import { PoolConfig, Pool } from 'pg'; // Importing specific types from pg
import postgres from 'postgres'; // Importing the default export from postgres module

export class PostgresBridge {
constructor(configuration: PoolConfig);
/** Connect to the database */
connect(): Promise;
}

// Type alias for the default import of postgres module
type PostgresLib = typeof postgres;

/**
* Factory function to create a PostgresBridge instance
* @param postgres - the postgres library instance
*/
export function createPostgresBridge(postgres: PostgresLib): typeof PostgresBridge;
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.