<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

### Table of Contents

*   [timeout][1]
*   [maxPageSize][2]
*   [cacheSize][3]
*   [headers][4]
*   [backendType][5]
*   [createSQLiteThread][6]
    *   [Parameters][7]
*   [type][8]
*   [close][9]
*   [terminate][10]
*   [options][11]
*   [createHttpBackend][12]
    *   [Parameters][13]
*   [initSyncSQLite][14]
    *   [Parameters][15]
*   [open][16]
    *   [Parameters][17]
*   [close][18]
*   [exec][19]
    *   [Parameters][20]
*   [createSQLiteHTTPPool][21]
    *   [Parameters][22]

## timeout

Timeout for SQL operations (must take HTTP transfers into account)

Type: [number][23]

## maxPageSize

Maximum supported page size

Type: [number][23]

## cacheSize

Cache size in Kb

Type: [number][23]

## headers

Optional custom headers to be used when requesting data

Type: Record<[string][24], [string][24]>

## backendType

Force the type of backend

Type: (`"sync"` | `"shared"`)

## createSQLiteThread

Creates a new SQLite worker thread, can accept an optional HTTP backend for HTTP support.

The sync backend is particularly inefficient in Node.js and should never be used except for unit-testing browser
code.

### Parameters

*   `options` **SQLiteOptions?** Options object

    *   `options.http` **(VFSHTTP.Backend | `true`)?** Optional HTTP backend, either a shared one or a dedicated sync one

Returns **[Promise][25]\<SQLite.Promiser>**&#x20;

## type

The backend type

Type: (`"shared"` | `"sync"`)

## close

Close the HTTP backend waiting for clean shutdown

Type: function (): [Promise][25]\<void>

## terminate

Synchronously kill the HTTP backend

Type: function (): void

## options

The options object

Type: Options

## createHttpBackend

Creates a new HTTP backend worker that can support multiple SQLite threads.
The cache is shared only if the environment supports SharedArrayBuffer.

This is always the case in Node.js, but it requires a cross-origin isolated
environment in the browser.

### Parameters

*   `options` **VFSHTTP.Options?** Options object

Returns **VFSHTTP.Backend**&#x20;

## initSyncSQLite

Initialize synchronous SQLite in the current thread, can accept an optional HTTP backend for HTTP support.

The sync backend is particularly inefficient in Node.js and should never be used except for unit-testing browser
code.

### Parameters

*   `options` **SQLiteOptions?** Options object

    *   `options.http` **(VFSHTTP.Backend | `true`)?** Optional HTTP backend, either a shared one or a dedicated sync one

Returns **[Promise][25]\<SQLite.SQLite3>**&#x20;

## open

Open a new remote database

### Parameters

*   `url` **[string][24]** Remote database

Returns **[Promise][25]\<void>**&#x20;

## close

Dispose of the pool (stops the background workers)

Returns **[Promise][25]\<void>**&#x20;

## exec

Run an SQL statement

### Parameters

*   `sql` **[string][24]** SQL statement
*   `bind` **(Record<[string][24], SQLite.SQLBindable> | [Array][26]\<SQLite.SQLBindable>)?** Optional map of values to be bound
*   `opts` **{rowMode: `"array"`?}?**&#x20;
*   `options` **Record<[string][24], any>?** Options

    *   `options.rowMode` **(`"array"` | `"object"`)?** SQLite row format, @default array

Returns **[Promise][25]<[Array][26]\<SQLite.Row>>**&#x20;

## createSQLiteHTTPPool

Higher-level API for working with a pool

### Parameters

*   `opts` **{workers: [number][23]?, httpOptions: VFSHTTP.Options?}**&#x20;

Returns **[Promise][25]\<SQLiteHTTPPool>**&#x20;

[1]: #timeout

[2]: #maxpagesize

[3]: #cachesize

[4]: #headers

[5]: #backendtype

[6]: #createsqlitethread

[7]: #parameters

[8]: #type

[9]: #close

[10]: #terminate

[11]: #options

[12]: #createhttpbackend

[13]: #parameters-1

[14]: #initsyncsqlite

[15]: #parameters-2

[16]: #open

[17]: #parameters-3

[18]: #close-1

[19]: #exec

[20]: #parameters-4

[21]: #createsqlitehttppool

[22]: #parameters-5

[23]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number

[24]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String

[25]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise

[26]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
