@rebasepro/server-postgres 0.11.1-canary.gfd39654 → 0.12.1-canary.g5f403cf

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 (44) hide show
  1. package/dist/PostgresBootstrapper.d.ts +8 -0
  2. package/dist/auth/services.d.ts +16 -0
  3. package/dist/backup-service-DH9kPg-E.js +8866 -0
  4. package/dist/backup-service-DH9kPg-E.js.map +1 -0
  5. package/dist/collections/buildRegistry.d.ts +1 -1
  6. package/dist/connection-B5Wndbr1.js +196 -0
  7. package/dist/connection-B5Wndbr1.js.map +1 -0
  8. package/dist/{ensure-collection-tables-DGMYK0fr.js → ensure-collection-tables-CIHSH962.js} +5 -5
  9. package/dist/ensure-collection-tables-CIHSH962.js.map +1 -0
  10. package/dist/history/HistoryService.d.ts +9 -29
  11. package/dist/index.es.js +698 -9604
  12. package/dist/index.es.js.map +1 -1
  13. package/dist/schema/auth-schema.d.ts +83 -144
  14. package/dist/schema/dynamic-tables.d.ts +1 -1
  15. package/dist/schema/introspect-runtime.d.ts +1 -1
  16. package/dist/services/FetchService.d.ts +36 -1
  17. package/dist/services/row-pipeline.d.ts +3 -1
  18. package/dist/{src-3VmUJ8Xn.js → src-DihrDFuP.js} +354 -165
  19. package/dist/src-DihrDFuP.js.map +1 -0
  20. package/dist/{src-D5xBTl32.js → src-DoU9yPqq.js} +79 -189
  21. package/dist/src-DoU9yPqq.js.map +1 -0
  22. package/dist/utils/drizzle-conditions.d.ts +157 -3
  23. package/dist/utils/pg-error-utils.d.ts +6 -3
  24. package/dist/websocket-BKcGvILX.js +528 -0
  25. package/dist/websocket-BKcGvILX.js.map +1 -0
  26. package/package.json +14 -14
  27. package/src/PostgresBootstrapper.ts +23 -6
  28. package/src/auth/ensure-tables.ts +164 -9
  29. package/src/auth/services.ts +21 -2
  30. package/src/collections/buildRegistry.ts +1 -1
  31. package/src/history/HistoryService.ts +13 -31
  32. package/src/schema/auth-schema.ts +30 -19
  33. package/src/schema/dynamic-tables.ts +1 -1
  34. package/src/schema/generate-drizzle-schema-logic.ts +17 -5
  35. package/src/schema/generate-postgres-ddl-logic.ts +7 -3
  36. package/src/schema/introspect-runtime.ts +1 -1
  37. package/src/services/FetchService.ts +79 -11
  38. package/src/services/row-pipeline.ts +3 -1
  39. package/src/utils/drizzle-conditions.ts +509 -45
  40. package/src/utils/pg-error-utils.ts +52 -3
  41. package/dist/chunk-DSJWtz9O.js +0 -40
  42. package/dist/ensure-collection-tables-DGMYK0fr.js.map +0 -1
  43. package/dist/src-3VmUJ8Xn.js.map +0 -1
  44. package/dist/src-D5xBTl32.js.map +0 -1
@@ -10,6 +10,7 @@ import { RealtimeService } from "./services/realtimeService";
10
10
  import { DatabasePoolManager } from "./databasePoolManager";
11
11
  import { PostgresCollectionRegistry } from "./collections/PostgresCollectionRegistry";
12
12
  import { type CdcTableRef } from "./services/cdc/trigger-cdc";
13
+ import { type UnknownFilterFieldsMode } from "./utils/drizzle-conditions";
13
14
  export interface PostgresDriverConfig {
14
15
  connectionString?: string;
15
16
  adminConnectionString?: string;
@@ -35,6 +36,13 @@ export interface PostgresDriverConfig {
35
36
  * instance and wrong for two. See {@link ChannelBusConfig}.
36
37
  */
37
38
  realtime?: RealtimeChannelsConfig;
39
+ /**
40
+ * What to do with a filter field that resolves to no column at all.
41
+ * Defaults to `"error"` — a filter that cannot be compiled would otherwise
42
+ * be dropped, and a dropped condition can only widen the result set.
43
+ * Set to `"warn"` to restore the pre-fix behaviour of dropping it silently.
44
+ */
45
+ unknownFilterFields?: UnknownFilterFieldsMode;
38
46
  }
39
47
  /**
40
48
  * Opaque internals bag that PostgresBootstrapper stores during `initializeDriver()`
@@ -9,6 +9,22 @@ export interface AuthSchemaTables {
9
9
  appConfig: RebasePgTable;
10
10
  userIdentities: RebasePgTable;
11
11
  }
12
+ /**
13
+ * The single definition of what an email address looks like in storage.
14
+ *
15
+ * Reads have always folded case; writes did not, and normalising was left to
16
+ * each caller. That asymmetry is only ever one forgotten `.toLowerCase()` away
17
+ * from a row no lookup can find — the account exists, every sign-in path
18
+ * reports no such user, and the byte-exact UNIQUE on the column does not stop a
19
+ * duplicate differing only in case. Applied on both sides here so the guarantee
20
+ * belongs to the repository rather than to its callers' discipline; the
21
+ * `lower(email)` unique index added in `ensureAuthTablesExist` is the database
22
+ * half of the same rule.
23
+ *
24
+ * Whitespace goes too: a trailing space survives the fold and reproduces the
25
+ * problem exactly.
26
+ */
27
+ export declare function normalizeEmail<T>(email: T): T | string;
12
28
  /**
13
29
  * PostgreSQL implementation of UserRepository.
14
30
  * Handles all user-related database operations using Drizzle ORM.