# @types/pg-cursor

> TypeScript definitions for pg-cursor

Latest version **2.7.2** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/pg-cursor
pnpm add @types/pg-cursor
yarn add @types/pg-cursor
bun add @types/pg-cursor
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.7.2 |
| Published | 2023-11-07 |
| First published | 2022-03-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 5.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51450 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/pg-cursor
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/pg-cursor
- npm.io page: https://npm.io/package/@types/pg-cursor

## Dependencies (2)

- [@types/pg](https://npm.io/package/@types/pg.md) *
- [@types/node](https://npm.io/package/@types/node.md) *

## Recent versions

- 2.7.2 (latest) — 2023-11-07
- 2.7.0 (ts3.9) — 2022-05-12
- 2.7.1 — 2023-10-18
- 2.5.0 — 2022-03-29

## README

# Installation
> `npm install --save @types/pg-cursor`

# Summary
This package contains type definitions for pg-cursor (https://github.com/brianc/node-postgres#readme).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/pg-cursor.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/pg-cursor/index.d.ts)
````ts
/// <reference types="node" />

import EventEmitter = require("events");
import { Connection, CustomTypesConfig, QueryResult } from "pg";

declare namespace Cursor {
    interface CursorQueryConfig {
        /**
         * By default rows come out as a Record<string,any>.
         * Pass the string 'array' here to receive each row as an array of values.
         */
        rowMode?: "array";
        /**
         * Custom type parsers for just this query result.
         */
        types?: CustomTypesConfig;
    }
    type ResultCallback<RowType> = (err: Error | undefined, rows: RowType[], result: QueryResult) => void;
}

declare class Cursor<Row = any> extends EventEmitter {
    constructor(query: string, values?: any[], config?: Cursor.CursorQueryConfig);
    submit: (connection: Connection) => void;
    read(maxRows: number): Promise<Row[]>;
    read(maxRows: number, callback: Cursor.ResultCallback<Row>): undefined;
    read(maxRows: number, callback?: Cursor.ResultCallback<Row>): Promise<Row[]> | undefined;
    close(): Promise<void>;
    close(callback: (err: Error) => void): undefined;
    close(callback?: (err: Error) => void): Promise<void> | undefined;

    /**
     * @deprecated Cursor.end is deprecated. Call end on the client itself to end a connection to the database.
     */
    end(callback: () => void): void;
}

export = Cursor;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 09:09:39 GMT
 * Dependencies: [@types/node](https://npmjs.com/package/@types/node), [@types/pg](https://npmjs.com/package/@types/pg)

# Credits
These definitions were written by [Tiogshi Laj](https://github.com/Tiogshi), and [Elias Fauser](https://github.com/elias-fauser).

---
_Source: https://npm.io/package/@types/pg-cursor · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
