Skip to content

Commit

Permalink
docs: update changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
pffigueiredo committed Oct 7, 2024
1 parent d90ad3b commit a6a78dd
Show file tree
Hide file tree
Showing 8 changed files with 3,587 additions and 3,809 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
## UNRELEASED
## 0.10.0 (2024-10-07)

Capture stack traces in `NeonDbError`, if `Error.captureStackTrace` is available.

Allow authentication through `JWT` by adding a `authToken` property to the `neon` HTTP connection options.

## 0.9.3 (2024-05-09)

Expose all error information fields on `NeonDbError` objects thrown when using the http fetch transport.
Expand Down
16 changes: 16 additions & 0 deletions 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 seamless integration with third-party authentication systems, which ultimately allows for secure, authenticated requests to Neon, ensuring 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 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
2,447 changes: 1,182 additions & 1,265 deletions dist/jsr/index.js

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions dist/npm/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 0.10.0 (2024-10-07)

Capture stack traces in `NeonDbError`, if `Error.captureStackTrace` is available.

Allow authentication through `JWT` by adding a `authToken` property to the `neon` HTTP connection options.

## 0.9.3 (2024-05-09)

Expose all error information fields on `NeonDbError` objects thrown when using the http fetch transport.
Expand Down
2,467 changes: 1,192 additions & 1,275 deletions dist/npm/index.js

Large diffs are not rendered by default.

2,447 changes: 1,182 additions & 1,265 deletions dist/npm/index.mjs

Large diffs are not rendered by default.

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.

5 changes: 4 additions & 1 deletion export/httpQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ export class NeonDbError extends Error {
constructor(message: string) {
super(message);

if ("captureStackTrace" in Error && typeof Error.captureStackTrace === "function") {
if (
'captureStackTrace' in Error &&
typeof Error.captureStackTrace === 'function'
) {
Error.captureStackTrace(this, NeonDbError);
}
}
Expand Down

0 comments on commit a6a78dd

Please sign in to comment.