@types/sql-template
TypeScript icon, indicating that this package has built-in type declarations

1.2.4 • Public • Published

Installation

npm install --save @types/sql-template

Summary

This package contains type definitions for sql-template (https://github.com/131/sql-template).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sql-template.

index.d.ts

export = SQL;
declare function SQL(parts: TemplateStringsArray, ...values: any[]): SQL.Fragment;

declare namespace SQL {
    interface Fragment {
        raw: string;
        text: string;
        values?: any[] | undefined;
    }

    type ChainFn = (values: any[], part: string) => string;

    type Transformer = (values: any[], str: string, chain: ChainFn) => void;

    function insert(table: string, values: object): Fragment;
    function insert_bulk(table: string, keys: string[], values: any[][]): Fragment;
    function update(table: string, values: object, where?: any): Fragment;
    function select(table: string, where?: any, cols?: string, extra?: string): Fragment;
    function search_blob(search_field: string, qs: string, main_field?: string, LIKE?: string): Fragment | false;

    const transformers: { [key: string]: Transformer };
}

Additional Details

  • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
  • Dependencies: none

Credits

These definitions were written by Jaap Taal.

Versions

Current Tags

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.2.4
    4
  • 1.2.3
    20
  • 1.2.2
    0
  • 1.2.1
    0
  • 1.2.0
    7

Package Sidebar

Install

npm i @types/sql-template

Weekly Downloads

14

Version

1.2.4

License

MIT

Unpacked Size

4.26 kB

Total Files

5

Last publish

Collaborators

  • types