Skip to content

docs: call TailorDB schema definitions tables instead of types - #2008

Merged
toiroakr merged 6 commits into
mainfrom
docs/table
Aug 7, 2026
Merged

docs: call TailorDB schema definitions tables instead of types#2008
toiroakr merged 6 commits into
mainfrom
docs/table

Conversation

@toiroakr

@toiroakr toiroakr commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Consistently use "table" instead of "type" across the SDK docs when describing a TailorDB schema definition, matching the db.type() -> db.table() rename in the v2 migration guide. Prompted by review feedback on packages/sdk-plugin-seed/README.md.
  • Updated packages/sdk-plugin-seed/README.md, packages/create-sdk/README.md, packages/create-sdk/templates/tailordb/README.md, packages/sdk/docs/migration/v2.md, and packages/sdk/docs/{configuration,plugin/index,plugin/custom,services/{auth,resolver,executor,tailordb,tailordb-migration}}.md.
  • Left real API property names (type:, typeName, hook names like onTypeLoaded), TS identifiers (TailorDBType, etc.), and literal CLI/diff output (type_added/type_removed diff kinds, Type 'User': drift output, the .tailor/<plugin-id>/types directory) untouched, since those are still type-named in the actual code.
  • Also fixed three leftover db.type(...) code samples in docs/services/tailordb.md that should have read db.table(...).

Consistently use "table" instead of "type" across the SDK docs when
describing a TailorDB schema definition, matching the db.type() ->
db.table() rename. Also fix three leftover db.type(...) code samples in
docs/services/tailordb.md that should have read db.table(...).
@changeset-bot

changeset-bot Bot commented Aug 7, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ebdb13d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@tailor-platform/sdk Patch
@tailor-platform/sdk-plugin-seed Patch
@tailor-platform/create-sdk Patch
@tailor-platform/sdk-codemod Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

# Conflicts:
#	packages/sdk-plugin-seed/README.md
@pkg-pr-new

pkg-pr-new Bot commented Aug 7, 2026

Copy link
Copy Markdown

Open in StackBlitz

@tailor-platform/create-sdk

pnpm add https://pkg.pr.new/tailor-platform/sdk/@tailor-platform/create-sdk@ebdb13d

@tailor-platform/eslint-plugin-sdk

pnpm add https://pkg.pr.new/tailor-platform/sdk/@tailor-platform/eslint-plugin-sdk@ebdb13d

@tailor-platform/sdk

pnpm add https://pkg.pr.new/tailor-platform/sdk/@tailor-platform/sdk@ebdb13d

@tailor-platform/sdk-plugin-seed

pnpm add https://pkg.pr.new/tailor-platform/sdk/@tailor-platform/sdk-plugin-seed@ebdb13d

@tailor-platform/sdk-plugin-tailordb-erd

pnpm add https://pkg.pr.new/tailor-platform/sdk/@tailor-platform/sdk-plugin-tailordb-erd@ebdb13d

commit: ebdb13d

@github-actions

This comment has been minimized.

@toiroakr
toiroakr marked this pull request as ready for review August 7, 2026 02:09
@toiroakr
toiroakr requested a review from a team as a code owner August 7, 2026 02:09
github-actions[bot]

This comment was marked as resolved.

… check

Follow-up to the previous commit: fix six leftover TailorDB type
references the docs-consistency-check CI job pointed out in
packages/sdk/docs/plugin/custom.md, packages/sdk/docs/migration/v2.md,
packages/create-sdk/templates/tailordb/README.md, and the Supported
Schema Changes table in packages/sdk/docs/services/tailordb-migration.md.
@github-actions

This comment has been minimized.

This comment was marked as outdated.

The v2/idp-publish-events-rename registry entry's description still
said "TailorDB types"; update it to "tables" so
packages/sdk/docs/migration/v2.md (generated from this registry) stays
in sync, fixing the codemod:docs:check CI failure.
@toiroakr toiroakr assigned toiroakr and unassigned dqn Aug 7, 2026
@github-actions

This comment has been minimized.

Fix the plugin/index.md "Types" bullet label that contradicted its own
"Additional TailorDB tables" description, reword the ambiguous
"Type changes" opening of the migration pre-migration phase to
"Schema changes", and rename the deleted-table cleanup note from
"types are deleted" to "tables are deleted" in
tailordb-migration.md. Also fix a missing "that" in the
publishUserEvents migration guide entry (registry.ts, regenerated into
v2.md via codemod:docs:update).

Left the field-level/type-level hook and index scope terminology
unchanged (tailordb.md, tailordb-migration.md) since it is an existing,
distinct SDK axis contrasting per-field vs. whole-record configuration,
unrelated to the db.type() -> db.table() entity rename -- the same
"Type-level" wording is still used to describe the current v2 hooks
API in docs/migration/v2.md. Also left the type_removed diff kind
reference in tailordb-migration.md:118 as-is, since it already follows
the prose/table (type_removed) pattern the docs-consistency-check bot
explicitly endorsed.

This comment was marked as off-topic.

@github-actions

This comment has been minimized.

@toiroakr toiroakr assigned dqn and unassigned toiroakr Aug 7, 2026

@dqn dqn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Two minor questions:

packages/create-sdk/src/context.ts:29 still shows the tailordb template hint as "Comprehensive TailorDB type definitions with all features" — the same sentence this PR updates in templates/tailordb/README.md. Is leaving CLI-facing strings out of scope intentional? (Same wording also remains in the describe title of templates/tailordb/src/db/task.test.ts:7.)

@@ -0,0 +1,7 @@
---
"@tailor-platform/sdk": patch

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

packages/sdk-codemod/src/registry.ts also changed in this PR, but the changeset doesn't bump @tailor-platform/sdk-codemod — intentional?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in ebdb13d82: added "@tailor-platform/sdk-codemod": patch to the changeset.

@dqn dqn assigned toiroakr and unassigned dqn Aug 7, 2026
The registry.ts fix in the previous commit (chore(codemod): sync
migration doc source with the table wording fix) changes published
content of @tailor-platform/sdk-codemod but the changeset didn't bump
that package. Add a patch entry for it, per review feedback.
@toiroakr
toiroakr requested a lite review from Copilot August 7, 2026 13:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated no new comments.

Suppressed comments (4)

packages/sdk/docs/services/tailordb.md:359

  • This sentence mixes the new “table” terminology with “type-level”. Since this note is describing .hooks() as a table-level modifier, “type-level” should be “table-level” for consistency within the doc.
**Note:** `.hooks()` can only be called once on a table. Duplicate type-level calls fail at compile time and throw at runtime.

packages/sdk/docs/services/tailordb.md:418

  • This note uses “Duplicate type-level calls” even though it’s referring to .validate() on a table. To keep the terminology consistent, this should say “table-level calls”.
**Note:** `.validate()` can only be called once on a table. Duplicate type-level calls fail at compile time and throw at runtime.

packages/sdk/docs/services/tailordb.md:453

  • This paragraph introduces “Table Modifiers”, but still says “type-level configuration”. That reads like a leftover from the “type” terminology; consider changing it to “table-level configuration”.
Table builder methods that set one type-level configuration can be called only once on the same table. Duplicate calls fail at compile time and throw at runtime. This applies to `.description()`, `.hooks()`, `.validate()`, `.features()`, `.indexes()`, `.files()`, `.permission()`, and `.gqlPermission()`.

packages/sdk/docs/services/tailordb-migration.md:343

  • This pre-migration description still uses “type-level hooks” and “type-level index changes” after the broader docs terminology shift to “table”. Updating these phrases to “table-level” would keep the section consistent and reduce ambiguity.
1. **Pre-migration**: Schema changes that would be breaking are applied in a relaxed form first. A verified in-place field type change keeps its complete previous field contract until Post-migration, including field and type-level hooks or validators changed by the same migration. Newly-required fields are added as optional; fields whose `optional → required` transition is breaking are temporarily kept optional. Fields that are being removed in this migration are temporarily kept on the table so that `migrate.ts` can still read them (for example, to `innerJoin` through a foreign key that is about to be dropped). Breaking type-level index changes are relaxed the same way: a newly-added unique index is withheld, and an index gaining a unique constraint (or a unique index changing its field set) keeps its previous definition, so `migrate.ts` can resolve duplicates first. Non-breaking changes that are part of the same migration are also applied here.

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

Code Metrics Report (packages/sdk)

main (3db5abf) #2008 (d5f1f41) +/-
Coverage 78.8% 78.8% 0.0%
Code to Test Ratio 1:0.4 1:0.4 0.0
Details
  |                    | main (3db5abf) | #2008 (d5f1f41) | +/-  |
  |--------------------|----------------|-----------------|------|
  | Coverage           |          78.8% |           78.8% | 0.0% |
  |   Files            |            470 |             470 |    0 |
  |   Lines            |          18537 |           18537 |    0 |
  |   Covered          |          14621 |           14621 |    0 |
  | Code to Test Ratio |          1:0.4 |           1:0.4 |  0.0 |
  |   Code             |         132962 |          132962 |    0 |
  |   Test             |          65568 |           65568 |    0 |

SDK Configure Bundle Size

main (3db5abf) #2008 (d5f1f41) +/-
configure-index-size 39.25KB 39.25KB 0KB
dependency-chunks-size 24.96KB 24.96KB 0KB
total-bundle-size 64.22KB 64.22KB 0KB

Runtime Performance

main (3db5abf) #2008 (d5f1f41) +/-
Generate Median 2,315ms 2,274ms -41ms
Generate Max 2,341ms 2,289ms -52ms
Apply Build Median 2,367ms 2,341ms -26ms
Apply Build Max 2,378ms 2,358ms -20ms

Type Performance (instantiations)

main (3db5abf) #2008 (d5f1f41) +/-
tailordb-basic 40,450 40,450 0
tailordb-optional 4,535 4,535 0
tailordb-relation 3,854 3,854 0
tailordb-validate 666 666 0
tailordb-hooks 5,499 5,499 0
tailordb-object 16,345 16,345 0
tailordb-enum 1,538 1,538 0
resolver-basic 12,120 12,120 0
resolver-nested 35,419 35,419 0
resolver-array 24,056 24,056 0
executor-schedule 4,489 4,489 0
executor-webhook 1,130 1,130 0
executor-record 4,542 4,542 0
executor-resolver 5,808 5,808 0
executor-operation-function 1,118 1,118 0
executor-operation-gql 1,126 1,126 0
executor-operation-webhook 1,137 1,137 0
executor-operation-workflow 1,931 1,931 0

Reported by octocov

@toiroakr

toiroakr commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

Reverted — context.ts:29 and task.test.ts are template/test source, not docs, so kept this PR scoped to markdown under docs//README.md. Filed the code-level type→table sweep (CLI output, generated paths, template strings) as tailor-inc/platform-planning#1634 for follow-up.

@toiroakr
toiroakr merged commit 6dd47e2 into main Aug 7, 2026
47 checks passed
@toiroakr
toiroakr deleted the docs/table branch August 7, 2026 13:23
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.

3 participants