@planetscale/database
Advanced tools
Comparing version 1.6.0 to 1.7.0
@@ -29,2 +29,3 @@ export { format } from './sanitization.js'; | ||
body: string; | ||
cache?: RequestCache; | ||
}; | ||
@@ -31,0 +32,0 @@ declare type Res = { |
@@ -122,3 +122,4 @@ import { format } from './sanitization.js'; | ||
Authorization: `Basic ${auth}` | ||
} | ||
}, | ||
cache: 'no-store' | ||
}); | ||
@@ -125,0 +126,0 @@ if (response.ok) { |
@@ -1,1 +0,1 @@ | ||
export declare const Version = "1.6.0"; | ||
export declare const Version = "1.7.0"; |
@@ -1,1 +0,1 @@ | ||
export const Version = '1.6.0'; | ||
export const Version = '1.7.0'; |
{ | ||
"name": "@planetscale/database", | ||
"version": "1.6.0", | ||
"version": "1.7.0", | ||
"description": "A Fetch API-compatible PlanetScale database driver", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -105,2 +105,24 @@ # PlanetScale Serverless Driver for JavaScript | ||
To leverage HTTP/2, you can use the [`fetch-h2`][1] shim. `fetch-h2` also supports Node.js 12+. | ||
[1]: https://www.npmjs.com/package/fetch-h2 | ||
```ts | ||
import { connect } from '@planetscale/database' | ||
import { context } from 'fetch-h2' | ||
const { fetch, disconnectAll } = context() | ||
const config = { | ||
fetch, | ||
host: '<host>', | ||
username: '<user>', | ||
password: '<password>' | ||
} | ||
const conn = connect(config) | ||
const results = await conn.execute('select 1 from dual') | ||
console.log(results) | ||
await disconnectAll() | ||
``` | ||
### Custom query parameter format function | ||
@@ -107,0 +129,0 @@ |
31160
390
218