# @types/sql-template

> TypeScript definitions for sql-template

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

## Install

```sh
npm install @types/sql-template
pnpm add @types/sql-template
yarn add @types/sql-template
bun add @types/sql-template
```

## 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 | 1.2.4 |
| Published | 2023-11-07 |
| First published | 2018-11-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51445 |
| Maintainers | types |

## Links

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

## Recent versions

- 1.2.4 (latest) — 2023-11-07
- 1.2.1 (ts3.6) — 2021-07-06
- 1.2.0 (ts2.2) — 2018-11-06
- 1.2.3 — 2023-10-18
- 1.2.2 — 2023-09-25

## README

# 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](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sql-template/index.d.ts)
````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](https://github.com/q42jaap).

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