@decaf-ts/for-postgres
Version:
template for ts projects
46 lines (45 loc) • 1.34 kB
TypeScript
import { SequenceOptions } from "@decaf-ts/core";
import { Sequence } from "@decaf-ts/core";
import { PostgresAdapter } from "../adapter";
/**
* @summary Abstract implementation of a Sequence
* @description provides the basic functionality for {@link Sequence}s
*
* @param {SequenceOptions} options
*
* @class PostgresSequence
* @implements Sequence
*/
export declare class PostgresSequence extends Sequence {
protected adapter: PostgresAdapter;
constructor(options: SequenceOptions, adapter: PostgresAdapter);
/**
* @summary Retrieves the current value for the sequence
* @protected
*/
current(): Promise<string | number | bigint>;
/**
* @summary Parses the {@link Sequence} value
*
* @protected
* @param value
*/
private parse;
/**
* @summary increments the sequence
* @description Sequence specific implementation
*
* @param {string | number | bigint} current
* @param count
* @protected
*/
private increment;
/**
* @summary Generates the next value in th sequence
* @description calls {@link Sequence#parse} on the current value
* followed by {@link Sequence#increment}
*
*/
next(): Promise<number | string | bigint>;
range(count: number): Promise<(number | string | bigint)[]>;
}