@palbase/backend 33.0.2 → 34.0.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 (81) hide show
  1. package/dist/bin/palbase-backend.cjs +2020 -350
  2. package/dist/bin/palbase-backend.cjs.map +1 -1
  3. package/dist/bin/palbase-backend.js +9 -7
  4. package/dist/bin/palbase-backend.js.map +1 -1
  5. package/dist/{chunk-SI4KGEM3.js → chunk-FOWA7PF4.js} +97 -96
  6. package/dist/chunk-FOWA7PF4.js.map +1 -0
  7. package/dist/chunk-GHNC2UHS.js +20 -0
  8. package/dist/chunk-GHNC2UHS.js.map +1 -0
  9. package/dist/{chunk-AAT5G7KY.js → chunk-JJW3L62T.js} +2 -2
  10. package/dist/chunk-JJW3L62T.js.map +1 -0
  11. package/dist/{chunk-TVCCR6SO.js → chunk-LOGL2ZHD.js} +58 -9
  12. package/dist/chunk-LOGL2ZHD.js.map +1 -0
  13. package/dist/{chunk-C6COAB3E.js → chunk-MNGZE2MM.js} +1651 -186
  14. package/dist/chunk-MNGZE2MM.js.map +1 -0
  15. package/dist/{chunk-XOX6RFPZ.js → chunk-PRH45NZU.js} +46 -3
  16. package/dist/chunk-PRH45NZU.js.map +1 -0
  17. package/dist/{chunk-26GH54D2.js → chunk-RZLY4BOY.js} +5 -3
  18. package/dist/{chunk-26GH54D2.js.map → chunk-RZLY4BOY.js.map} +1 -1
  19. package/dist/{chunk-YIQ4RS4F.js → chunk-SEM36BWY.js} +283 -5
  20. package/dist/chunk-SEM36BWY.js.map +1 -0
  21. package/dist/{chunk-KATPXCJ5.js → chunk-UMESJJRS.js} +19 -40
  22. package/dist/chunk-UMESJJRS.js.map +1 -0
  23. package/dist/chunk-VXPNPVAG.js +40 -0
  24. package/dist/chunk-VXPNPVAG.js.map +1 -0
  25. package/dist/{chunk-WWUG2QXF.js → chunk-YX7UA7VC.js} +53 -4
  26. package/dist/chunk-YX7UA7VC.js.map +1 -0
  27. package/dist/db/env.cjs.map +1 -1
  28. package/dist/db/env.d.cts +2 -0
  29. package/dist/db/env.d.ts +2 -0
  30. package/dist/db/index.cjs +261 -2
  31. package/dist/db/index.cjs.map +1 -1
  32. package/dist/db/index.d.cts +46 -3
  33. package/dist/db/index.d.ts +46 -3
  34. package/dist/db/index.js +14 -5
  35. package/dist/{index-DMZG3kpo.d.ts → endpoint-DpNUx-ON.d.ts} +315 -57
  36. package/dist/{index-DB_nW-AV.d.cts → endpoint-kYgEHrrV.d.cts} +315 -57
  37. package/dist/engine/index.cjs +2026 -348
  38. package/dist/engine/index.cjs.map +1 -1
  39. package/dist/engine/index.d.cts +5 -5
  40. package/dist/engine/index.d.ts +5 -5
  41. package/dist/engine/index.js +17 -7
  42. package/dist/{index-D-3duy8Y.d.ts → index-JrHqNsjQ.d.ts} +108 -50
  43. package/dist/{index-DLveQoOf.d.cts → index-pnDsEfxJ.d.cts} +108 -50
  44. package/dist/index.cjs +616 -254
  45. package/dist/index.cjs.map +1 -1
  46. package/dist/index.d.cts +7 -6
  47. package/dist/index.d.ts +7 -6
  48. package/dist/index.js +25 -15
  49. package/dist/index.js.map +1 -1
  50. package/dist/openapi/index.cjs +7 -0
  51. package/dist/openapi/index.cjs.map +1 -1
  52. package/dist/openapi/index.d.cts +3 -3
  53. package/dist/openapi/index.d.ts +3 -3
  54. package/dist/openapi/index.js +4 -3
  55. package/dist/openapi/index.js.map +1 -1
  56. package/dist/{registry-DSTThhKf.d.cts → registry-BcOd8Zhf.d.cts} +3 -1
  57. package/dist/{registry-JjF5lcj4.d.ts → registry-BoX5iNyY.d.ts} +3 -1
  58. package/dist/test/index.cjs +103 -66
  59. package/dist/test/index.cjs.map +1 -1
  60. package/dist/test/index.d.cts +3 -3
  61. package/dist/test/index.d.ts +3 -3
  62. package/dist/test/index.js +33 -7
  63. package/dist/test/index.js.map +1 -1
  64. package/docs/README.md +1 -1
  65. package/docs/database.md +308 -0
  66. package/docs/examples/check-query-contracts.ts +5 -0
  67. package/docs/examples/database-dx.contract.json +65 -0
  68. package/docs/examples/database-dx.ts +63 -0
  69. package/docs/examples/money-transfer.ts +73 -0
  70. package/docs/llms-full.txt +309 -1
  71. package/package.json +1 -2
  72. package/template/package.json +1 -1
  73. package/dist/chunk-AAT5G7KY.js.map +0 -1
  74. package/dist/chunk-C6COAB3E.js.map +0 -1
  75. package/dist/chunk-KATPXCJ5.js.map +0 -1
  76. package/dist/chunk-SI4KGEM3.js.map +0 -1
  77. package/dist/chunk-TVCCR6SO.js.map +0 -1
  78. package/dist/chunk-WWUG2QXF.js.map +0 -1
  79. package/dist/chunk-XOX6RFPZ.js.map +0 -1
  80. package/dist/chunk-YIQ4RS4F.js.map +0 -1
  81. package/stack-images.json +0 -24
@@ -1,8 +1,112 @@
1
- import { Schemas, Tables, TableTypes } from './db/env.cjs';
2
1
  import { ZodSchema, z } from 'zod';
3
2
  import { PalbaseFlagKey, Buckets, BucketTypes, PalbaseSecretName } from './stack.cjs';
3
+ import { Schemas, Tables, TableTypes } from './db/env.cjs';
4
4
  import { AsyncLocalStorage } from 'node:async_hooks';
5
5
 
6
+ interface CommandOptions {
7
+ /** auto uses the sequential plan when a command cannot be compiled or the
8
+ * executor is not installed. compiled refuses fallback; sequential opts out. */
9
+ mode?: "auto" | "compiled" | "sequential";
10
+ }
11
+
12
+ interface InsertManyOptions<Key extends string = string> {
13
+ onConflict?: readonly Key[];
14
+ /** Defaults to ignore when onConflict is supplied. */
15
+ action?: "ignore" | "update";
16
+ /** false returns the affected row count and skips row serialization. */
17
+ returning?: boolean;
18
+ }
19
+
20
+ /** Forward and backward requests are exclusive. Omit the size for 50 rows. */
21
+ type PageNavigation = {
22
+ first?: number;
23
+ after?: string;
24
+ last?: never;
25
+ before?: never;
26
+ } | {
27
+ last?: number;
28
+ before?: string;
29
+ first?: never;
30
+ after?: never;
31
+ };
32
+ interface PageInfo {
33
+ startCursor: string | null;
34
+ endCursor: string | null;
35
+ hasNextPage: boolean;
36
+ hasPreviousPage: boolean;
37
+ }
38
+ interface Page<Row> {
39
+ rows: Row[];
40
+ pageInfo: PageInfo;
41
+ }
42
+ /** The raw transport surface. Typed tables restrict column and relation names. */
43
+ type RawPageOptions = PageNavigation & {
44
+ orderBy?: {
45
+ column: string;
46
+ direction?: "asc" | "desc";
47
+ nulls?: "first" | "last";
48
+ } | readonly {
49
+ column: string;
50
+ direction?: "asc" | "desc";
51
+ nulls?: "first" | "last";
52
+ }[];
53
+ select?: readonly string[];
54
+ with?: Record<string, unknown>;
55
+ };
56
+
57
+ interface DatabaseBudget {
58
+ /** Application statements, including failed statements and retry attempts. */
59
+ maxQueries?: number;
60
+ /** Root rows returned across application statements. Nested relation rows are included in bytes. */
61
+ maxRows?: number;
62
+ /** Estimated JSON result bytes; this is not PostgreSQL protocol traffic. */
63
+ maxBytes?: number;
64
+ }
65
+ interface DatabaseQueryEvent {
66
+ ordinal: number;
67
+ fingerprint: string;
68
+ name?: string;
69
+ sql?: string;
70
+ source?: string;
71
+ durationMs: number;
72
+ rows: number;
73
+ bytes: number;
74
+ errorCode?: string;
75
+ }
76
+ interface DatabaseDiagnostics {
77
+ endpoint?: string;
78
+ requestId?: string;
79
+ outcome: "active" | "committed" | "failed";
80
+ elapsedMs: number;
81
+ queries: number;
82
+ rows: number;
83
+ bytes: number;
84
+ queueMs: number;
85
+ /** Time until the driver's transaction callback starts; includes wire BEGIN. */
86
+ poolMs: number;
87
+ setupMs: number;
88
+ /** Driver wait including PostgreSQL execution/locks and network time. */
89
+ sqlMs: number;
90
+ commitMs: number;
91
+ rollbackMs: number;
92
+ commits: number;
93
+ commitFailures: number;
94
+ rollbackRequests: number;
95
+ retries: number;
96
+ /** Bounded to the first 200 completed statements. Totals include every statement. */
97
+ statements: readonly DatabaseQueryEvent[];
98
+ }
99
+ interface DatabaseDiagnosticsOptions extends DatabaseBudget {
100
+ endpoint?: string;
101
+ requestId?: string;
102
+ /** Opt-in because a stack capture costs work on every statement. */
103
+ captureSource?: boolean;
104
+ /** SQL parameters are never recorded. Raw SQL text can contain inline literals. */
105
+ includeSql?: boolean;
106
+ onQuery?: (event: DatabaseQueryEvent) => void | Promise<void>;
107
+ onComplete?: (diagnostics: DatabaseDiagnostics) => void | Promise<void>;
108
+ }
109
+
6
110
  /** Supported HTTP methods for endpoints. */
7
111
  type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
8
112
  /**
@@ -144,6 +248,13 @@ type MiddlewareHandler = (ctx: MiddlewareContext, next: () => Promise<void>) =>
144
248
  */
145
249
  declare function defineMiddleware(_fn: MiddlewareHandler): never;
146
250
 
251
+ /** A union of exact keys, not a partial row that could match many records. */
252
+ type UniqueWhere<Row, Keys> = Keys extends readonly (infer Key extends readonly string[])[] ? Key extends unknown ? {
253
+ [K in Extract<Key[number], keyof Row>]-?: NonNullable<Row[K]>;
254
+ } & {
255
+ [K in Exclude<keyof Row, Key[number]>]?: never;
256
+ } : never : never;
257
+
147
258
  /** On delete action for foreign key references. */
148
259
  type OnDeleteAction = 'cascade' | 'set null' | 'restrict' | 'no action';
149
260
  /**
@@ -2938,23 +3049,95 @@ declare const Flags: PalbaseFlagsAmbient;
2938
3049
  */
2939
3050
  declare const Realtime: PalbaseRealtimeClient;
2940
3051
 
2941
- /**
2942
- * typed-db.ts Task 2: TypedDB schema-derived insert/row shapes.
2943
- *
2944
- * Derives INSERT and full-row TypeScript types from a `defineSchema()` result
2945
- * and wraps the untyped runtime `DBClient` with a typed facade.
2946
- *
2947
- * No value-any. No `as unknown as X`. The two narrow `as` casts in
2948
- * `makeTypedTable` are safe because:
2949
- * - `data as Record<string, unknown>`: InsertShape<T> maps string keys to
2950
- * typed values; all value types are subsets of `unknown`, so the cast is
2951
- * structurally sound.
2952
- * - `result as RowShape<T>`: The runtime DBClient returns `Record<string,
2953
- * unknown>` which is the erased form of the typed row; we're narrowing back
2954
- * to the precise shape that the schema declared.
2955
- * Both casts are narrowing only (not widening) and correctness is guaranteed
2956
- * by the schema the caller provides.
2957
- */
3052
+ /** Limits apply per engine process. PostgreSQL locks remain the authority when
3053
+ * several replicas write the same rows. Size the total budget across replicas. */
3054
+ interface WorkloadOptions {
3055
+ concurrency: number;
3056
+ queueLimit: number;
3057
+ tenantConcurrency?: number;
3058
+ tenantQueueLimit?: number;
3059
+ queueTimeoutMs?: number;
3060
+ /** Read from authenticated claims; defaults to tenant_id, then sub, then one
3061
+ * shared anonymous bucket. A request body never chooses the tenant budget. */
3062
+ tenantClaim?: string;
3063
+ }
3064
+ interface DatabaseWorkload {
3065
+ readonly name: string;
3066
+ readonly concurrency: number;
3067
+ readonly queueLimit: number;
3068
+ readonly tenantConcurrency: number;
3069
+ readonly tenantQueueLimit: number;
3070
+ readonly queueTimeoutMs: number;
3071
+ readonly tenantClaim: string;
3072
+ }
3073
+ /** Declare once at module scope and reuse on $atomic calls. Keys, queue limits
3074
+ * and tenant budgets affect admission, not SQL permissions or isolation. */
3075
+ declare function defineWorkload(name: string, options: WorkloadOptions): DatabaseWorkload;
3076
+
3077
+ /** A PostgreSQL isolation level supported by the explicit root transaction. */
3078
+ type TransactionIsolation = "read committed" | "repeatable read" | "serializable";
3079
+ interface AtomicOptions {
3080
+ /** Each retry opens a fresh transaction and reruns the complete callback.
3081
+ * Defaults to zero. Keep external effects outside it; persist an outbox instead. */
3082
+ retry?: number;
3083
+ isolation?: TransactionIsolation;
3084
+ readOnly?: boolean;
3085
+ /** Maximum wait for a PostgreSQL lock. Defaults to 5000 ms. */
3086
+ lockTimeoutMs?: number;
3087
+ /** PostgreSQL statement timeout; applies to every statement in this scope. */
3088
+ statementTimeoutMs?: number;
3089
+ /** Total work deadline including queueing and retries. Active Bun queries are
3090
+ * cancelled; rollback settles before release. An in-flight COMMIT is awaited. */
3091
+ timeoutMs?: number;
3092
+ signal?: AbortSignal;
3093
+ workload?: DatabaseWorkload;
3094
+ /** Resource names shared within a workload. Include a tenant prefix if the
3095
+ * resource ID itself is only unique inside a tenant. Requires workload. */
3096
+ conflictKeys?: readonly string[];
3097
+ }
3098
+
3099
+ /** Storage metadata that affects the declared response; defaults and unrelated
3100
+ * columns do not change an explicitly projected query's contract. */
3101
+ interface QueryColumnContract {
3102
+ type: string;
3103
+ nullable: boolean;
3104
+ codec?: string;
3105
+ enumValues?: readonly string[];
3106
+ dimensions?: number;
3107
+ }
3108
+ interface PreparedRead {
3109
+ name: string;
3110
+ table: string;
3111
+ columns: Record<string, QueryColumnContract>;
3112
+ where: Record<string, unknown>;
3113
+ options: {
3114
+ select: string[];
3115
+ orderBy?: {
3116
+ column: string;
3117
+ direction?: "asc" | "desc";
3118
+ nulls?: "first" | "last";
3119
+ } | {
3120
+ column: string;
3121
+ direction?: "asc" | "desc";
3122
+ nulls?: "first" | "last";
3123
+ }[];
3124
+ limit?: number;
3125
+ };
3126
+ }
3127
+ interface CompiledRead {
3128
+ sql: string;
3129
+ params: unknown[];
3130
+ }
3131
+ interface QueryDatabase {
3132
+ readQuery(query: PreparedRead): Promise<Record<string, unknown>[]>;
3133
+ compileQuery(query: PreparedRead): CompiledRead;
3134
+ explainQuery(query: PreparedRead): Promise<unknown[]>;
3135
+ }
3136
+ interface EnvQueryDatabase {
3137
+ $readQuery: QueryDatabase["readQuery"];
3138
+ $compileQuery: QueryDatabase["compileQuery"];
3139
+ $explainQuery: QueryDatabase["explainQuery"];
3140
+ }
2958
3141
 
2959
3142
  /** Keys of C whose columns are required on INSERT (not nullable, no default). */
2960
3143
  type RequiredKeys<C> = {
@@ -2986,12 +3169,22 @@ type RowShape<T extends TableDef> = {
2986
3169
  };
2987
3170
  /** A typed table accessor that mirrors the runtime DBClient surface. */
2988
3171
  interface TypedTable<T extends TableDef> {
3172
+ /** Runtime validates the key against the installed schema. Generated env tables
3173
+ * also check the complete unique/composite key at compile time. */
3174
+ findUnique<K extends keyof RowShape<T> = keyof RowShape<T>>(q: {
3175
+ where: Partial<RowShape<T>>;
3176
+ select?: readonly K[];
3177
+ }): Promise<Pick<RowShape<T>, K> | null>;
3178
+ page<K extends keyof RowShape<T> = keyof RowShape<T>>(q?: PageInput<RowShape<T>, K>): Promise<Page<Pick<RowShape<T>, K>>>;
2989
3179
  insert(data: InsertValues<InsertShape<T>>): Promise<RowShape<T>>;
2990
3180
  /** Çok satır, TEK statement. Satırların anahtar kümesi aynı olmalı. */
2991
- insertMany(rows: readonly InsertValues<InsertShape<T>>[], opts?: {
2992
- onConflict: readonly string[];
2993
- action?: "ignore" | "update";
3181
+ insertMany(rows: readonly InsertValues<InsertShape<T>>[], opts: InsertManyOptions & {
3182
+ returning: false;
3183
+ }): Promise<number>;
3184
+ insertMany(rows: readonly InsertValues<InsertShape<T>>[], opts?: InsertManyOptions & {
3185
+ returning?: true;
2994
3186
  }): Promise<RowShape<T>[]>;
3187
+ insertMany(rows: readonly InsertValues<InsertShape<T>>[], opts?: InsertManyOptions): Promise<RowShape<T>[] | number>;
2995
3188
  put(q: {
2996
3189
  data: InsertShape<T>;
2997
3190
  onConflict: readonly string[];
@@ -3058,7 +3251,9 @@ interface TypedTable<T extends TableDef> {
3058
3251
  }): Promise<number>;
3059
3252
  }
3060
3253
  /** A typed DB facade covering all tables declared in schema `S`. */
3061
- interface TypedDB<S extends SchemaDef> {
3254
+ interface TypedDB<S extends SchemaDef> extends QueryDatabase {
3255
+ diagnostics: DBOps["diagnostics"];
3256
+ command<T>(fn: (tx: TypedTx<S>) => T extends Promise<unknown> ? never : T, options?: CommandOptions): Promise<Materialized<T>>;
3062
3257
  tables: {
3063
3258
  [K in keyof S["tables"]]: TypedTable<S["tables"][K]>;
3064
3259
  };
@@ -3095,7 +3290,7 @@ type TypedTx<S extends SchemaDef> = TxPlanHandle<{
3095
3290
  * object to the precise mapped type (TS cannot infer the mapped-type result
3096
3291
  * through `Object.keys` iteration) — see the module-level doc comment.
3097
3292
  */
3098
- declare function makeTypedDB<S extends SchemaDef>(schema: S, raw: DBClient): TypedDB<S>;
3293
+ declare function makeTypedDB<S extends SchemaDef>(schema: S, raw: AtomicClient): TypedDB<S>;
3099
3294
  /** Bir where değeri: düz eşitlik YA DA operatör nesnesi (FR-016). */
3100
3295
  /**
3101
3296
  * Metin operatörleri YALNIZ metin kolonlarında görünür (FR-005).
@@ -3240,10 +3435,9 @@ type SqlFragment = {
3240
3435
  /**
3241
3436
  * Retryable bir hatada işlemi yeniden dener (FR-037).
3242
3437
  *
3243
- * D-016: retry'SIZ bir izolasyon yükseltmesi sunmak defect'tir kullanıcıya
3244
- * çalışmayan bir düğme vermektir. `SerializationFailure`'ın metni
3245
- * *"{ retry: n } verebilirsiniz"* diyor; bu fonksiyon o düğmenin gerçekten
3246
- * çalışan yarısı.
3438
+ * `fn` must open and settle a NEW transaction on each invocation. Repeating
3439
+ * a savepoint retains the old snapshot and cannot retry a failed COMMIT.
3440
+ * Database.$atomic owns that boundary for ordinary application code.
3247
3441
  *
3248
3442
  * VARSAYILAN SIFIR. Sessiz bir varsayılan retry, idempotent OLMAYAN bir işlemi
3249
3443
  * çağıranın haberi olmadan iki kez çalıştırırdı — bir para transferini iki kez.
@@ -3283,7 +3477,12 @@ type TextOps<V> = V extends string ? {
3283
3477
  icontains?: string;
3284
3478
  startsWith?: string;
3285
3479
  endsWith?: string;
3286
- } : Record<never, never>;
3480
+ } : {
3481
+ contains?: never;
3482
+ icontains?: never;
3483
+ startsWith?: never;
3484
+ endsWith?: never;
3485
+ };
3287
3486
  /** Operatör gövdesi, kolon-referans tipi DIŞARIDAN verilmiş hâliyle.
3288
3487
  *
3289
3488
  * `C` bir parametre, çünkü `ColRefOf<Row, V>` aksi hâlde altı operatör
@@ -3469,16 +3668,17 @@ type HasBranch<Row, Rels> = [unknown] extends [Rels] ? never : [keyof Rels] exte
3469
3668
  * `true` bütün kolonları, bir nesne ise `select`/`where`/`orderBy`/`limit` ile
3470
3669
  * daraltılmış hâlini getiriyor. Tek sorgu: LATERAL + `json_agg`.
3471
3670
  */
3472
- type WithOpts<To> = {
3671
+ type WithOpts<To, D extends HasDepth> = {
3473
3672
  select?: readonly Extract<keyof RelatedRow<To>, string>[];
3474
3673
  where?: WhereFilter<RelatedRow<To>>;
3475
3674
  orderBy?: OrderBySpec<RelatedRow<To>> | readonly OrderBySpec<RelatedRow<To>>[];
3476
3675
  limit?: number;
3676
+ with?: D extends 1 ? never : [keyof RelatedRels<To>] extends [never] ? never : WithInput<RelatedRels<To>, HasDec[D]>;
3477
3677
  };
3478
- type WithInput<Rels> = {
3678
+ type WithInput<Rels, D extends HasDepth = 3> = {
3479
3679
  [R in keyof Rels]?: Rels[R] extends {
3480
3680
  to: infer To;
3481
- } ? true | WithOpts<To> : never;
3681
+ } ? true | WithOpts<To, D> : never;
3482
3682
  };
3483
3683
  /** Bir `with` dalının DÖNÜŞ tipi — `many` dizi, `one` tekil ya da null. */
3484
3684
  type WithRowOf<Rels, R extends keyof Rels, Q> = Rels[R] extends {
@@ -3486,7 +3686,9 @@ type WithRowOf<Rels, R extends keyof Rels, Q> = Rels[R] extends {
3486
3686
  kind: infer K;
3487
3687
  } ? (Q extends {
3488
3688
  select: readonly (infer C extends keyof RelatedRow<To>)[];
3489
- } ? Pick<RelatedRow<To>, C> : RelatedRow<To>) extends infer Row ? [K] extends ["many"] ? Row[] : Row | null : never : never;
3689
+ } ? Pick<RelatedRow<To>, C> : RelatedRow<To>) & (Q extends {
3690
+ with: infer W;
3691
+ } ? WithResult<RelatedRels<To>, W> : unknown) extends infer Row ? [K] extends ["many"] ? Row[] : Row | null : never : never;
3490
3692
  /**
3491
3693
  * `with` istenmediğinde `unknown` — kesişimde YOK OLSUN diye.
3492
3694
  *
@@ -3544,6 +3746,9 @@ type QueryInput<Row, K extends keyof Row = keyof Row, Rels = unknown> = {
3544
3746
  */
3545
3747
  select?: readonly K[];
3546
3748
  } & FindManyOpts<Row>;
3749
+ type PageInput<Row, K extends keyof Row = keyof Row, Rels = unknown> = Omit<QueryInput<Row, keyof Row, Rels>, "limit" | "offset" | "select"> & {
3750
+ select?: readonly K[];
3751
+ } & PageNavigation;
3547
3752
  /** Bir yazmanın TEK parametresi: neyi (`where`) neye çevirdiğin (`set`). */
3548
3753
  type MutateInput<Row, Insert, Rels = unknown> = {
3549
3754
  where: WhereFilter<Row> | SqlFragment | HasBranch<Row, Rels>;
@@ -3727,6 +3932,16 @@ type AggregateResult<Q, Row> = Q extends {
3727
3932
  } & AggBody<Q, Row>)[] : AggBody<Q, Row>;
3728
3933
  /** Temel tablo erişimcisi — search'süz beş op. */
3729
3934
  interface EnvTypedTableBase<T extends TableTypes> {
3935
+ findUnique<K extends keyof T["row"] = keyof T["row"], W extends WithInput<RelsOf<T>> = Record<never, never>>(q: {
3936
+ where: UniqueWhere<T["row"], T["uniqueKeys"]>;
3937
+ select?: readonly K[];
3938
+ with?: QueryInput<T["row"], keyof T["row"], RelsOf<T>>["with"] & W;
3939
+ }): Promise<(Pick<T["row"], K> & WithResult<RelsOf<T>, W>) | null>;
3940
+ /** Index-backed pagination. The engine appends the declared primary key to
3941
+ * orderBy, encrypts cursor values and validates the query and caller scope. */
3942
+ page<K extends keyof T["row"] = keyof T["row"], W extends WithInput<RelsOf<T>> = Record<never, never>>(q?: PageInput<T["row"], K, RelsOf<T>> & {
3943
+ with?: W;
3944
+ }): Promise<Page<Pick<T["row"], K> & WithResult<RelsOf<T>, W>>>;
3730
3945
  insert(data: InsertValues<T["insert"]>): Promise<T["row"]>;
3731
3946
  /**
3732
3947
  * Çok satırı TEK statement'la ekle (tek gidiş-dönüş).
@@ -3743,14 +3958,13 @@ interface EnvTypedTableBase<T extends TableTypes> {
3743
3958
  *
3744
3959
  * Boş dizi boş sonuç döner — hata değil: "eklenecek bir şey yoktu".
3745
3960
  */
3746
- insertMany(rows: readonly InsertValues<T["insert"]>[], opts?: {
3747
- /** Çakışmanın ARANDIĞI kolonlar — benzersiz bir kısıt ya da index taşımalı. */
3748
- onConflict: readonly Extract<keyof T["row"], string>[];
3749
- /** `"ignore"` (VARSAYILAN, plan yoluyla aynı) çakışanı atlar ve o satır
3750
- * SONUÇTA DÖNMEZ — Postgres yalnız yazdıklarını döndürür; `"update"`
3751
- * üzerine yazar. */
3752
- action?: "ignore" | "update";
3961
+ insertMany(rows: readonly InsertValues<T["insert"]>[], opts: InsertManyOptions<Extract<keyof T["row"], string>> & {
3962
+ returning: false;
3963
+ }): Promise<number>;
3964
+ insertMany(rows: readonly InsertValues<T["insert"]>[], opts?: InsertManyOptions<Extract<keyof T["row"], string>> & {
3965
+ returning?: true;
3753
3966
  }): Promise<T["row"][]>;
3967
+ insertMany(rows: readonly InsertValues<T["insert"]>[], opts?: InsertManyOptions<Extract<keyof T["row"], string>>): Promise<T["row"][] | number>;
3754
3968
  /**
3755
3969
  * Bir idempotency anahtarını sahiplen (FR-033).
3756
3970
  *
@@ -4007,13 +4221,22 @@ type TxPlan = TxPlanHandle<TxTables> & TxSchemaSurface;
4007
4221
  * Every op it performs runs as the `service_role` (BYPASSRLS).
4008
4222
  */
4009
4223
  type EnvServiceDatabase = EnvSchemaSurface & {
4224
+ /** Commits independently of the request. All decision reads and writes belong
4225
+ * inside this callback; each retry includes a new BEGIN and COMMIT. */
4226
+ $atomic<T>(fn: (tx: AtomicDatabase) => Promise<T>, options?: AtomicOptions): Promise<T>;
4010
4227
  /** Ham SQL. Generic verilmezse `unknown[]` döner (FR-021). */
4011
4228
  $query: DBClient["query"];
4012
4229
  $insert: DBClient["insert"];
4013
4230
  $update: DBClient["update"];
4014
4231
  $delete: DBClient["delete"];
4015
4232
  $findById: DBClient["findById"];
4233
+ $findUnique: DBClient["findUnique"];
4234
+ $readQuery: DBClient["readQuery"];
4235
+ $diagnostics: DBClient["diagnostics"];
4236
+ $compileQuery: DBClient["compileQuery"];
4237
+ $explainQuery: DBClient["explainQuery"];
4016
4238
  $findMany: DBClient["findMany"];
4239
+ $page: DBClient["page"];
4017
4240
  $put: DBClient["put"];
4018
4241
  $updateMany: DBClient["updateMany"];
4019
4242
  $deleteMany: DBClient["deleteMany"];
@@ -4027,12 +4250,12 @@ type EnvServiceDatabase = EnvSchemaSurface & {
4027
4250
  $lockRows: DBClient["lockRows"];
4028
4251
  $advisoryXactLock: DBClient["advisoryXactLock"];
4029
4252
  $attempt: DBClient["attempt"];
4253
+ $command<T>(fn: (tx: TxPlan) => T extends Promise<unknown> ? never : T, options?: CommandOptions): Promise<Materialized<T>>;
4030
4254
  /** Bkz. {@link EnvTypedDatabase.$transaction}. */
4031
4255
  /**
4032
- * `opts.retry` verilirse, `SerializationFailure` / `DeadlockDetected`
4033
- * alındığında plan BAŞTAN kurulup yeniden çalıştırılır (FR-037).
4034
- * Varsayılan 0 sessiz bir retry, idempotent olmayan bir işlemi çağıranın
4035
- * haberi olmadan iki kez çalıştırırdı.
4256
+ * A plan is a savepoint in the current transaction. Nonzero `retry` is
4257
+ * refused; use $atomic for whole-transaction retry, including decision reads
4258
+ * and COMMIT. The default plan keeps request-scoped commit/rollback behavior.
4036
4259
  */
4037
4260
  $transaction<T>(fn: (tx: TxPlan) => T extends Promise<unknown> ? never : T, opts?: {
4038
4261
  retry?: number;
@@ -4072,13 +4295,22 @@ type EnvSchemaSurface = {
4072
4295
  * await Database.$transaction((tx) => { … });
4073
4296
  */
4074
4297
  type EnvTypedDatabase = EnvSchemaSurface & {
4298
+ /** Commits independently of the request. A later handler failure does not
4299
+ * undo this scope. The callback cannot switch RLS identity or nest a root. */
4300
+ $atomic<T>(fn: (tx: AtomicDatabase) => Promise<T>, options?: AtomicOptions): Promise<T>;
4075
4301
  /** Ham SQL. Generic verilmezse `unknown[]` döner (FR-021). */
4076
4302
  $query: DBClient["query"];
4077
4303
  $insert: DBClient["insert"];
4078
4304
  $update: DBClient["update"];
4079
4305
  $delete: DBClient["delete"];
4080
4306
  $findById: DBClient["findById"];
4307
+ $findUnique: DBClient["findUnique"];
4308
+ $readQuery: DBClient["readQuery"];
4309
+ $diagnostics: DBClient["diagnostics"];
4310
+ $compileQuery: DBClient["compileQuery"];
4311
+ $explainQuery: DBClient["explainQuery"];
4081
4312
  $findMany: DBClient["findMany"];
4313
+ $page: DBClient["page"];
4082
4314
  $put: DBClient["put"];
4083
4315
  $updateMany: DBClient["updateMany"];
4084
4316
  $deleteMany: DBClient["deleteMany"];
@@ -4092,6 +4324,7 @@ type EnvTypedDatabase = EnvSchemaSurface & {
4092
4324
  $lockRows: DBClient["lockRows"];
4093
4325
  $advisoryXactLock: DBClient["advisoryXactLock"];
4094
4326
  $attempt: DBClient["attempt"];
4327
+ $command<T>(fn: (tx: TxPlan) => T extends Promise<unknown> ? never : T, options?: CommandOptions): Promise<Materialized<T>>;
4095
4328
  /** RLS'i bypass eden kardeş yüzey. Kendisi `$asService` TAŞIMAZ — çift bypass yok. */
4096
4329
  $asService(): EnvServiceDatabase;
4097
4330
  /**
@@ -4100,15 +4333,16 @@ type EnvTypedDatabase = EnvSchemaSurface & {
4100
4333
  * Callback SENKRONDUR: döndüğünde hiçbir şey çalışmamıştır.
4101
4334
  */
4102
4335
  /**
4103
- * `opts.retry` verilirse, `SerializationFailure` / `DeadlockDetected`
4104
- * alındığında plan BAŞTAN kurulup yeniden çalıştırılır (FR-037).
4105
- * Varsayılan 0 sessiz bir retry, idempotent olmayan bir işlemi çağıranın
4106
- * haberi olmadan iki kez çalıştırırdı.
4336
+ * A plan is a savepoint in the current transaction. Nonzero `retry` is
4337
+ * refused; use $atomic for whole-transaction retry, including decision reads
4338
+ * and COMMIT. The default plan keeps request-scoped commit/rollback behavior.
4107
4339
  */
4108
4340
  $transaction<T>(fn: (tx: TxPlan) => T extends Promise<unknown> ? never : T, opts?: {
4109
4341
  retry?: number;
4110
4342
  }): Promise<Materialized<T>>;
4111
4343
  };
4344
+ /** The same typed table/query surface on one active physical transaction. */
4345
+ type AtomicDatabase = Omit<EnvServiceDatabase, "$atomic">;
4112
4346
 
4113
4347
  /**
4114
4348
  * tx-plan.ts — `Database.$transaction()` as a PLAN, not a pinned session.
@@ -4768,7 +5002,16 @@ interface RateLimitConfig {
4768
5002
  }
4769
5003
  /** The six raw string-keyed DB operations shared by `DBClient` and the
4770
5004
  * transaction-scoped client. */
4771
- interface DBOps {
5005
+ interface DBOps extends QueryDatabase {
5006
+ /** Null when diagnostics/budgets are disabled. Binding values are never included. */
5007
+ diagnostics(): DatabaseDiagnostics | null;
5008
+ /** Match exactly one declared primary/unique key; null never denotes a unique value. */
5009
+ findUnique(table: string, where: Record<string, unknown>, opts?: {
5010
+ select?: readonly string[];
5011
+ with?: Record<string, unknown>;
5012
+ }): Promise<Record<string, unknown> | null>;
5013
+ /** Keyset pagination with opaque, lossless cursors and a unique ordering. */
5014
+ page(table: string, query?: Record<string, unknown>, opts?: RawPageOptions): Promise<Page<Record<string, unknown>>>;
4772
5015
  /**
4773
5016
  * Run SQL on the REQUEST'S OWN transaction.
4774
5017
  *
@@ -4814,10 +5057,13 @@ interface DBOps {
4814
5057
  count?: boolean;
4815
5058
  groupBy?: readonly string[];
4816
5059
  }): Promise<Record<string, unknown> | Record<string, unknown>[]>;
4817
- insertMany(table: string, rows: readonly Record<string, unknown>[], opts?: {
4818
- onConflict: readonly string[];
4819
- action?: "ignore" | "update";
5060
+ insertMany(table: string, rows: readonly Record<string, unknown>[], opts: InsertManyOptions & {
5061
+ returning: false;
5062
+ }): Promise<number>;
5063
+ insertMany(table: string, rows: readonly Record<string, unknown>[], opts?: InsertManyOptions & {
5064
+ returning?: true;
4820
5065
  }): Promise<Record<string, unknown>[]>;
5066
+ insertMany(table: string, rows: readonly Record<string, unknown>[], opts?: InsertManyOptions): Promise<Record<string, unknown>[] | number>;
4821
5067
  /**
4822
5068
  * Insert the row, or update it when it collides on `onConflict` — one
4823
5069
  * statement, so two concurrent callers cannot both lose.
@@ -4945,7 +5191,14 @@ interface DBOps {
4945
5191
  orderBy?: {
4946
5192
  column: string;
4947
5193
  direction?: "asc" | "desc";
4948
- };
5194
+ nulls?: "first" | "last";
5195
+ } | {
5196
+ column: string;
5197
+ direction?: "asc" | "desc";
5198
+ nulls?: "first" | "last";
5199
+ }[];
5200
+ select?: string[];
5201
+ with?: Record<string, unknown>;
4949
5202
  limit?: number;
4950
5203
  offset?: number;
4951
5204
  }): Promise<Record<string, unknown>[]>;
@@ -4995,15 +5248,18 @@ interface DBOps {
4995
5248
  }
4996
5249
  /** Database client interface injected into endpoint context. */
4997
5250
  interface DBClient extends DBOps {
5251
+ /** Execute a compilable plan on PostgreSQL, with an explicit fallback policy. */
5252
+ command(plan: TxPlanBody, options?: CommandOptions): Promise<TxPlanResponse>;
5253
+ /** An independent physical transaction. Resolves after COMMIT, and retries the
5254
+ * complete callback on a fresh transaction. One identity for its entire scope. */
5255
+ atomic<T>(fn: (tx: AtomicClient) => Promise<T>, options?: AtomicOptions): Promise<T>;
4998
5256
  /**
4999
5257
  * Run a whole transaction as ONE plan, executed on the request's own
5000
5258
  * transaction inside a savepoint.
5001
5259
  *
5002
5260
  * The low-level seam behind `Database.$transaction(plan)`: the SDK builds the
5003
- * plan, this sends it, and the broker executes every operation inside a single
5004
- * transaction that commits or rolls back before the response is written.
5005
- * Nothing pins a Postgres backend across round trips, because there is only
5006
- * one round trip.
5261
+ * plan and the local engine executes it on this transaction. A single API
5262
+ * call can issue several SQL statements; it does not promise one DB round trip.
5007
5263
  *
5008
5264
  * On failure the runtime must reject with an error carrying the broker's
5009
5265
  * envelope fields — see {@link TxPlanRejection}. `slot` in particular is what
@@ -5028,6 +5284,8 @@ interface DBClient extends DBOps {
5028
5284
  */
5029
5285
  asService(): Omit<DBClient, "asService">;
5030
5286
  }
5287
+ /** An active root-transaction handle cannot switch identities or nest another root. */
5288
+ type AtomicClient = Omit<DBClient, "asService" | "atomic">;
5031
5289
  /** Logger interface injected into endpoint context. */
5032
5290
  interface Logger {
5033
5291
  info(message: string, ...args: unknown[]): void;
@@ -5319,4 +5577,4 @@ type Middleware = (ctx: MiddlewareContext, next: () => Promise<void>) => Promise
5319
5577
  */
5320
5578
  type AuthSpec = boolean | Partial<AuthConfig>;
5321
5579
 
5322
- export { type Materialized as $, type AuthSpec as A, BadRequest as B, type CacheClient as C, type DBClient as D, type EnvServiceDatabase as E, type EnvTypedTable as F, type ErrorDef as G, HttpError as H, type ErrorMap as I, type ErrorThrowers as J, type FileContext as K, type FindManyOpts as L, Flags as M, Forbidden as N, type HttpMethod as O, type PalbaseResult as P, IndexBuilder as Q, type RateLimitConfig as R, type SchemaDef as S, type TxPlanBody as T, type IndexDef as U, type InsertShape as V, type InsertValues as W, type LifecycleHook as X, Log as Y, type Logger as Z, __runWithRuntime as _, type RuntimeServices as a, type PalbaseInitialLink as a$, type Middleware as a0, type MiddlewareContext as a1, type MiddlewareHandler as a2, type MutateInput as a3, NotFound as a4, Notifications as a5, type OnDeleteAction as a6, type OrderBySpec as a7, PALBASE_EXTENSIONS as a8, type PBRequest as a9, type PalbaseDocumentRef as aA, type PalbaseDocumentSnapshot as aB, type PalbaseEmailClient as aC, type PalbaseEmailSendParams as aD, type PalbaseEmailSendResponse as aE, type PalbaseEventNamesResult as aF, type PalbaseEventsQueryInput as aG, type PalbaseEventsResult as aH, type PalbaseExtension as aI, type PalbaseFileObject as aJ, type PalbaseFlag as aK, type PalbaseFlagContext as aL, type PalbaseFlagSource as aM, type PalbaseFlagValue as aN, type PalbaseFlagVariant as aO, type PalbaseFlagsClient as aP, type PalbaseFlagsServiceClient as aQ, type PalbaseFunctionsClient as aR, type PalbaseFunnelQueryInput as aS, type PalbaseFunnelResult as aT, type PalbaseIdentifyTraits as aU, type PalbaseInboxClient as aV, type PalbaseInboxListOptions as aW, type PalbaseInboxListResult as aX, type PalbaseInboxMessage as aY, type PalbaseInboxSendParams as aZ, type PalbaseInboxSendResponse as a_, PalError as aa, type PalbaseAnalyticsClient as ab, type PalbaseAnalyticsManagementNamespace as ac, type PalbaseAnalyticsProperties as ad, type PalbaseAnalyticsQueryNamespace as ae, type PalbaseAttestAndroidParams as af, type PalbaseAttestAndroidResult as ag, type PalbaseAttestiOSParams as ah, type PalbaseAttestiOSResult as ai, type PalbaseAuthAdminClient as aj, type PalbaseAuthClient as ak, type PalbaseBatchOverrideOperation as al, type PalbaseBatchSetOverridesResult as am, type PalbaseBindDeviceParams as an, type PalbaseBucketClient as ao, type PalbaseClearAllOverridesResult as ap, type PalbaseClearOverrideResult as aq, type PalbaseCohortQueryInput as ar, type PalbaseCohortResult as as, type PalbaseCollectionRef as at, type PalbaseCountQueryInput as au, type PalbaseCountResult as av, type PalbaseCreateLinkParams as aw, type PalbaseDeviceInfo as ax, type PalbaseDeviceTokenView as ay, type PalbaseDocsClient as az, type DBOps as b, type TableDef as b$, type PalbaseInvokeOptions as b0, type PalbaseLink as b1, type PalbaseLinkAnalytics as b2, type PalbaseLinkDetails as b3, type PalbaseLinksClient as b4, type PalbaseListLinksOptions as b5, type PalbaseListLinksResult as b6, type PalbaseListOptions as b7, type PalbaseMatchParams as b8, type PalbaseMultiChannelResponse as b9, type PalbaseUsersQueryInput as bA, type PalbaseUsersResult as bB, type PalbaseVerifyRequestSignatureParams as bC, type PalbaseWhereOperator as bD, type PolicyBinOp as bE, PolicyBuilder as bF, type PolicyCommand as bG, type PolicyDef as bH, type PolicyExprCtx as bI, PolicyExprRef as bJ, type PolicyMode as bK, type PolicyOperand as bL, type QueryInput as bM, type RawConstraintDef as bN, Realtime as bO, type Ref as bP, type RequestStore as bQ, type RowShape as bR, Secrets as bS, type SecretsService as bT, SerializationFailure as bU, type SetShape as bV, type SetValue as bW, type ShutdownRunner as bX, type SqlFragment as bY, Storage as bZ, TABLE_META as b_, type PalbaseNotificationsClient as ba, type PalbaseOverviewResult as bb, type PalbasePreferences as bc, type PalbasePreferencesClient as bd, type PalbasePushClient as be, type PalbasePushSendParams as bf, type PalbasePushSendResponse as bg, type PalbaseQrCodeOptions as bh, type PalbaseQuerySnapshot as bi, type PalbaseRealtimeClient as bj, type PalbaseRegisterDeviceParams as bk, type PalbaseRetentionQueryInput as bl, type PalbaseRetentionResult as bm, type PalbaseSession as bn, type PalbaseSetOverrideResult as bo, type PalbaseSetOverridesResult as bp, type PalbaseSignedUrlResponse as bq, type PalbaseSmsClient as br, type PalbaseSmsSendParams as bs, type PalbaseSmsSendResponse as bt, type PalbaseStorageClient as bu, type PalbaseTransformOptions as bv, type PalbaseUpdateLinkParams as bw, type PalbaseUploadOptions as bx, type PalbaseUser as by, type PalbaseUserDetailResult as bz, type TxPlanResponse as c, ownedByUser as c$, type TableHandle as c0, type TableInput as c1, TooManyRequests as c2, type TxColumnExpr as c3, type TxInsertShape as c4, type TxInsertValue as c5, type TxNow as c6, type TxPlan as c7, TxPlanError as c8, type TxPlanHandle as c9, __resetLifecycleHooks as cA, __runStartHooks as cB, __setRuntime as cC, bigint as cD, boolean as cE, col as cF, dec as cG, decrement as cH, defineMiddleware as cI, defineSchema as cJ, defineTable as cK, enumType as cL, exprCtx as cM, inc as cN, increment as cO, index as cP, installationRef as cQ, integer as cR, isPalbaseExtension as cS, isRetryable as cT, jsonb as cU, makeTypedDB as cV, now as cW, numeric as cX, onShutdown as cY, onStart as cZ, openai as c_, type TxPlanOpResult as ca, type TxPlanRejection as cb, TxRefError as cc, type TxRow as cd, type TxRows as ce, type TxSelectOptions as cf, type TxSetShape as cg, type TxSetValue as ch, type TxTable as ci, type TxTables as cj, type TxWhere as ck, type TxWireExpr as cl, type TxWireGuard as cm, type TxWireOp as cn, type TxWireRef as co, type TxWireValue as cp, type TypedDB as cq, type TypedTable as cr, type TypedTx as cs, Unauthorized as ct, UniqueViolation as cu, type User as cv, type VerifiedDevice as cw, type WhereFilter as cx, type WhereOp as cy, __getRuntime as cz, __requestALS as d, policy as d0, raw as d1, sqlFragment as d2, text as d3, timestamp as d4, userRef as d5, uuid as d6, vector as d7, withRetry as d8, type PolicyExpr as e, type AggregateInput as f, type AggregateResult as g, type AnyColumn as h, Auth as i, type AuthConfig as j, Cache as k, type ClientInfo as l, type ColRef as m, ColumnBuilder as n, type ColumnDef as o, type ColumnMap as p, type ColumnType as q, Conflict as r, Database as s, DeadlockDetected as t, Documents as u, EXTENSION_DEPENDENCIES as v, type EmbeddingModelRef as w, type EnvSchemas as x, type EnvTables as y, type EnvTypedDatabase as z };
5580
+ export { type ErrorMap as $, type AuthSpec as A, BadRequest as B, type CompiledRead as C, type DatabaseBudget as D, type EnvServiceDatabase as E, type ColumnMap as F, type ColumnType as G, HttpError as H, Conflict as I, Database as J, type DatabaseQueryEvent as K, type DatabaseWorkload as L, DeadlockDetected as M, Documents as N, EXTENSION_DEPENDENCIES as O, type PreparedRead as P, type EmbeddingModelRef as Q, type RateLimitConfig as R, type SchemaDef as S, type TransactionIsolation as T, type EnvQueryDatabase as U, type EnvSchemas as V, type EnvTables as W, type EnvTypedDatabase as X, type EnvTypedTable as Y, type ErrorDef as Z, __runWithRuntime as _, type DBClient as a, type PalbaseFileObject as a$, type ErrorThrowers as a0, type FileContext as a1, type FindManyOpts as a2, Flags as a3, Forbidden as a4, type HttpMethod as a5, IndexBuilder as a6, type IndexDef as a7, type InsertManyOptions as a8, type InsertShape as a9, type PalbaseAttestiOSResult as aA, type PalbaseAuthAdminClient as aB, type PalbaseAuthClient as aC, type PalbaseBatchOverrideOperation as aD, type PalbaseBatchSetOverridesResult as aE, type PalbaseBindDeviceParams as aF, type PalbaseBucketClient as aG, type PalbaseClearAllOverridesResult as aH, type PalbaseClearOverrideResult as aI, type PalbaseCohortQueryInput as aJ, type PalbaseCohortResult as aK, type PalbaseCollectionRef as aL, type PalbaseCountQueryInput as aM, type PalbaseCountResult as aN, type PalbaseCreateLinkParams as aO, type PalbaseDeviceInfo as aP, type PalbaseDeviceTokenView as aQ, type PalbaseDocsClient as aR, type PalbaseDocumentRef as aS, type PalbaseDocumentSnapshot as aT, type PalbaseEmailClient as aU, type PalbaseEmailSendParams as aV, type PalbaseEmailSendResponse as aW, type PalbaseEventNamesResult as aX, type PalbaseEventsQueryInput as aY, type PalbaseEventsResult as aZ, type PalbaseExtension as a_, type InsertValues as aa, type LifecycleHook as ab, Log as ac, type Logger as ad, type Materialized as ae, type Middleware as af, type MiddlewareContext as ag, type MiddlewareHandler as ah, type MutateInput as ai, NotFound as aj, Notifications as ak, type OnDeleteAction as al, type OrderBySpec as am, PALBASE_EXTENSIONS as an, type PBRequest as ao, type PageInfo as ap, type PageInput as aq, type PageNavigation as ar, PalError as as, type PalbaseAnalyticsClient as at, type PalbaseAnalyticsManagementNamespace as au, type PalbaseAnalyticsProperties as av, type PalbaseAnalyticsQueryNamespace as aw, type PalbaseAttestAndroidParams as ax, type PalbaseAttestAndroidResult as ay, type PalbaseAttestiOSParams as az, type RuntimeServices as b, PolicyExprRef as b$, type PalbaseFlag as b0, type PalbaseFlagContext as b1, type PalbaseFlagSource as b2, type PalbaseFlagValue as b3, type PalbaseFlagVariant as b4, type PalbaseFlagsClient as b5, type PalbaseFlagsServiceClient as b6, type PalbaseFunctionsClient as b7, type PalbaseFunnelQueryInput as b8, type PalbaseFunnelResult as b9, type PalbaseQuerySnapshot as bA, type PalbaseRealtimeClient as bB, type PalbaseRegisterDeviceParams as bC, type PalbaseRetentionQueryInput as bD, type PalbaseRetentionResult as bE, type PalbaseSession as bF, type PalbaseSetOverrideResult as bG, type PalbaseSetOverridesResult as bH, type PalbaseSignedUrlResponse as bI, type PalbaseSmsClient as bJ, type PalbaseSmsSendParams as bK, type PalbaseSmsSendResponse as bL, type PalbaseStorageClient as bM, type PalbaseTransformOptions as bN, type PalbaseUpdateLinkParams as bO, type PalbaseUploadOptions as bP, type PalbaseUser as bQ, type PalbaseUserDetailResult as bR, type PalbaseUsersQueryInput as bS, type PalbaseUsersResult as bT, type PalbaseVerifyRequestSignatureParams as bU, type PalbaseWhereOperator as bV, type PolicyBinOp as bW, PolicyBuilder as bX, type PolicyCommand as bY, type PolicyDef as bZ, type PolicyExprCtx as b_, type PalbaseIdentifyTraits as ba, type PalbaseInboxClient as bb, type PalbaseInboxListOptions as bc, type PalbaseInboxListResult as bd, type PalbaseInboxMessage as be, type PalbaseInboxSendParams as bf, type PalbaseInboxSendResponse as bg, type PalbaseInitialLink as bh, type PalbaseInvokeOptions as bi, type PalbaseLink as bj, type PalbaseLinkAnalytics as bk, type PalbaseLinkDetails as bl, type PalbaseLinksClient as bm, type PalbaseListLinksOptions as bn, type PalbaseListLinksResult as bo, type PalbaseListOptions as bp, type PalbaseMatchParams as bq, type PalbaseMultiChannelResponse as br, type PalbaseNotificationsClient as bs, type PalbaseOverviewResult as bt, type PalbasePreferences as bu, type PalbasePreferencesClient as bv, type PalbasePushClient as bw, type PalbasePushSendParams as bx, type PalbasePushSendResponse as by, type PalbaseQrCodeOptions as bz, type DatabaseDiagnosticsOptions as c, col as c$, type PolicyMode as c0, type PolicyOperand as c1, type QueryColumnContract as c2, type QueryDatabase as c3, type QueryInput as c4, type RawConstraintDef as c5, Realtime as c6, type Ref as c7, type RequestStore as c8, type RowShape as c9, type TxSetShape as cA, type TxSetValue as cB, type TxTable as cC, type TxTables as cD, type TxWhere as cE, type TxWireExpr as cF, type TxWireGuard as cG, type TxWireOp as cH, type TxWireRef as cI, type TxWireValue as cJ, type TypedDB as cK, type TypedTable as cL, type TypedTx as cM, Unauthorized as cN, UniqueViolation as cO, type UniqueWhere as cP, type User as cQ, type VerifiedDevice as cR, type WhereFilter as cS, type WhereOp as cT, type WorkloadOptions as cU, __getRuntime as cV, __resetLifecycleHooks as cW, __runStartHooks as cX, __setRuntime as cY, bigint as cZ, boolean as c_, Secrets as ca, type SecretsService as cb, SerializationFailure as cc, type SetShape as cd, type SetValue as ce, type ShutdownRunner as cf, type SqlFragment as cg, Storage as ch, TABLE_META as ci, type TableDef as cj, type TableHandle as ck, type TableInput as cl, TooManyRequests as cm, type TxColumnExpr as cn, type TxInsertShape as co, type TxInsertValue as cp, type TxNow as cq, type TxPlan as cr, TxPlanError as cs, type TxPlanHandle as ct, type TxPlanOpResult as cu, type TxPlanRejection as cv, TxRefError as cw, type TxRow as cx, type TxRows as cy, type TxSelectOptions as cz, type DatabaseDiagnostics as d, dec as d0, decrement as d1, defineMiddleware as d2, defineSchema as d3, defineTable as d4, defineWorkload as d5, enumType as d6, exprCtx as d7, inc as d8, increment as d9, index as da, installationRef as db, integer as dc, isPalbaseExtension as dd, isRetryable as de, jsonb as df, makeTypedDB as dg, now as dh, numeric as di, onShutdown as dj, onStart as dk, openai as dl, ownedByUser as dm, policy as dn, raw as dp, sqlFragment as dq, text as dr, timestamp as ds, userRef as dt, uuid as du, vector as dv, withRetry as dw, type ColValue as dx, type DBOps as e, type RawPageOptions as f, type Page as g, type TxPlanBody as h, type CommandOptions as i, type TxPlanResponse as j, type CacheClient as k, __requestALS as l, type PalbaseResult as m, type PolicyExpr as n, type AggregateInput as o, type AggregateResult as p, type AnyColumn as q, type AtomicDatabase as r, type AtomicOptions as s, Auth as t, type AuthConfig as u, Cache as v, type ClientInfo as w, type ColRef as x, ColumnBuilder as y, type ColumnDef as z };