You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add RoutineOptions:Enabled flag, disable CrudSource by default, fix SqlFileSource blocked by CrudSource
- RoutineOptions now supports Enabled setting (default true) to skip routine source
- CrudSource defaults to Enabled: false (was true) - must be explicitly enabled
- CrudSource disabled no longer blocks SqlFileSource from being registered
- RoutineType.SqlFile enum value for clearer log messages
- Updated changelog
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: NpgsqlRestClient/ConfigSchemaGenerator.cs
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -289,6 +289,7 @@ public static partial class ConfigSchemaGenerator
289
289
["NpgsqlRest:DefaultServerSentEventsEventNoticeLevel"]="Default server-sent event notice message level: INFO, NOTICE, WARNING.\nWhen SSE path is set, generate SSE events for PostgreSQL notice messages with this level or higher.\nThis can be overridden for individual endpoints using comment annotations.",
290
290
["NpgsqlRest:ServerSentEventsResponseHeaders"]="Collection of custom server-sent events response headers that will be added to the response when connected to the endpoint that is configured to return server-sent events.",
291
291
["NpgsqlRest:RoutineOptions"]="Options for handling PostgreSQL routines (functions and procedures)",
292
+
["NpgsqlRest:RoutineOptions:Enabled"]="Set to false to disable the routine source (PostgreSQL functions and procedures). Default is true.",
292
293
["NpgsqlRest:RoutineOptions:CustomTypeParameterSeparator"]="Name separator for parameter names when using custom type parameters.\nParameter names will be in the format: {ParameterName}{CustomTypeParameterSeparator}{CustomTypeFieldName}. When NULL, default underscore is used.\nThis is used when using custom types for parameters. For example: with \"create type custom_type1 as (value text);\" and parameter \"_p custom_type1\", this name will be merged into \"_p_value\"",
293
294
["NpgsqlRest:RoutineOptions:IncludeLanguages"]="List of PostgreSQL routine language names to include. If NULL, all languages are included. Names are case-insensitive.",
294
295
["NpgsqlRest:RoutineOptions:ExcludeLanguages"]="List of PostgreSQL routine language names to exclude. If NULL, \"C\" and \"INTERNAL\" are excluded by default. Names are case-insensitive.",
Copy file name to clipboardExpand all lines: changelog.md
+29Lines changed: 29 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -356,6 +356,34 @@ export async function processOrder(
356
356
357
357
---
358
358
359
+
### RoutineSource: `Enabled` Configuration Option
360
+
361
+
The `RoutineOptions` section now supports an `Enabled` setting (default `true`). Set to `false` to disable automatic endpoint creation from PostgreSQL functions and procedures:
362
+
363
+
```json
364
+
"RoutineOptions": {
365
+
"Enabled": false
366
+
}
367
+
```
368
+
369
+
This is useful for SQL-files-only deployments where the overhead of querying the PostgreSQL catalog for routines is unnecessary.
370
+
371
+
---
372
+
373
+
### CrudSource Disabled by Default
374
+
375
+
The `CrudSource:Enabled` setting now defaults to `false` (was `true`).
376
+
377
+
CrudSource auto-generates CRUD endpoints for all PostgreSQL tables and views, which is rarely desired in production without explicit configuration. Users who need CRUD endpoints should explicitly set `"CrudSource": { "Enabled": true }`.
378
+
379
+
---
380
+
381
+
### CrudSource No Longer Blocks SqlFileSource
382
+
383
+
Previously, when `CrudSource` was disabled (or its config section was missing), `CreateEndpointSources()` returned early, preventing `SqlFileSource` from being registered. All three endpoint sources (RoutineSource, CrudSource, SqlFileSource) are now independently enabled/disabled.
384
+
385
+
---
386
+
359
387
### DataProtection Disabled by Default
360
388
361
389
The `DataProtection:Enabled` setting now defaults to `false` (was `true`).
@@ -368,6 +396,7 @@ Users who enable Auth, Antiforgery, or encrypt/decrypt annotations should explic
368
396
369
397
### Internal Changes
370
398
399
+
-`RoutineType.SqlFile` — new enum value for SQL file endpoints (was `Other`), shown in log messages
371
400
-`NpgsqlRestParameter.ConvertedName` / `ActualName` — `internal set` (was `private set`) for `@param` rename support
372
401
-`ParameterHandler.HandleParameterRename` — new method handling all rename/retype annotation forms
373
402
-`SqlFileParameterFormatter` — static singleton, `IsFormattable = false`, zero per-endpoint allocation
0 commit comments