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

@neondatabase/serverless

Package Overview
Dependencies
Maintainers
6
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@neondatabase/serverless - npm Package Compare versions

Comparing version 0.10.1 to 0.10.2

4

CHANGELOG.md

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

## 0.10.2 (2024-11-05)
Expose `types` property on public HTTPQueryOptions type
## 0.10.1 (2024-10-07)

@@ -2,0 +6,0 @@

@@ -111,2 +111,25 @@ # Options and configuration

### `types: typeof PgTypes`
The `types` option can be passed to `neon(...)` to override the default PostgreSQL type parsers provided by `PgTypes`. This is useful if you want to define custom parsing behavior for specific PostgreSQL data types, allowing you to control how data is converted when retrieved from the database. Learn more in the [PgTypes official documentation](https://github.com/brianc/node-pg-types).
Example of usage:
```typescript
import PgTypes from 'pg-types';
import { neon } from '@neondatabase/serverless';
// Define custom parsers for specific PostgreSQL types
// Parse PostgreSQL `DATE` fields as JavaScript `Date` objects
PgTypes.setTypeParser(PgTypes.builtins.DATE, (val) => new Date(val));
// Parse PostgreSQL `NUMERIC` fields as JavaScript `float` values
PgTypes.setTypeParser(PgTypes.builtins.NUMERIC, parseFloat);
// Configure the Neon client with the custom `types` parser
const sql = neon(process.env.DATABASE_URL, {
types: PgTypes, // Pass in the custom PgTypes object here
});
```
### `authToken: string | (() => Promise<string> | string)`

@@ -113,0 +136,0 @@

@@ -166,2 +166,3 @@

PoolClient as PgPoolClient,
types as PgTypes
} from "pg";

@@ -244,2 +245,8 @@

authToken?: string | (() => Promise<string> | string);
/**
* Custom type parsers
* See https://github.com/brianc/node-pg-types
*/
types?: typeof PgTypes;
}

@@ -246,0 +253,0 @@

2

package.json
{
"name": "@neondatabase/serverless",
"version": "0.10.1",
"version": "0.10.2",
"author": "Neon",

@@ -5,0 +5,0 @@ "description": "node-postgres for serverless environments from neon.tech",

Sorry, the diff of this file is not supported yet

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