@classytic/repo-core 0.8.0 → 0.8.1

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/CHANGELOG.md CHANGED
@@ -4,6 +4,12 @@ All notable changes to `@classytic/repo-core` are documented here.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [0.8.1] - 2026-07-11
8
+
9
+ ### Docs — `DataAdapter.close()` ownership rule
10
+
11
+ - Clarified the `close?()` contract (doc-only, no type/runtime change): the adapter does **not** own the database connection — the host does, and `close()` must release only adapter/kit-owned resources (TTL/vacuum timers, change streams), never disconnect a shared client/pool. Kits that genuinely own a connection gate its disposal behind an explicit opt-in. This standardizes cleanup semantics across mongokit/sqlitekit/pgkit/prismakit.
12
+
7
13
  ## [0.8.0] - 2026-07-08
8
14
 
9
15
  ### Added — data-lifecycle contract (archive, streaming, distribution awareness)
@@ -191,7 +191,25 @@ interface DataAdapter<TDoc = unknown> {
191
191
  * SQL adapters, non-Mongo operators, or kits that compile Filter IR.
192
192
  */
193
193
  matchesFilter?: (item: unknown, filters: Record<string, unknown>) => boolean;
194
- /** Close / cleanup resources. */
194
+ /**
195
+ * Release resources this ADAPTER (or its repository) allocated —
196
+ * background timers (TTL / vacuum sweepers), open change streams,
197
+ * kit-internal caches. Safe to call more than once.
198
+ *
199
+ * **Ownership rule (load-bearing).** The adapter does NOT own the
200
+ * database connection — the HOST does. The host wrote
201
+ * `new PrismaClient()` / `new Pool()` / `mongoose.connect()`, so the
202
+ * host closes it (typically in its own `onClose`). `close()` MUST NOT
203
+ * disconnect a connection it didn't open: several resources commonly
204
+ * share one client/pool, so tearing it down from one adapter would
205
+ * break every sibling resource. Kits that must dispose a connection
206
+ * they genuinely own gate it behind an explicit opt-in (e.g.
207
+ * prismakit's `ownsClient`).
208
+ *
209
+ * Kits with nothing kit-owned to release still MAY implement this as a
210
+ * documented no-op so hosts can call `adapter.close()` uniformly across
211
+ * every backend without feature-detecting.
212
+ */
195
213
  close?(): Promise<void>;
196
214
  /**
197
215
  * Optional: does the underlying schema declare a path with this name?
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@classytic/repo-core",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "Driver-agnostic repository primitives: hooks, Filter IR, operations, pagination, cache contract. Foundation for mongokit, sqlitekit, pgkit, and prismakit. Lean by design — no plugins ship here; each kit owns its own.",
5
5
  "type": "module",
6
6
  "sideEffects": false,