Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@planetscale/database

Package Overview
Dependencies
Maintainers
6
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@planetscale/database - npm Package Compare versions

Comparing version 1.5.0 to 1.6.0

5

dist/index.d.ts

@@ -21,4 +21,4 @@ export { format } from './sanitization.js';

statement: string;
insertId: string | null;
rowsAffected: number | null;
insertId: string;
rowsAffected: number;
time: number;

@@ -63,2 +63,3 @@ }

as?: ExecuteAs;
cast?: Cast;
};

@@ -65,0 +66,0 @@ declare type ExecuteArgs = object | any[] | null;

7

dist/index.js

@@ -80,4 +80,4 @@ import { format } from './sanitization.js';

}
const rowsAffected = result?.rowsAffected ? parseInt(result.rowsAffected, 10) : null;
const insertId = result?.insertId ?? null;
const rowsAffected = result?.rowsAffected ? parseInt(result.rowsAffected, 10) : 0;
const insertId = result?.insertId ?? '0';
this.session = session;

@@ -88,3 +88,4 @@ const fields = result?.fields ?? [];

}
const rows = result ? parse(result, this.config.cast || cast, options.as || 'object') : [];
const castFn = options.cast || this.config.cast || cast;
const rows = result ? parse(result, castFn, options.as || 'object') : [];
const headers = fields.map((f) => f.name);

@@ -91,0 +92,0 @@ const typeByName = (acc, { name, type }) => ({ ...acc, [name]: type });

@@ -1,1 +0,1 @@

export declare const Version = "1.5.0";
export declare const Version = "1.6.0";

@@ -1,1 +0,1 @@

export const Version = '1.5.0';
export const Version = '1.6.0';
{
"name": "@planetscale/database",
"version": "1.5.0",
"version": "1.6.0",
"description": "A Fetch API-compatible PlanetScale database driver",
"main": "dist/index.js",
"types": "dist/index.d.js",
"types": "dist/index.d.ts",
"files": [

@@ -8,0 +8,0 @@ "dist"

@@ -156,2 +156,19 @@ # PlanetScale Serverless Driver for JavaScript

You can also pass a custom `cast` function to `execute`. If present, this will override the `cast` function set by the connection:
```ts
const result = await conn.execute(
'SELECT userId, SUM(balance) AS balance FROM UserBalanceItem GROUP BY userId',
{},
{
cast: (field, value) => {
if (field.name === 'balance') {
return BigInt(value)
}
return cast(field, value)
}
}
)
```
### Row return values

@@ -158,0 +175,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc