Skip to content

Commit

Permalink
PS-9197 [DOCS] Document JS stored routines (8.0)
Browse files Browse the repository at this point in the history
	new file:   docs/install-js-lang.md
	new file:   js-lang-overview.md
	modified:   mkdocs-base.yml
	new file:   uninstall-js-lang.md
  • Loading branch information
patrickbirch committed Jan 10, 2025
1 parent 0d7e07d commit 06f4b2a
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/install-js-lang.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Install js_lang component

The `plugin_dir` system variable defines the component library location. If needed, at server startup, set the `plugin_dir` variable.

To install the `js_lang` component, run the following command:

```{.bash data-prompt="mysql>"}
mysql> INSTALL COMPONENT 'file://component_js_lang';
```

If you uninstall the component, you may need to restart the server before a reinstall.

Find more information in [INSTALL COMPONENT](install-component.md).
10 changes: 10 additions & 0 deletions docs/js-lang-overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# JS Support overview

Creating stored procedures in JavaScript within a MySQL-compatible database offers a flexible and efficient way to handle complex data processing. It boosts performance and makes the development process easier for those familiar with JavaScript.

| **Advantage** | **Details** |
|---|---|
| **Developer Benefits** | Most developers know JavaScript well and can start writing procedures quickly. You process complex data like JSON and strings using familiar JavaScript methods. Developers use their existing JavaScript skills to write database code faster. |
| **Performance Benefits** | Process your data directly in the database instead of moving it around. Network traffic decreases when data stays in the database. |
| **Code and Tools** | Use JavaScript's built-in functions for data tasks. Connect with JavaScript libraries and tools you already use. Write procedures using modern JavaScript features. |
| **Security Benefits** | Keep business rules inside stored procedures. Control database access through procedures. Protect your data by limiting direct table access. |
9 changes: 9 additions & 0 deletions docs/uninstall-js-lang.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Uninstall the js_lang component

The uninstall works only when no connections are using JavaScript stored programs. If there are connections, the procedure fails with an error.

To remove the component, run the following:

```{.bash data-prompt="mysql>"}
mysql> UNINSTALL COMPONENT 'file://component_js_lang';
```
4 changes: 4 additions & 0 deletions mkdocs-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,10 @@ nav:
- extended-select-into-outfile.md
- fips.md
- innodb-expanded-fast-index-creation.md
- JS Support:
- js-lang-overview.md
- install-js-lang.md
- uninstall-js-lang.md
- kill-idle-trx.md
- percona-sequence-table.md
- procfs-plugin.md
Expand Down

0 comments on commit 06f4b2a

Please sign in to comment.