Skip to content

Conversation

@bsanchez-the-roach
Copy link
Contributor

@bsanchez-the-roach bsanchez-the-roach commented Jan 8, 2026

DOC-15772

Myself and @taroface are adding the userscript documentation to the existing MOLT docs.

@github-actions
Copy link

github-actions bot commented Jan 8, 2026

Files changed:

@netlify
Copy link

netlify bot commented Jan 8, 2026

Deploy Preview for cockroachdb-api-docs canceled.

Name Link
🔨 Latest commit 1ac55b0
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-api-docs/deploys/6972aad253ea17000861f059

@netlify
Copy link

netlify bot commented Jan 8, 2026

Deploy Preview for cockroachdb-interactivetutorials-docs canceled.

Name Link
🔨 Latest commit 1ac55b0
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-interactivetutorials-docs/deploys/6972aad2e491f2000996fcc1

@netlify
Copy link

netlify bot commented Jan 8, 2026

Netlify Preview

Name Link
🔨 Latest commit 1ac55b0
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-docs/deploys/6972aad2508a3b0008faa931
😎 Deploy Preview https://deploy-preview-22088--cockroachdb-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@bsanchez-the-roach bsanchez-the-roach marked this pull request as ready for review January 16, 2026 22:26
@bsanchez-the-roach bsanchez-the-roach requested review from noelcrl and taroface and removed request for taroface January 16, 2026 22:26
Copy link

@tuansydau tuansydau left a comment

Choose a reason for hiding this comment

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

Really good stuff - this was a beefy one :S

For how complicated and vague the Userscript API is, I think this PR does a really good job breaking down the API with good brevity without sacrificing too much detail. I've left some comments, most are nits or addressing things I should have made clearer in the drafting phase (sorry about that).

Thanks to everyone involved, insane effort on this one - I can formally approve after all the comments are addressed

Copy link
Contributor

@noelcrl noelcrl left a comment

Choose a reason for hiding this comment

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

Thank you so much for the detailed work here! Really appreciate the care that went into this along with the insightful clarification questions along the way.

I think this PR is looking good overall, just some remaining questions/comments but nothing too against the overall main structure. Let me know if you need more info.

@rmloveland rmloveland self-requested a review January 21, 2026 20:58
Copy link
Contributor

@rmloveland rmloveland left a comment

Choose a reason for hiding this comment

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

LGTM, had various non-blocking comments / questions. In particular I think this could stand to have more context/positioning w.r.t. where it lives vs MOLT Fetch since it seems to express overlapping functionality (but obv fills gaps on features that Fetch doesn't have). It would be good to add more about that in future so the reader can quickly assess "do i need to read all this? or should i just use MOLT Fetch?"


This cookbook provides ready-to-use examples that demonstrate real-world uses of the [userscript API]({% link molt/userscript-api.md %}). You can copy and paste them into your own code, and you can adapt them for your specific use cases.

[MOLT Fetch]({% link molt/molt-fetch.md %}) does **not** support userscripts. Below each example, you will see the equivalent way of carrying out that transformation using MOLT Fetch, if it's possible to do so. When performing an [initial data load followed by live replication]({% link molt/migrate-load-replicate.md %}), **apply equivalent transformations in both the Fetch command and Replicator userscript** to ensure data consistency.
Copy link
Contributor

Choose a reason for hiding this comment

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

huh ? as someone unfamiliar with this product area i'm like "oh ... ok then"

so ... is this replacing that? or is it "yet another thing"? since you mentioned possible equivalent workflows that raises the q

maybe it's said elsewhere but IMO it would be good to add more context to this intro about "why should i use this instead of MOLT Fetch?" there isn't much product positioning here beyond the "you can do custom transforms" which yes, but when and why? probably not for this PR since it's due ~today but I think this is important

Copy link
Contributor

Choose a reason for hiding this comment

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

For more context here, there are two different phases, MOLT Fetch for the initial bulk data load (which uses transformation json files), and MOLT Replicator for live replication (which uses userscripts). Users may have tailored needs for their migrations which may require the usage of MOLT Fetch transformations and MOLT Replicator userscripts. MOLT Replicator userscripts will typically complement MOLT Fetch transformations if those are used.

The cookbook examples provide more insight into common scenarios that the user may need to address, like if the source database table names and target database table names differ. MOLT Fetch transformations can be used to account for this naming difference during the initial bulk data load, and MOLT Replicator userscripts can be used during live replication afterwards to ensure that data rows are replicated to the correct target database table name from the original source database table name.

Additionally, live replication behavior can be heavily customized with userscripts, like creating a new audit table on the target database and storing specific data row changes there, implementing a dead-letter queue so that any data rows that fail to replicate can be sent to a dead-letter queue table on the target, and more use cases.

});
~~~

#### MOLT Fetch equivalent
Copy link
Contributor

Choose a reason for hiding this comment

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

again, it would be good to know WHY we are doing this compare/contrast - is Fetch deprecated? (maybe i should look at the Fetch docs, but as a user this area is fresh to me, and this is my immediate question)

Copy link
Contributor

Choose a reason for hiding this comment

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

Fair, these are included because if the user initially uses a transformation with MOLT Fetch, the subsequent MOLT Replicator execution must do the equivalent transformation as well with a userscript to follow suit. Perhaps this context could be beneficial to include somewhere, if not already?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@noelcrl This leads to a product-level question I have: if Fetch transformations provide less functionality than Replicator userscripts, but both need to be used in tandem (i.e. the transformations and userscripts need to be equivalent) when performing a bulk load + live replication, then what use is any of the userscript functionality that Fetch can't do? For example, Fetch can't create computed columns (as mentioned in the Compute New Columns cookbook example). I guess to take advantage of this functionality, then, you'd need to do a bulk load, then write some other script that computes the columns for that newly-loaded data, in place on the target, and then you would start live replication. Something like that?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, we would typically do the manual fix-ups after bulk load with MOLT Fetch, then have user scripts take care of the remaining live replication changes during MOLT Replicator, until a transformation receives support for MOLT Fetch.

Copy link
Contributor

@noelcrl noelcrl left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the updates and clarifications!

@taroface taroface enabled auto-merge (squash) January 22, 2026 22:56
@taroface taroface merged commit cf563f1 into main Jan 22, 2026
7 checks passed
@taroface taroface deleted the molt-user-scripts branch January 22, 2026 23:02
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.

5 participants