@planetscale/database
Advanced tools
Comparing version 1.4.0 to 1.4.1
@@ -86,2 +86,5 @@ import { format } from './sanitization.js'; | ||
const fields = result?.fields ?? []; | ||
for (const field of fields) { | ||
field.type || (field.type = 'NULL'); | ||
} | ||
const rows = result ? parse(result, this.config.cast || cast, options.as || 'object') : []; | ||
@@ -162,3 +165,3 @@ const headers = fields.map((f) => f.name); | ||
function decodeRow(row) { | ||
const values = atob(row.values); | ||
const values = row.values ? atob(row.values) : ''; | ||
let offset = 0; | ||
@@ -165,0 +168,0 @@ return row.lengths.map((size) => { |
@@ -1,1 +0,1 @@ | ||
export declare const Version = "1.4.0"; | ||
export declare const Version = "1.4.1"; |
@@ -1,1 +0,1 @@ | ||
export const Version = '1.4.0'; | ||
export const Version = '1.4.1'; |
{ | ||
"name": "@planetscale/database", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"description": "A Fetch API-compatible PlanetScale database driver", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -156,2 +156,15 @@ # PlanetScale Serverless Driver for JavaScript | ||
### Row return values | ||
Rows can be returned as an object or an array of column values by passing an `as` option to `execute`. | ||
```ts | ||
const query = 'select 1 as one, 2 as two where 1=?' | ||
const objects = conn.execute(query, [1], { as: 'object' }) | ||
// objects.rows => [{one: '1', two: '2'}] | ||
const arrays = conn.execute(query, [1], { as: 'array' }) | ||
// arrays.rows => [['1', '2']] | ||
``` | ||
## Development | ||
@@ -158,0 +171,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30142
387
179