Skip to content

Commit 198bfda

Browse files
vbilopavclaude
andcommitted
Move new changelog entries after existing 3.12.0 content
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent fa8e745 commit 198bfda

1 file changed

Lines changed: 54 additions & 54 deletions

File tree

changelog.md

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -10,60 +10,6 @@ Note: The changelog for the older version can be found here: [Changelog Archive]
1010

1111
---
1212

13-
### Aggregated Comment Annotation Logging
14-
15-
Comment annotation debug logs are now aggregated into a single line per endpoint instead of one line per annotation. This significantly reduces log noise during development.
16-
17-
**Before (multiple Debug lines per endpoint):**
18-
```
19-
[DBG] SQL file: who-am-i.sql mapped to GET /api/who-am-i has set HTTP by the comment annotation to GET /api/who-am-i
20-
[DBG] SQL file: who-am-i.sql mapped to GET /api/who-am-i has set REQUIRED AUTHORIZATION by the comment annotation.
21-
[DBG] SQL file: who-am-i.sql mapped to GET /api/who-am-i has set SINGLE RECORD by the comment annotation.
22-
```
23-
24-
**After (one Debug line per endpoint):**
25-
```
26-
[DBG] SQL file: who-am-i.sql mapped to GET /api/who-am-i annotations: [HTTP GET, authorize, single]
27-
```
28-
29-
The individual per-annotation log messages are still available at **Trace** level for detailed debugging.
30-
31-
---
32-
33-
### New Comment Annotation: `@single`
34-
35-
New comment annotation `single` (aliases: `single_record`, `single_result`) that returns a single record as a JSON object instead of a JSON array.
36-
37-
Works across all endpoint sources: PostgreSQL functions, SQL files, and CRUD endpoints.
38-
39-
**Usage:**
40-
41-
```sql
42-
-- PostgreSQL function
43-
CREATE FUNCTION get_user(int) RETURNS TABLE(id int, name text) ...
44-
COMMENT ON FUNCTION get_user IS 'HTTP GET
45-
@single';
46-
47-
-- SQL file
48-
-- HTTP GET
49-
-- @single
50-
-- @param $1 id
51-
SELECT id, name FROM users WHERE id = $1;
52-
```
53-
54-
**Without `@single`:** `[{"id": 1, "name": "alice"}]` (array)
55-
**With `@single`:** `{"id": 1, "name": "alice"}` (object)
56-
57-
**Behavior:**
58-
59-
- Multi-column results return a JSON object (no array wrapping)
60-
- Single unnamed column results return a bare JSON value (e.g., `"hello"`, `42`)
61-
- If the query returns multiple rows, only the first row is returned (early exit from rendering loop)
62-
- Empty results respect the `response_null` annotation: `empty_string` (default), `null_literal`, or `no_content` (204)
63-
- TypeScript client generates `Promise<IResponse>` instead of `Promise<IResponse[]>`
64-
65-
---
66-
6713
### New Endpoint Source Plugin: `NpgsqlRest.SqlFileSource`
6814

6915
In addition to the existing endpoint sources — **RoutineSource** (PostgreSQL functions and procedures) and **CrudSource** (tables and views) — NpgsqlRest now supports a third source: **SQL files**.
@@ -700,6 +646,60 @@ Works on all endpoint sources: functions, procedures, tables/views (CRUD), and S
700646

701647
---
702648

649+
### New Comment Annotation: `@single`
650+
651+
New comment annotation `single` (aliases: `single_record`, `single_result`) that returns a single record as a JSON object instead of a JSON array.
652+
653+
Works across all endpoint sources: PostgreSQL functions, SQL files, and CRUD endpoints.
654+
655+
**Usage:**
656+
657+
```sql
658+
-- PostgreSQL function
659+
CREATE FUNCTION get_user(int) RETURNS TABLE(id int, name text) ...
660+
COMMENT ON FUNCTION get_user IS 'HTTP GET
661+
@single';
662+
663+
-- SQL file
664+
-- HTTP GET
665+
-- @single
666+
-- @param $1 id
667+
SELECT id, name FROM users WHERE id = $1;
668+
```
669+
670+
**Without `@single`:** `[{"id": 1, "name": "alice"}]` (array)
671+
**With `@single`:** `{"id": 1, "name": "alice"}` (object)
672+
673+
**Behavior:**
674+
675+
- Multi-column results return a JSON object (no array wrapping)
676+
- Single unnamed column results return a bare JSON value (e.g., `"hello"`, `42`)
677+
- If the query returns multiple rows, only the first row is returned (early exit from rendering loop)
678+
- Empty results respect the `response_null` annotation: `empty_string` (default), `null_literal`, or `no_content` (204)
679+
- TypeScript client generates `Promise<IResponse>` instead of `Promise<IResponse[]>`
680+
681+
---
682+
683+
### Aggregated Comment Annotation Logging
684+
685+
Comment annotation debug logs are now aggregated into a single line per endpoint instead of one line per annotation. This significantly reduces log noise during development.
686+
687+
**Before (multiple Debug lines per endpoint):**
688+
```
689+
[DBG] SQL file: who-am-i.sql mapped to GET /api/who-am-i has set HTTP by the comment annotation to GET /api/who-am-i
690+
[DBG] SQL file: who-am-i.sql mapped to GET /api/who-am-i has set REQUIRED AUTHORIZATION by the comment annotation.
691+
[DBG] SQL file: who-am-i.sql mapped to GET /api/who-am-i has set SINGLE RECORD by the comment annotation.
692+
```
693+
694+
**After (one Debug line per endpoint):**
695+
```
696+
[DBG] SQL file: who-am-i.sql mapped to GET /api/who-am-i annotations: [HTTP GET, authorize, single]
697+
```
698+
699+
The individual per-annotation log messages are still available at **Trace** level for detailed debugging.
700+
701+
---
702+
703703
## Version [3.11.1](https://github.com/NpgsqlRest/NpgsqlRest/tree/3.11.1) (2026-03-13)
704704

705705
[Full Changelog](https://github.com/NpgsqlRest/NpgsqlRest/compare/3.11.0...3.11.1)

0 commit comments

Comments
 (0)