Skip to content

docs(orm): document the 1.12.0 ORM surface and add a runnable example - #102

Merged
Antruly merged 1 commit into
masterfrom
docs/orm-1.12
Nov 27, 2026
Merged

Antruly merged 1 commit into
masterfrom
docs/orm-1.12

Conversation

@Antruly

@Antruly Antruly commented Nov 27, 2026

Copy link
Copy Markdown
Owner

Part of #94. Parent: #88. Do not close #94: this PR delivers the guide, example, changelog/release draft and build/package documentation; the release checklist still needs #93 cross-backend results and #95 performance gates.

What changed

  • Expanded doc/orm-guide.md into the 1.12.0 single-table guide:
    • model declaration, exact type mapping, column-name mapping and dialect rules;
    • SELECT/INSERT/UPDATE/DELETE/COUNT construction, parameter binding, raw() caveats;
    • synchronous CRUD, transactions through uvcpp_db_tx, callback async through uvcpp_db_pool;
    • explicit support matrix and non-goals (no JOIN/relations, migrations, composite keys, code generation, MongoDB ORM, C ABI, coroutines).
  • Added examples/orm_crud/ — a real SQLite example that runs create table → insert → find_by_pk → find_all+total → count → update → remove → NOT_FOUND, with non-zero exit on failure. Wired through examples/CMakeLists.txt.
  • Added the 1.12.0 ORM section to CHANGELOG.md and a release highlight/checklist to RELEASE.md (still marked development, no tag/version bump).
  • Updated doc/db-guide.md, doc/ci-guide.md, doc/release-process.md and doc/build-guide.md cross-references.
  • No src/ or C ABI changes.

Verification

Full ORM-enabled tree built and tested:

cmake --build build-orm-docs -j18
100% built

ctest --test-dir build-orm-docs --output-on-failure
100% tests passed, 0 tests failed out of 75
1 skipped: test_db_transaction_server_func (no MySQL/PostgreSQL server)

Example:

insert alice -> id=1
insert bob -> id=2
insert carol -> id=3
find_by_pk alice -> [email protected], age=30, score=1.5
find_all age >= 18 -> 1 row(s), [email protected]
count all -> 3
update alice -> affected=1, score=2.5
remove bob -> affected=1, then NOT_FOUND
find_by_pk carol -> age is NULL
orm_crud: all checks passed
exit=0

Documentation gates:

check_docs.py       -> 全过(3 条判据)
check_doc_lines.py  -> 全过(5 条判据)
check_ci_layout.py  -> 全过(4 个平台文件 / 7 行表 / 四个平台的徽章都在)
check_doc_snippets.py --pkg <installed tree> --docs doc/orm-guide.md
                    -> 8/8 snippets compile

Unverified / environment gaps

  • Real MySQL/PostgreSQL ORM CRUD is not verified; only SQLite has a real ORM CRUD test. [ORM] 跨后端测试与 CI #93 remains open.
  • Performance gate is not run; [Performance] 数据库同步/异步与 ORM 性能基准和回归门禁 #95 remains open.
  • Full package_release.py staging cannot complete on this machine because it needs a libuv header directory that the system-libuv build does not have; I did not fabricate package contents. cmake --install does install include/orm/.
  • Windows and macOS builds were not run locally.
  • No version bump, tag or GitHub Release was produced; release remains gated.

Expand the ORM guide to cover SQL construction, synchronous CRUD, transaction overloads and the callback async facade, with support-matrix and release-gate caveats. Add examples/orm_crud and update the changelog/release notes without bumping the version or tagging.
@Antruly

Antruly commented Nov 27, 2026

Copy link
Copy Markdown
Owner Author

Local review before merge: full ORM-enabled tree 75/75 tests pass (one DB server skip), example runs all CRUD steps, check_docs/check_doc_lines/check_ci_layout pass, and all 8 ORM guide snippets compile against an installed package. MySQL/PostgreSQL, Windows/macOS, package staging and the #95 performance gate remain open and are documented as such.

@Antruly
Antruly merged commit 330fe52 into master Nov 27, 2026
44 of 52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ORM] 文档、示例与发布门禁

1 participant