Commit Graph
13 Commits
Author SHA1 Message Date
dsql 0421fc734d chore: bump to 1.1.0 (logging-discipline audit)
Signed-off-by: disqualifier <dev@disqualifier.me>
2026-08-10 23:00:50 -04:00
dsql 59c0258aff release: 1.0.0
first stable release. pre-1.0.0 verification complete: all surviving MED regressions and
gaps resolved and independently re-fired, tree audited clean across the suite.

Signed-off-by: disqualifier <dev@disqualifier.me>
2026-07-09 18:53:15 -04:00
dsql aedc8f3b84 docs: compress prose/module docstrings, em-dash->hyphen (de-bloat wave 1)
Signed-off-by: disqualifier <dev@disqualifier.me>
2026-07-03 00:14:55 -04:00
dsql 0a68b65937 fix: close the motor client if an invalid db name raises in __init__ (mongo-9)
self._client[database] can raise InvalidName after the client is already
built, leaking it via any exception traceback the caller holds. close it
before re-raising, matching the __aenter__ leak fix. also compresses essay
docstrings/comments across the module with no behavior change, keeping the
swallow-and-default contract note and the matched_count/nInserted footguns.

Signed-off-by: disqualifier <dev@disqualifier.me>
2026-07-02 23:28:04 -04:00
dsql 30f0e44097 fix: correct wrong success predicates in upsert_document_field and create_documents
upsert_document_field returned False for an idempotent no-op upsert on an
existing document (modified_count=0, upserted_id=None) even though the doc
matched the requested state; switch to matched_count like its update_document_field
and update_document_operator siblings.

create_documents returned 0 on a partial insert_many failure, discarding the
BulkWriteError's nInserted count and inviting callers to retry the whole batch
on a wrongly-reported failure, duplicating documents that had already landed.
Catch BulkWriteError specifically and return e.details['nInserted'].

Bump to v0.1.7.

Signed-off-by: disqualifier <dev@disqualifier.me>
2026-07-02 17:22:31 -04:00
dsql 9da851629d fix: rename create_collection indexes->index + doc notes (mongo-3/4/5)
- mongo-3: create_collection param renamed indexes -> index (it seeds ONE index; a key-spec
  builds one compound index, not two). update keyword call sites indexes= -> index=.
- mongo-4: docstring notes an instance is single-use after close() (pymongo 4.x close is
  irreversible; connect() only pings).
- mongo-5: docstring notes construction may raise InvalidURI for a malformed URI.
- README: create_collection index note. bump v0.1.5 -> v0.1.6

Signed-off-by: disqualifier <dev@disqualifier.me>
2026-07-01 00:28:36 -04:00
dsql ebd808f326 fix: async with closes the motor client when connect()/ping fails (mongo-1)
__aenter__ delegated to connect(); when the ping raised on a bad server, __aexit__ was not
called so the eagerly-constructed motor client (with its background topology monitor + pool)
leaked. a retry loop against a flapping DB accumulated live clients. now close-on-failure.
verified: 5 failed async-with blocks leave 0 open clients (was 5). bump v0.1.4 -> v0.1.5

Signed-off-by: disqualifier <dev@disqualifier.me>
2026-06-30 21:04:51 -04:00
dsql e20368287d feat: MongoDB class (Mongo kept as alias) + connect()/async with + exists/delete aliases
additive only — every existing name preserved, swallow contract unchanged. brings mongo
in line with the redis/psql/mysql datastore trio's naming/lifecycle. bump v0.1.3 -> v0.1.4

Signed-off-by: disqualifier <dev@disqualifier.me>
2026-06-29 23:11:11 -04:00
dsql 9ad3458cf9 fix: align push helpers to matched_count for success-contract consistency (v0.1.3)
mongo-1: document_push_array and document_push_and_set still returned modified_count>0
while the v0.1.2 wave moved the sibling single-doc update helpers to matched_count>0.
$push always mutates so the two agree in practice (no reachable behavioral change), but
the helpers now match the documented 'True when a document matched' contract uniformly.

sibling-grep: zero consumers of either push helper.
Signed-off-by: disqualifier <dev@disqualifier.me>
2026-06-29 20:48:08 -04:00
dsql 51592567e1 fix: matched_count for idempotent updates; document drop-on-missing-key (v0.1.2)
- update_document_field/update_document_operator/document_pop_array return
  matched_count > 0, so an idempotent write that matched a doc but changed nothing
  ( to the same value,  of an absent value) reports success instead of False
  (L19)
- document the bare-proxy escape hatch is mongo.collection(name) not mongo[name], and
  that get_document_hashmap/get_document_fields skip docs missing the key (nits).

Signed-off-by: disqualifier <dev@disqualifier.me>
2026-06-29 17:58:26 -04:00
dsql 3ceef9c4a8 fix: add check_document_exists; rename do_upsert -> upsert
added check_document_exists(collection, target) -> bool (count_documents(target, limit=1) > 0) — it existed only in the talos origin and was not carried over, but the talos caller relies on it. renamed the do_upsert param to upsert on update_document/find_one_and_update/find_one_and_replace, standardizing on motor's name (the talos caller already passes upsert=). param rename is breaking; patch is fine under the no-consumer policy. bump to v0.1.1.

Signed-off-by: disqualifier <dev@disqualifier.me>
2026-06-29 03:25:17 -04:00
dsql 92ea363cb7 docs: real repo url + pip install command
point install at git.rethinkstudios.io; show both the requirements.txt
line and the direct pip install command.

Signed-off-by: disqualifier <dev@disqualifier.me>
2026-06-24 21:36:43 -04:00
dsqlandClaude Opus 4.8 3922295f2c add package: pyproject + source
src/ layout package making the repo pip-installable
(git+ssh@vX.Y.Z). Mongo class with both usage patterns (object +
module proxy), wrapped methods log-and-swallow, raw collection escape
hatch raises.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: disqualifier <dev@disqualifier.me>
2026-06-22 21:26:40 -04:00