@rebasepro/server-postgres 0.17.2-canary.g439a156 → 0.17.2

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 (35) hide show
  1. package/dist/{backup-service-BtgHxfFm.js → backup-service-DCk7KhhL.js} +3 -3
  2. package/dist/{backup-service-BtgHxfFm.js.map → backup-service-DCk7KhhL.js.map} +1 -1
  3. package/dist/cli-helpers.d.ts +26 -14
  4. package/dist/{collection-index-DxJBvVTH.js → collection-index-BRUg10H5.js} +2 -2
  5. package/dist/{collection-index-DxJBvVTH.js.map → collection-index-BRUg10H5.js.map} +1 -1
  6. package/dist/{ensure-collection-policies-BHk4TRuf.js → ensure-collection-policies-UCqgv_8c.js} +4 -4
  7. package/dist/{ensure-collection-policies-BHk4TRuf.js.map → ensure-collection-policies-UCqgv_8c.js.map} +1 -1
  8. package/dist/{ensure-collection-tables-DMjOkeRy.js → ensure-collection-tables-DgVixhX3.js} +256 -38
  9. package/dist/ensure-collection-tables-DgVixhX3.js.map +1 -0
  10. package/dist/index.es.js +12 -12
  11. package/dist/{rls-bootstrap-sql-DNzaWd4C.js → rls-bootstrap-sql-B5C9LoJ6.js} +2 -2
  12. package/dist/{rls-bootstrap-sql-DNzaWd4C.js.map → rls-bootstrap-sql-B5C9LoJ6.js.map} +1 -1
  13. package/dist/{rls-enforcement-C1RJ1uI2.js → rls-enforcement-DvAbL9YJ.js} +3 -3
  14. package/dist/{rls-enforcement-C1RJ1uI2.js.map → rls-enforcement-DvAbL9YJ.js.map} +1 -1
  15. package/dist/schema/atlas-argv.d.ts +58 -0
  16. package/dist/schema/carved-out-migration.d.ts +65 -0
  17. package/dist/schema/ensure-collection-tables.d.ts +13 -1
  18. package/dist/schema/generate-postgres-ddl-logic.d.ts +57 -5
  19. package/dist/schema/vector-index.d.ts +120 -0
  20. package/dist/{src-DiDgtX8P.js → src-DiB5RP2Z.js} +33 -3
  21. package/dist/{src-DiDgtX8P.js.map → src-DiB5RP2Z.js.map} +1 -1
  22. package/dist/{websocket-g1Ji7m4o.js → websocket-BZ4H5wUz.js} +19 -9
  23. package/dist/websocket-BZ4H5wUz.js.map +1 -0
  24. package/package.json +6 -6
  25. package/src/cli-helpers.ts +65 -34
  26. package/src/cli.ts +168 -71
  27. package/src/schema/atlas-argv.ts +94 -0
  28. package/src/schema/carved-out-migration.ts +404 -0
  29. package/src/schema/ensure-collection-tables.ts +59 -32
  30. package/src/schema/generate-postgres-ddl-logic.ts +147 -21
  31. package/src/schema/generate-postgres-ddl.ts +59 -6
  32. package/src/schema/generate-schema-commit.ts +31 -6
  33. package/src/schema/vector-index.ts +213 -0
  34. package/dist/ensure-collection-tables-DMjOkeRy.js.map +0 -1
  35. package/dist/websocket-g1Ji7m4o.js.map +0 -1
@@ -67,23 +67,35 @@ export declare function applySearchDdl(databaseUrl: string, drizzleDir?: string)
67
67
  */
68
68
  export declare function getSearchExcludes(collectionsPath: string): Promise<string[]>;
69
69
  /**
70
- * Give the dev database the search helper functions before Atlas plans.
70
+ * The generated SQL for the project's `vector` properties, if it has any.
71
71
  *
72
- * Excluding the search column keeps Atlas from *diffing* it, but not from
73
- * materialising the inspected schema — column and all — in the dev database to
74
- * analyse the plan against. That replay is where a push against an
75
- * already-searchable database died with `function public.rebase_search_text
76
- * (jsonb) does not exist`: the column came across, the function it calls did
77
- * not, because Atlas will not carry a function at all.
78
- *
79
- * Only the extensions and functions, never the tables: the dev database holds
80
- * whatever Atlas puts there and nothing of ours.
72
+ * @param drizzleDir directory holding the generated SQL. Defaults to `drizzle`
73
+ * under the working directory.
74
+ */
75
+ export declare function readVectorDdl(drizzleDir?: string): string;
76
+ /**
77
+ * Install pgvector and bring the vector columns and their ANN indexes up to
78
+ * date.
79
+ *
80
+ * Runs *after* Atlas, like {@link applySearchDdl} and for the same reason: the
81
+ * statements are `ALTER TABLE … ADD COLUMN`, so the table has to exist. Atlas
82
+ * is told to ignore these objects entirely ({@link getVectorExcludes}) — it
83
+ * cannot manage a type its dev database is structurally incapable of having,
84
+ * and left to itself it would plan a `DROP COLUMN` for every one.
85
+ *
86
+ * A no-op when no collection declares a `vector` property. A failure is *not*
87
+ * swallowed: a push that reported success while the embedding column never
88
+ * appeared is how a project ends up with vector search configured, no error
89
+ * anywhere, and no results.
90
+ */
91
+ export declare function applyVectorDdl(databaseUrl: string, drizzleDir?: string): Promise<void>;
92
+ /**
93
+ * Glob patterns keeping Atlas away from the vector objects.
81
94
  *
82
- * Best-effort by design. Failing here would block a push for a project whose
83
- * collections merely failed to import, and if the functions really are needed
84
- * and really are missing, Atlas says so a moment later in its own words.
95
+ * Returns an empty list and so changes nothing for a project with no
96
+ * `vector` property, which is every project that has not opted in.
85
97
  */
86
- export declare function seedDevDatabaseSearchHelpers(devDatabaseUrl: string, collectionsPath: string): Promise<void>;
98
+ export declare function getVectorExcludes(collectionsPath: string): Promise<string[]>;
87
99
  /**
88
100
  * Query the live database for every user table/view outside the system
89
101
  * catalogs. Separated from {@link getTableExcludes} so its failure mode can
@@ -2,7 +2,7 @@ import { createRequire as __createRequire } from "module";
2
2
  import "process";
3
3
  __createRequire(import.meta.url);
4
4
  import { d as __require, l as __commonJSMin } from "./connection-GOKU3Hu5.js";
5
- import { _ as isRelationAggregateSort, a as rewriteLegacyRlsFunctions, b as toCanonicalOp, c as isPostgresCollectionConfig, d as getDataSourceCapabilities, f as ALL_WHERE_FILTER_OPS, h as REST_TO_CANONICAL, i as RLS_UID_SQL, l as isRelationalCollectionConfig, m as NULL_OPS, p as CANONICAL_TO_REST, r as RLS_ROLES_SQL, s as getDeclaredSubcollections, y as sortKeyToString } from "./src-DiDgtX8P.js";
5
+ import { a as RLS_UID_SQL, b as sortKeyToString, c as getDeclaredSubcollections, f as getDataSourceCapabilities, g as REST_TO_CANONICAL, h as NULL_OPS, i as RLS_ROLES_SQL, l as isPostgresCollectionConfig, m as CANONICAL_TO_REST, o as rewriteLegacyRlsFunctions, p as ALL_WHERE_FILTER_OPS, u as isRelationalCollectionConfig, v as isRelationAggregateSort, x as toCanonicalOp } from "./src-DiB5RP2Z.js";
6
6
  //#region ../types/src/errors.ts
7
7
  /**
8
8
  * The single error type thrown across the entire Rebase client surface —
@@ -5687,4 +5687,4 @@ var buildCollectionIndexPlan = (collections, resolveColumnName) => collections.f
5687
5687
  //#endregion
5688
5688
  export { sortCollectionsBySlug as A, getPolicyNamesForRule as B, getTableName as C, getDeclaredPrimaryKeys as D, buildCompositeId as E, firstFreeKey as F, DEFAULT_ONE_OF_TYPE as G, mergeDeep as H, generateForeignKeyName as I, resolveClientListLimit as J, DEFAULT_ONE_OF_VALUE as K, legacyForeignKeyName as L, createRelationRefWithData as M, normalizeToEntityRelation as N, isAddressableId as O, updateDateAutoValues as P, Vector as Q, toPostgresIdentifier as R, getEnumVarName as S, resolveCollectionRelations as T, camelCase as U, isPrototypePollutingKey as V, toSnakeCase as W, hasForeignKeyOnTarget as X, ANONYMOUS_USER_ID as Y, isManyToMany as Z, securityRuleToConditions as _, buildSdkData as a, findRelation as b, parseOrderBySpecStrict as c, getJunctionCollectionConfig as d, getJunctionSecurityRules as f, policyToPostgres as g, getInjectedSecurityRules as h, collectionIndexStatements as i, createRelationRef as j, parseIdValues as k, CollectionRegistry as l, getEffectiveSecurityRules as m, buildCollectionIndexSpecs as n, OrderBySpecError as o, resolveJunctionSpecs as p, ListLimitError as q, collectionIndexStatement as r, normalizeDriverOrderBy as s, buildCollectionIndexPlan as t, relationalCollections as u, findAnonymousGrants as v, getTableVarName as w, getColumnName as x, fieldKeyForColumn as y, toWireKey as z };
5689
5689
 
5690
- //# sourceMappingURL=collection-index-DxJBvVTH.js.map
5690
+ //# sourceMappingURL=collection-index-BRUg10H5.js.map