Sync from docs: fix encryption key escape in Node.js example (powersync-docs #529)#54
Merged
Merged
Conversation
The docs fixed a bug where replace("'", "''") only escapes the first
single quote in an encryption key. The correct call is replaceAll.
Add this as a Common Pitfall in the Node.js SDK reference.
Source: powersync-ja/powersync-docs#529
michaelbarnes
approved these changes
Jul 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Source docs PR: powersync-ja/powersync-docs#529
What changed in docs
The Node.js reference fixed a bug in the encryption key escaping example:
replace("'", "''")was changed toreplaceAll("'", "''"). The old code only escaped the first single quote in the key; the new code escapes all of them.Skill updates in this PR
skills/powersync/references/sdks/powersync-js-node.md: Added an "Encryption Key Escaping" entry under Common Pitfalls documenting the correct use ofreplaceAllwhen settingpragma key.Notes for reviewer
The skill file previously had no encryption example. Adding it as a pitfall is the right call: if an agent generates encryption setup code for Node.js and uses
replaceinstead ofreplaceAll, the result silently fails for any key containing more than one single quote. The new entry follows the conditional voice convention already used in the file.Generated by Claude Code