@databricks/sdk-postgres 0.1.0-dev.6 → 0.3.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.
package/dist/v1/model.js CHANGED
@@ -511,6 +511,21 @@ export const ErrorCode = {
511
511
  */
512
512
  PROVIDER_SHARE_NOT_ACCESSIBLE: 'PROVIDER_SHARE_NOT_ACCESSIBLE',
513
513
  };
514
+ /**
515
+ * Controls how the Data API exposes the OpenAPI documentation endpoint.
516
+ * Only IGNORE_PRIVILEGES and DISABLED are supported today; "follow-privileges"
517
+ * is not implemented yet (it may be added later as value 3 — adding new enum
518
+ * values is backward-compatible).
519
+ */
520
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.
521
+ export const OpenApiMode = {
522
+ /** Unspecified; the server applies its default mode. */
523
+ OPEN_API_MODE_UNSPECIFIED: 'OPEN_API_MODE_UNSPECIFIED',
524
+ /** Generate OpenAPI output ignoring the privileges of the requesting role. */
525
+ OPEN_API_MODE_IGNORE_PRIVILEGES: 'OPEN_API_MODE_IGNORE_PRIVILEGES',
526
+ /** Disable the OpenAPI documentation endpoint entirely. */
527
+ OPEN_API_MODE_DISABLED: 'OPEN_API_MODE_DISABLED',
528
+ };
514
529
  /** The current phase of the data synchronization pipeline. */
515
530
  // eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.
516
531
  export const ProvisioningPhase = {
@@ -653,6 +668,14 @@ export const Role_MembershipRole = {
653
668
  /** Indicates membership in DATABRICKS_SUPERUSER, the highest set of privileges exposed to customers. */
654
669
  DATABRICKS_SUPERUSER: 'DATABRICKS_SUPERUSER',
655
670
  };
671
+ /** PostgreSQL-specific target types that can override the default Delta-to-PG mapping. */
672
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.
673
+ export const SyncedTable_SyncedTableSpec_PgSpecificType = {
674
+ /** Default value. Indicates that no type override was selected. */
675
+ PG_SPECIFIC_TYPE_UNSPECIFIED: 'PG_SPECIFIC_TYPE_UNSPECIFIED',
676
+ /** Maps the column to the pgvector vector type. */
677
+ PG_SPECIFIC_TYPE_VECTOR: 'PG_SPECIFIC_TYPE_VECTOR',
678
+ };
656
679
  /** Scheduling policy of the synced table's underlying pipeline. */
657
680
  // eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.
658
681
  export const SyncedTable_SyncedTableSpec_SyncedTableSchedulingPolicy = {
@@ -846,6 +869,88 @@ export const unmarshalCatalog_CatalogStatusSchema = z
846
869
  branch: d.branch,
847
870
  }));
848
871
  export const unmarshalCatalogOperationMetadataSchema = z.object({});
872
+ export const unmarshalDataApiSchema = z
873
+ .object({
874
+ name: z.string().optional(),
875
+ parent: z.string().optional(),
876
+ create_time: z
877
+ .string()
878
+ .transform(s => Temporal.Instant.from(s))
879
+ .optional(),
880
+ update_time: z
881
+ .string()
882
+ .transform(s => Temporal.Instant.from(s))
883
+ .optional(),
884
+ spec: z.lazy(() => unmarshalDataApi_DataApiSpecSchema).optional(),
885
+ status: z.lazy(() => unmarshalDataApi_DataApiStatusSchema).optional(),
886
+ })
887
+ .transform(d => ({
888
+ name: d.name,
889
+ parent: d.parent,
890
+ createTime: d.create_time,
891
+ updateTime: d.update_time,
892
+ spec: d.spec,
893
+ status: d.status,
894
+ }));
895
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
896
+ export const unmarshalDataApi_DataApiSpecSchema = z
897
+ .object({
898
+ db_aggregates_enabled: z.boolean().optional(),
899
+ db_extra_search_path: z.array(z.string()).optional(),
900
+ db_max_rows: z.number().optional(),
901
+ db_schemas: z.array(z.string()).optional(),
902
+ jwt_role_claim_key: z.string().optional(),
903
+ jwt_cache_max_lifetime: z
904
+ .string()
905
+ .transform(s => Temporal.Duration.from('PT' + s.toUpperCase()))
906
+ .optional(),
907
+ openapi_mode: z.string().optional(),
908
+ server_cors_allowed_origins: z.array(z.string()).optional(),
909
+ server_timing_enabled: z.boolean().optional(),
910
+ })
911
+ .transform(d => ({
912
+ dbAggregatesEnabled: d.db_aggregates_enabled,
913
+ dbExtraSearchPath: d.db_extra_search_path,
914
+ dbMaxRows: d.db_max_rows,
915
+ dbSchemas: d.db_schemas,
916
+ jwtRoleClaimKey: d.jwt_role_claim_key,
917
+ jwtCacheMaxLifetime: d.jwt_cache_max_lifetime,
918
+ openapiMode: d.openapi_mode,
919
+ serverCorsAllowedOrigins: d.server_cors_allowed_origins,
920
+ serverTimingEnabled: d.server_timing_enabled,
921
+ }));
922
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
923
+ export const unmarshalDataApi_DataApiStatusSchema = z
924
+ .object({
925
+ db_aggregates_enabled: z.boolean().optional(),
926
+ db_extra_search_path: z.array(z.string()).optional(),
927
+ db_max_rows: z.number().optional(),
928
+ db_schemas: z.array(z.string()).optional(),
929
+ jwt_role_claim_key: z.string().optional(),
930
+ jwt_cache_max_lifetime: z
931
+ .string()
932
+ .transform(s => Temporal.Duration.from('PT' + s.toUpperCase()))
933
+ .optional(),
934
+ openapi_mode: z.string().optional(),
935
+ server_cors_allowed_origins: z.array(z.string()).optional(),
936
+ server_timing_enabled: z.boolean().optional(),
937
+ url: z.string().optional(),
938
+ available_schemas: z.array(z.string()).optional(),
939
+ })
940
+ .transform(d => ({
941
+ dbAggregatesEnabled: d.db_aggregates_enabled,
942
+ dbExtraSearchPath: d.db_extra_search_path,
943
+ dbMaxRows: d.db_max_rows,
944
+ dbSchemas: d.db_schemas,
945
+ jwtRoleClaimKey: d.jwt_role_claim_key,
946
+ jwtCacheMaxLifetime: d.jwt_cache_max_lifetime,
947
+ openapiMode: d.openapi_mode,
948
+ serverCorsAllowedOrigins: d.server_cors_allowed_origins,
949
+ serverTimingEnabled: d.server_timing_enabled,
950
+ url: d.url,
951
+ availableSchemas: d.available_schemas,
952
+ }));
953
+ export const unmarshalDataApiOperationMetadataSchema = z.object({});
849
954
  export const unmarshalDatabaseSchema = z
850
955
  .object({
851
956
  name: z.string().optional(),
@@ -1379,6 +1484,10 @@ export const unmarshalSyncedTable_SyncedTableSpecSchema = z
1379
1484
  new_pipeline_spec: z
1380
1485
  .lazy(() => unmarshalNewPipelineSpecSchema)
1381
1486
  .optional(),
1487
+ accelerated_sync: z.boolean().optional(),
1488
+ type_overrides: z
1489
+ .array(z.lazy(() => unmarshalSyncedTable_SyncedTableSpec_TypeOverrideSchema))
1490
+ .optional(),
1382
1491
  })
1383
1492
  .transform(d => ({
1384
1493
  postgresDatabase: d.postgres_database,
@@ -1390,6 +1499,20 @@ export const unmarshalSyncedTable_SyncedTableSpecSchema = z
1390
1499
  existingPipelineId: d.existing_pipeline_id,
1391
1500
  createDatabaseObjectsIfMissing: d.create_database_objects_if_missing,
1392
1501
  newPipelineSpec: d.new_pipeline_spec,
1502
+ acceleratedSync: d.accelerated_sync,
1503
+ typeOverrides: d.type_overrides,
1504
+ }));
1505
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
1506
+ export const unmarshalSyncedTable_SyncedTableSpec_TypeOverrideSchema = z
1507
+ .object({
1508
+ column_name: z.string().optional(),
1509
+ pg_type: z.string().optional(),
1510
+ size: z.number().optional(),
1511
+ })
1512
+ .transform(d => ({
1513
+ columnName: d.column_name,
1514
+ pgType: d.pg_type,
1515
+ size: d.size,
1393
1516
  }));
1394
1517
  // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
1395
1518
  export const unmarshalSyncedTable_SyncedTableStatusSchema = z
@@ -1634,6 +1757,87 @@ export const marshalCatalog_CatalogStatusSchema = z
1634
1757
  project: d.project,
1635
1758
  branch: d.branch,
1636
1759
  }));
1760
+ export const marshalDataApiSchema = z
1761
+ .object({
1762
+ name: z.string().optional(),
1763
+ parent: z.string().optional(),
1764
+ createTime: z
1765
+ .any()
1766
+ .transform((d) => d.toString())
1767
+ .optional(),
1768
+ updateTime: z
1769
+ .any()
1770
+ .transform((d) => d.toString())
1771
+ .optional(),
1772
+ spec: z.lazy(() => marshalDataApi_DataApiSpecSchema).optional(),
1773
+ status: z.lazy(() => marshalDataApi_DataApiStatusSchema).optional(),
1774
+ })
1775
+ .transform(d => ({
1776
+ name: d.name,
1777
+ parent: d.parent,
1778
+ create_time: d.createTime,
1779
+ update_time: d.updateTime,
1780
+ spec: d.spec,
1781
+ status: d.status,
1782
+ }));
1783
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
1784
+ export const marshalDataApi_DataApiSpecSchema = z
1785
+ .object({
1786
+ dbAggregatesEnabled: z.boolean().optional(),
1787
+ dbExtraSearchPath: z.array(z.string()).optional(),
1788
+ dbMaxRows: z.number().optional(),
1789
+ dbSchemas: z.array(z.string()).optional(),
1790
+ jwtRoleClaimKey: z.string().optional(),
1791
+ jwtCacheMaxLifetime: z
1792
+ .any()
1793
+ .transform((d) => d.toString().slice(2).toLowerCase())
1794
+ .optional(),
1795
+ openapiMode: z.string().optional(),
1796
+ serverCorsAllowedOrigins: z.array(z.string()).optional(),
1797
+ serverTimingEnabled: z.boolean().optional(),
1798
+ })
1799
+ .transform(d => ({
1800
+ db_aggregates_enabled: d.dbAggregatesEnabled,
1801
+ db_extra_search_path: d.dbExtraSearchPath,
1802
+ db_max_rows: d.dbMaxRows,
1803
+ db_schemas: d.dbSchemas,
1804
+ jwt_role_claim_key: d.jwtRoleClaimKey,
1805
+ jwt_cache_max_lifetime: d.jwtCacheMaxLifetime,
1806
+ openapi_mode: d.openapiMode,
1807
+ server_cors_allowed_origins: d.serverCorsAllowedOrigins,
1808
+ server_timing_enabled: d.serverTimingEnabled,
1809
+ }));
1810
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
1811
+ export const marshalDataApi_DataApiStatusSchema = z
1812
+ .object({
1813
+ dbAggregatesEnabled: z.boolean().optional(),
1814
+ dbExtraSearchPath: z.array(z.string()).optional(),
1815
+ dbMaxRows: z.number().optional(),
1816
+ dbSchemas: z.array(z.string()).optional(),
1817
+ jwtRoleClaimKey: z.string().optional(),
1818
+ jwtCacheMaxLifetime: z
1819
+ .any()
1820
+ .transform((d) => d.toString().slice(2).toLowerCase())
1821
+ .optional(),
1822
+ openapiMode: z.string().optional(),
1823
+ serverCorsAllowedOrigins: z.array(z.string()).optional(),
1824
+ serverTimingEnabled: z.boolean().optional(),
1825
+ url: z.string().optional(),
1826
+ availableSchemas: z.array(z.string()).optional(),
1827
+ })
1828
+ .transform(d => ({
1829
+ db_aggregates_enabled: d.dbAggregatesEnabled,
1830
+ db_extra_search_path: d.dbExtraSearchPath,
1831
+ db_max_rows: d.dbMaxRows,
1832
+ db_schemas: d.dbSchemas,
1833
+ jwt_role_claim_key: d.jwtRoleClaimKey,
1834
+ jwt_cache_max_lifetime: d.jwtCacheMaxLifetime,
1835
+ openapi_mode: d.openapiMode,
1836
+ server_cors_allowed_origins: d.serverCorsAllowedOrigins,
1837
+ server_timing_enabled: d.serverTimingEnabled,
1838
+ url: d.url,
1839
+ available_schemas: d.availableSchemas,
1840
+ }));
1637
1841
  export const marshalDatabaseSchema = z
1638
1842
  .object({
1639
1843
  name: z.string().optional(),
@@ -2110,6 +2314,10 @@ export const marshalSyncedTable_SyncedTableSpecSchema = z
2110
2314
  existingPipelineId: z.string().optional(),
2111
2315
  createDatabaseObjectsIfMissing: z.boolean().optional(),
2112
2316
  newPipelineSpec: z.lazy(() => marshalNewPipelineSpecSchema).optional(),
2317
+ acceleratedSync: z.boolean().optional(),
2318
+ typeOverrides: z
2319
+ .array(z.lazy(() => marshalSyncedTable_SyncedTableSpec_TypeOverrideSchema))
2320
+ .optional(),
2113
2321
  })
2114
2322
  .transform(d => ({
2115
2323
  postgres_database: d.postgresDatabase,
@@ -2121,6 +2329,20 @@ export const marshalSyncedTable_SyncedTableSpecSchema = z
2121
2329
  existing_pipeline_id: d.existingPipelineId,
2122
2330
  create_database_objects_if_missing: d.createDatabaseObjectsIfMissing,
2123
2331
  new_pipeline_spec: d.newPipelineSpec,
2332
+ accelerated_sync: d.acceleratedSync,
2333
+ type_overrides: d.typeOverrides,
2334
+ }));
2335
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
2336
+ export const marshalSyncedTable_SyncedTableSpec_TypeOverrideSchema = z
2337
+ .object({
2338
+ columnName: z.string().optional(),
2339
+ pgType: z.string().optional(),
2340
+ size: z.number().optional(),
2341
+ })
2342
+ .transform(d => ({
2343
+ column_name: d.columnName,
2344
+ pg_type: d.pgType,
2345
+ size: d.size,
2124
2346
  }));
2125
2347
  // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
2126
2348
  export const marshalSyncedTable_SyncedTableStatusSchema = z
@@ -2245,6 +2467,46 @@ const branchStatusFieldMaskSchema = {
2245
2467
  sourceBranchTime: { wire: 'source_branch_time' },
2246
2468
  stateChangeTime: { wire: 'state_change_time' },
2247
2469
  };
2470
+ const dataApiFieldMaskSchema = {
2471
+ createTime: { wire: 'create_time' },
2472
+ name: { wire: 'name' },
2473
+ parent: { wire: 'parent' },
2474
+ spec: { wire: 'spec', children: () => dataApi_DataApiSpecFieldMaskSchema },
2475
+ status: {
2476
+ wire: 'status',
2477
+ children: () => dataApi_DataApiStatusFieldMaskSchema,
2478
+ },
2479
+ updateTime: { wire: 'update_time' },
2480
+ };
2481
+ export function dataApiFieldMask(...paths) {
2482
+ return FieldMask.build(paths, dataApiFieldMaskSchema);
2483
+ }
2484
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
2485
+ const dataApi_DataApiSpecFieldMaskSchema = {
2486
+ dbAggregatesEnabled: { wire: 'db_aggregates_enabled' },
2487
+ dbExtraSearchPath: { wire: 'db_extra_search_path' },
2488
+ dbMaxRows: { wire: 'db_max_rows' },
2489
+ dbSchemas: { wire: 'db_schemas' },
2490
+ jwtCacheMaxLifetime: { wire: 'jwt_cache_max_lifetime' },
2491
+ jwtRoleClaimKey: { wire: 'jwt_role_claim_key' },
2492
+ openapiMode: { wire: 'openapi_mode' },
2493
+ serverCorsAllowedOrigins: { wire: 'server_cors_allowed_origins' },
2494
+ serverTimingEnabled: { wire: 'server_timing_enabled' },
2495
+ };
2496
+ // eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested message name.
2497
+ const dataApi_DataApiStatusFieldMaskSchema = {
2498
+ availableSchemas: { wire: 'available_schemas' },
2499
+ dbAggregatesEnabled: { wire: 'db_aggregates_enabled' },
2500
+ dbExtraSearchPath: { wire: 'db_extra_search_path' },
2501
+ dbMaxRows: { wire: 'db_max_rows' },
2502
+ dbSchemas: { wire: 'db_schemas' },
2503
+ jwtCacheMaxLifetime: { wire: 'jwt_cache_max_lifetime' },
2504
+ jwtRoleClaimKey: { wire: 'jwt_role_claim_key' },
2505
+ openapiMode: { wire: 'openapi_mode' },
2506
+ serverCorsAllowedOrigins: { wire: 'server_cors_allowed_origins' },
2507
+ serverTimingEnabled: { wire: 'server_timing_enabled' },
2508
+ url: { wire: 'url' },
2509
+ };
2248
2510
  const databaseFieldMaskSchema = {
2249
2511
  createTime: { wire: 'create_time' },
2250
2512
  databaseId: { wire: 'database_id' },