Skip to content

Sync from docs: fix encryption key escape in Node.js example (powersync-docs #529)#54

Merged
michaelbarnes merged 1 commit into
mainfrom
drift/docs-529-node-encryption-keys
Jul 9, 2026
Merged

Sync from docs: fix encryption key escape in Node.js example (powersync-docs #529)#54
michaelbarnes merged 1 commit into
mainfrom
drift/docs-529-node-encryption-keys

Conversation

@bean1352

@bean1352 bean1352 commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Generated by Claude. Review carefully before merging.

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 to replaceAll("'", "''"). 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 of replaceAll when setting pragma 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 replace instead of replaceAll, 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

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
@bean1352 bean1352 requested a review from michaelbarnes July 1, 2026 11:00
@bean1352 bean1352 self-assigned this Jul 1, 2026
@michaelbarnes michaelbarnes merged commit aa21db5 into main Jul 9, 2026
1 check passed
@michaelbarnes michaelbarnes deleted the drift/docs-529-node-encryption-keys branch July 9, 2026 22:19
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.

2 participants