@platformatic/db 3.13.1 → 3.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/config.d.ts +63 -3
  2. package/package.json +12 -12
  3. package/schema.json +134 -16
package/config.d.ts CHANGED
@@ -483,7 +483,20 @@ export interface PlatformaticDatabaseConfig {
483
483
  services?: {
484
484
  [k: string]: unknown;
485
485
  }[];
486
- workers?: number | string;
486
+ workers?:
487
+ | number
488
+ | string
489
+ | {
490
+ static?: number;
491
+ dynamic?: boolean;
492
+ minimum?: number;
493
+ maximum?: number;
494
+ total?: number;
495
+ maxMemory?: number;
496
+ cooldown?: number;
497
+ gracePeriod?: number;
498
+ [k: string]: unknown;
499
+ };
487
500
  workersRestartDelay?: number | string;
488
501
  logger?: {
489
502
  level: (
@@ -567,6 +580,7 @@ export interface PlatformaticDatabaseConfig {
567
580
  rejectUnauthorized?: boolean;
568
581
  };
569
582
  };
583
+ reuseTcpPorts?: boolean;
570
584
  startTimeout?: number;
571
585
  restartOnError?: boolean | number;
572
586
  exitOnUnhandledErrors?: boolean;
@@ -691,6 +705,37 @@ export interface PlatformaticDatabaseConfig {
691
705
  };
692
706
  plugins?: string[];
693
707
  timeout?: number | string;
708
+ /**
709
+ * Configuration for exporting metrics to an OTLP endpoint
710
+ */
711
+ otlpExporter?: {
712
+ /**
713
+ * Enable or disable OTLP metrics export
714
+ */
715
+ enabled?: boolean | string;
716
+ /**
717
+ * OTLP endpoint URL (e.g., http://collector:4318/v1/metrics)
718
+ */
719
+ endpoint: string;
720
+ /**
721
+ * Interval in milliseconds between metric pushes
722
+ */
723
+ interval?: number | string;
724
+ /**
725
+ * Additional HTTP headers for authentication
726
+ */
727
+ headers?: {
728
+ [k: string]: string;
729
+ };
730
+ /**
731
+ * Service name for OTLP resource attributes
732
+ */
733
+ serviceName?: string;
734
+ /**
735
+ * Service version for OTLP resource attributes
736
+ */
737
+ serviceVersion?: string;
738
+ };
694
739
  };
695
740
  telemetry?: {
696
741
  enabled?: boolean | string;
@@ -774,13 +819,28 @@ export interface PlatformaticDatabaseConfig {
774
819
  maxTotalMemory?: number;
775
820
  minWorkers?: number;
776
821
  maxWorkers?: number;
822
+ cooldownSec?: number;
823
+ gracePeriod?: number;
824
+ /**
825
+ * @deprecated
826
+ */
777
827
  scaleUpELU?: number;
828
+ /**
829
+ * @deprecated
830
+ */
778
831
  scaleDownELU?: number;
832
+ /**
833
+ * @deprecated
834
+ */
779
835
  timeWindowSec?: number;
836
+ /**
837
+ * @deprecated
838
+ */
780
839
  scaleDownTimeWindowSec?: number;
781
- cooldownSec?: number;
840
+ /**
841
+ * @deprecated
842
+ */
782
843
  scaleIntervalSec?: number;
783
- gracePeriod?: number;
784
844
  };
785
845
  inspectorOptions?: {
786
846
  host?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/db",
3
- "version": "3.13.1",
3
+ "version": "3.15.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -66,17 +66,17 @@
66
66
  "rfdc": "^1.3.1",
67
67
  "rimraf": "^4.4.1",
68
68
  "semgrator": "^0.3.0",
69
- "@platformatic/basic": "3.13.1",
70
- "@platformatic/db-core": "3.13.1",
71
- "@platformatic/db-authorization": "3.13.1",
72
- "@platformatic/foundation": "3.13.1",
73
- "@platformatic/sql-events": "3.13.1",
74
- "@platformatic/sql-graphql": "3.13.1",
75
- "@platformatic/sql-json-schema-mapper": "3.13.1",
76
- "@platformatic/sql-mapper": "3.13.1",
77
- "@platformatic/telemetry": "3.13.1",
78
- "@platformatic/sql-openapi": "3.13.1",
79
- "@platformatic/service": "3.13.1"
69
+ "@platformatic/basic": "3.15.0",
70
+ "@platformatic/db-authorization": "3.15.0",
71
+ "@platformatic/db-core": "3.15.0",
72
+ "@platformatic/foundation": "3.15.0",
73
+ "@platformatic/service": "3.15.0",
74
+ "@platformatic/sql-graphql": "3.15.0",
75
+ "@platformatic/sql-json-schema-mapper": "3.15.0",
76
+ "@platformatic/sql-events": "3.15.0",
77
+ "@platformatic/sql-mapper": "3.15.0",
78
+ "@platformatic/sql-openapi": "3.15.0",
79
+ "@platformatic/telemetry": "3.15.0"
80
80
  },
81
81
  "engines": {
82
82
  "node": ">=22.19.0"
package/schema.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$id": "https://schemas.platformatic.dev/@platformatic/db/3.13.1.json",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/db/3.15.0.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "title": "Platformatic Database Config",
5
5
  "type": "object",
@@ -1365,14 +1365,34 @@
1365
1365
  "useHttp": {
1366
1366
  "type": "boolean"
1367
1367
  },
1368
+ "reuseTcpPorts": {
1369
+ "type": "boolean",
1370
+ "default": true
1371
+ },
1368
1372
  "workers": {
1369
1373
  "anyOf": [
1370
1374
  {
1371
- "type": "number",
1372
- "minimum": 1
1375
+ "type": "number"
1373
1376
  },
1374
1377
  {
1375
1378
  "type": "string"
1379
+ },
1380
+ {
1381
+ "type": "object",
1382
+ "properties": {
1383
+ "static": {
1384
+ "type": "number",
1385
+ "minimum": 1
1386
+ },
1387
+ "minimum": {
1388
+ "type": "number",
1389
+ "minimum": 1
1390
+ },
1391
+ "maximum": {
1392
+ "type": "number",
1393
+ "minimum": 0
1394
+ }
1395
+ }
1376
1396
  }
1377
1397
  ]
1378
1398
  },
@@ -1593,6 +1613,43 @@
1593
1613
  },
1594
1614
  {
1595
1615
  "type": "string"
1616
+ },
1617
+ {
1618
+ "type": "object",
1619
+ "properties": {
1620
+ "static": {
1621
+ "type": "number",
1622
+ "minimum": 1
1623
+ },
1624
+ "dynamic": {
1625
+ "type": "boolean",
1626
+ "default": false
1627
+ },
1628
+ "minimum": {
1629
+ "type": "number",
1630
+ "minimum": 1
1631
+ },
1632
+ "maximum": {
1633
+ "type": "number",
1634
+ "minimum": 0
1635
+ },
1636
+ "total": {
1637
+ "type": "number",
1638
+ "minimum": 1
1639
+ },
1640
+ "maxMemory": {
1641
+ "type": "number",
1642
+ "minimum": 0
1643
+ },
1644
+ "cooldown": {
1645
+ "type": "number",
1646
+ "minimum": 0
1647
+ },
1648
+ "gracePeriod": {
1649
+ "type": "number",
1650
+ "minimum": 0
1651
+ }
1652
+ }
1596
1653
  }
1597
1654
  ]
1598
1655
  },
@@ -1878,6 +1935,10 @@
1878
1935
  },
1879
1936
  "additionalProperties": false
1880
1937
  },
1938
+ "reuseTcpPorts": {
1939
+ "type": "boolean",
1940
+ "default": true
1941
+ },
1881
1942
  "startTimeout": {
1882
1943
  "default": 30000,
1883
1944
  "type": "number",
@@ -2369,6 +2430,58 @@
2369
2430
  }
2370
2431
  ],
2371
2432
  "default": 10000
2433
+ },
2434
+ "otlpExporter": {
2435
+ "type": "object",
2436
+ "description": "Configuration for exporting metrics to an OTLP endpoint",
2437
+ "properties": {
2438
+ "enabled": {
2439
+ "anyOf": [
2440
+ {
2441
+ "type": "boolean"
2442
+ },
2443
+ {
2444
+ "type": "string"
2445
+ }
2446
+ ],
2447
+ "description": "Enable or disable OTLP metrics export"
2448
+ },
2449
+ "endpoint": {
2450
+ "type": "string",
2451
+ "description": "OTLP endpoint URL (e.g., http://collector:4318/v1/metrics)"
2452
+ },
2453
+ "interval": {
2454
+ "anyOf": [
2455
+ {
2456
+ "type": "integer"
2457
+ },
2458
+ {
2459
+ "type": "string"
2460
+ }
2461
+ ],
2462
+ "default": 60000,
2463
+ "description": "Interval in milliseconds between metric pushes"
2464
+ },
2465
+ "headers": {
2466
+ "type": "object",
2467
+ "additionalProperties": {
2468
+ "type": "string"
2469
+ },
2470
+ "description": "Additional HTTP headers for authentication"
2471
+ },
2472
+ "serviceName": {
2473
+ "type": "string",
2474
+ "description": "Service name for OTLP resource attributes"
2475
+ },
2476
+ "serviceVersion": {
2477
+ "type": "string",
2478
+ "description": "Service version for OTLP resource attributes"
2479
+ }
2480
+ },
2481
+ "required": [
2482
+ "endpoint"
2483
+ ],
2484
+ "additionalProperties": false
2372
2485
  }
2373
2486
  },
2374
2487
  "additionalProperties": false
@@ -2528,35 +2641,40 @@
2528
2641
  "type": "number",
2529
2642
  "minimum": 1
2530
2643
  },
2644
+ "cooldownSec": {
2645
+ "type": "number",
2646
+ "minimum": 0
2647
+ },
2648
+ "gracePeriod": {
2649
+ "type": "number",
2650
+ "minimum": 0
2651
+ },
2531
2652
  "scaleUpELU": {
2532
2653
  "type": "number",
2533
2654
  "minimum": 0,
2534
- "maximum": 1
2655
+ "maximum": 1,
2656
+ "deprecated": true
2535
2657
  },
2536
2658
  "scaleDownELU": {
2537
2659
  "type": "number",
2538
2660
  "minimum": 0,
2539
- "maximum": 1
2661
+ "maximum": 1,
2662
+ "deprecated": true
2540
2663
  },
2541
2664
  "timeWindowSec": {
2542
2665
  "type": "number",
2543
- "minimum": 0
2666
+ "minimum": 0,
2667
+ "deprecated": true
2544
2668
  },
2545
2669
  "scaleDownTimeWindowSec": {
2546
2670
  "type": "number",
2547
- "minimum": 0
2548
- },
2549
- "cooldownSec": {
2550
- "type": "number",
2551
- "minimum": 0
2671
+ "minimum": 0,
2672
+ "deprecated": true
2552
2673
  },
2553
2674
  "scaleIntervalSec": {
2554
2675
  "type": "number",
2555
- "minimum": 0
2556
- },
2557
- "gracePeriod": {
2558
- "type": "number",
2559
- "minimum": 0
2676
+ "minimum": 0,
2677
+ "deprecated": true
2560
2678
  }
2561
2679
  },
2562
2680
  "additionalProperties": false