nocodb
nocodb copied to clipboard
Add support for `URLENCODE` function
Change Summary
This adds URLENCODE that percent-encodes special characters, so that column value can be safely substituted into URLs.
Change type
- [x] feat: (new feature for the user, not a new feature for build script)
- [ ] fix: (bug fix for the user, not a fix to a build script)
- [ ] docs: (changes to the documentation)
- [ ] style: (formatting, missing semi colons, etc; no production code change)
- [ ] refactor: (refactoring production code, eg. renaming a variable)
- [ ] test: (adding missing tests, refactoring tests; no production code change)
- [ ] chore: (updating grunt tasks etc; no production code change)
Test/ Verification
Tested on PostgreSQL. But it should work fine on other backends, too.
You may probably just use
REPLACEorREGEX_REPLACEinknex.rawto encode those special characters specified in RFC 3986.
Okay, I implemented that approach. I used the list of characters in RFC 3986 section 2.2, but I removed characters that encodeURIComponent() does not encode, and added percent sign and space.
Please review again.
Here is how it looks now:
Rebased on top of the latest develop branch to fix the conflicts.
@wingkwong, @pranavxc Please review again.
Fixed a stupid copy-paste error in tests, now they should pass.
Improved the documentation.
Ping please? Just rebased again.
Re-running the tests.