Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: bump npm and JSR versions to v0.10.1 #107

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.10.1 (2024-10-07)

Fix `CONFIG.MD` documentation.

## 0.10.0 (2024-10-07)

Capture stack traces in `NeonDbError`, if `Error.captureStackTrace` is available.
Expand Down
2 changes: 1 addition & 1 deletion dist/jsr/jsr.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@neon/serverless",
"version": "0.9.5",
"version": "0.10.1",
"exports": "./index.js",
"imports": {
"pg": "npm:@types/[email protected]"
Expand Down
4 changes: 4 additions & 0 deletions dist/npm/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.10.1 (2024-10-07)

Fix `CONFIG.MD` documentation.

## 0.10.0 (2024-10-07)

Capture stack traces in `NeonDbError`, if `Error.captureStackTrace` is available.
Expand Down
16 changes: 16 additions & 0 deletions dist/npm/CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,22 @@ const rows = await sql('SELECT * FROM posts WHERE id = $1', [postId], {
clearTimeout(timeout);
```

### `authToken: string | (() => Promise<string> | string)`

The `authToken` option can be passed to `neon(...)` to set the `Authorization` header for the `fetch` request. This allows you to authenticate database requests against third-party authentication providers. So, this mechanism can be used to ensure that access control and authorization are managed effectively across different systems.

Example of usage:

```typescript
import { neon } from '@neondatabase/serverless';
// Retrieve the JWT token (implementation depends on your auth system)
const authToken = getAuthToken();
// Initialize the Neon client with a connection string and auth token
const sql = neon(process.env.DATABASE_URL, { authToken });
// Run a query
const posts = await sql('SELECT * FROM posts');
```

## `transaction(...)` function

The `transaction(queriesOrFn, options)` function is exposed as a property on the query function. It allows multiple queries to be executed within a single, non-interactive transaction.
Expand Down
4 changes: 2 additions & 2 deletions dist/npm/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/npm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@neondatabase/serverless",
"version": "0.9.5",
"version": "0.10.1",
"author": "Neon",
"description": "node-postgres for serverless environments from neon.tech",
"exports": {
Expand Down