Skip to content

Commit fe18060

Browse files
committed
PS-10259 [DOCS] - Change JS Lang feature to Tech Preview 8.4
On branch ps-10259-8.4 modified: docs/js-lang-overview.md modified: docs/js-lang-privileges.md modified: docs/js-lang-procedures.md modified: docs/js-lang-troubleshoot.md
1 parent 73a17a0 commit fe18060

File tree

6 files changed

+72
-22
lines changed

6 files changed

+72
-22
lines changed

docs/install-js-lang.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Install js_lang component
22

3-
--8<--- "experimental.md"
3+
--8<--- "tech.preview.md:5:5"
44

55
The `plugin_dir` system variable specifies where the component library is located. If you need to, you should set the `plugin_dir` variable when you start the server.
66

@@ -14,4 +14,12 @@ If you decide to uninstall the component, you may have to restart the server bef
1414

1515
When you install the `component_js_lang`, it gives you a new global privilege called `CREATE_JS_ROUTINE`. This privilege allows you to create JS routines within the database.
1616

17-
For more details, check out [INSTALL COMPONENT](install-component.md).
17+
For more details, check out [INSTALL COMPONENT](install-component.md).
18+
19+
## Further reading
20+
21+
- [js_lang stored procedure and function overview](js-lang-overview.md)
22+
- [Uninstall the js_lang component](uninstall-js-lang.md)
23+
- [js_lang stored function or procedure](js-lang-procedures.md)
24+
- [js_lang privileges](js-lang-privileges.md)
25+
- [Troubleshoot js_lang procedures and functions](js-lang-troubleshoot.md)

docs/js-lang-overview.md

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
# JS stored procedure and function overview
1+
# js_lang stored procedure and function overview
22

3-
--8<--- "experimental.md"
3+
--8<--- "tech.preview.md:5:5"
44

5-
Integrating stored procedures and functions in JS within a MySQL-compatible database provides a versatile and practical approach to managing complex data processing tasks. This method significantly enhances performance, allowing developers to execute intricate operations more efficiently. For those proficient in JS, this approach streamlines the development process, reducing the load on client applications and optimizing overall system performance. By employing stored procedures and functions, developers achieve faster data processing and facilitate more manageable maintenance and scalability, making it an ideal solution for those skilled in JS.
5+
You can use stored procedures and functions written in JS with a MySQL-compatible database. This feature helps you manage complex data processing tasks. This method improves performance. This method lets developers run complex operations faster. If you know JS, you can use your existing skills. Using stored procedures and functions reduces the work done by client applications. Using stored procedures and functions also improves overall system performance. Using stored procedures and functions helps developers process data faster. Using stored procedures and functions also makes maintenance and scaling easier. This approach is a good solution for developers who know JS.
66

77
| Benefit | Description |
88
|------------------------------------|-----------------------------------------------------------------------------------------------|
9-
| Familiarity | Developers who are already proficient in JS can leverage their existing skills. |
10-
| Efficiency | JS allows for more efficient execution of complex data processing tasks. |
11-
| Performance | Stored procedures and functions in JS can enhance database performance by reducing client load.|
12-
| Reusability | Encapsulated logic in stored procedures and functions can be reused across multiple applications.|
13-
| Scalability | Facilitates easier maintenance and scalability of database operations. |
14-
| Simplified Development Process | Streamlines the development process, making it more manageable for those skilled in JS. |
15-
| Integration with Client Applications| Seamless integration with client applications, reducing the need for additional processing. |
16-
| Optimization | Optimizes overall system performance through efficient data processing. |
9+
| Familiarity | Developers who already know JS can use their existing skills. |
10+
| Efficiency | JS can run complex data processing tasks more efficiently. |
11+
| Performance | Stored procedures and functions in JS improve database performance. They reduce the work done by client applications.|
12+
| Reusability | You can write code once in stored procedures and functions. Then you can use that code in multiple applications.|
13+
| Scalability | Using stored procedures and functions makes database operations easier to maintain and scale. |
14+
| Simplified Development Process | This feature makes development easier for developers who know JS. |
15+
| Integration with Client Applications| Stored procedures and functions work well with client applications. You need less additional processing.|
16+
| Optimization | This feature improves overall system performance through efficient data processing. |
1717

1818

1919
## Limitations
@@ -73,3 +73,11 @@ The system always maps JS null and undefined values to SQL NULL, regardless of t
7373
| `SET` | - Numbers: stored as integers/doubles<br>- BigInts: stored as integers<br>- Others: converted to strings with charset conversion if needed | Tries native storage before falling back to strings | `1``1`<br>`"value"``"value"` |
7474
| `GEOMETRY` | - Valid `ArrayBuffer`/`View`: stored as binary<br>- Others: cause an error | Enforces format rules to maintain spatial integrity | valid buffer → `GEOMETRY` |
7575
| `JSON` | Converted using `JSON.stringify()` | Converts objects or arrays to serialized strings | `{key: "value"}``"{"key":"value"}"` |
76+
77+
## Further reading
78+
79+
- [Install js_lang component](install-js-lang.md)
80+
- [Uninstall the js_lang component](uninstall-js-lang.md)
81+
- [js_lang stored function or procedure](js-lang-procedures.md)
82+
- [js_lang privileges](js-lang-privileges.md)
83+
- [Troubleshoot js_lang procedures and functions](js-lang-troubleshoot.md)

docs/js-lang-privileges.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# JS privileges
1+
# js_lang privileges
22

3-
--8<--- "experimental.md"
3+
--8<--- "tech.preview.md:5:5"
44

55
Privileges control what users can do. You use them to give specific permissions to different users. This ability helps you keep your data secure by only allowing authorized users to access and change information in the database.
66

@@ -14,4 +14,12 @@ mysql> GRANT CREATE_JS_ROUTINE ON *.* TO user1@localhost;
1414

1515
If a user is granted the ability to create routines and holds the CREATE_JS_ROUTINE privilege, they are capable of creating stored functions and procedures using JS.
1616

17-
However, it is important to note that at this time, the creation of JS triggers or events is not supported.
17+
However, it is important to note that at this time, the creation of JS triggers or events is not supported.
18+
19+
## Further reading
20+
21+
- [js_lang stored procedure and function overview](js-lang-overview.md)
22+
- [Install js_lang component](install-js-lang.md)
23+
- [Uninstall the js_lang component](uninstall-js-lang.md)
24+
- [js_lang stored function or procedure](js-lang-procedures.md)
25+
- [Troubleshoot js_lang procedures and functions](js-lang-troubleshoot.md)

docs/js-lang-procedures.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# JS stored function or procedure
1+
# js_lang stored function or procedure
22

3-
--8<--- "experimental.md"
3+
--8<--- "tech.preview.md:5:5"
44

55
Once the component's installed, you can write stored functions and procedures in JavaScript. The syntax looks like this:
66

@@ -34,3 +34,11 @@ $$
3434

3535
You can modify or delete stored programs in JS by using the standard `ALTER PROCEDURE/FUNCTION` and `DROP PROCEDURE/FUNCTION` statements. These statements do not require the `CREATE_JS_ROUTINE` privilege.
3636

37+
## Further reading
38+
39+
- [js_lang stored procedure and function overview](js-lang-overview.md)
40+
- [Install js_lang component](install-js-lang.md)
41+
- [Uninstall the js_lang component](uninstall-js-lang.md)
42+
- [js_lang privileges](js-lang-privileges.md)
43+
- [Troubleshoot js_lang procedures and functions](js-lang-troubleshoot.md)
44+

docs/js-lang-troubleshoot.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Troubleshoot JS procedures and functions
1+
# Troubleshoot js_lang procedures and functions
22

3-
--8<--- "experimental.md"
3+
--8<--- "tech.preview.md:5:5"
44

55
The component includes a set of User-Defined Functions (UDFs) that retrieve and clear information about the last JS error that occurred in the current connection for the current user. This information updates each time a JS error occurs for the current connection and user. Successful execution of JS code does not change this state.
66

@@ -16,4 +16,12 @@ To terminate a connection or statement executing a JS routine, you can take imme
1616

1717
This functionality is crucial for managing and controlling the execution of routines, ensuring that any unintended or potentially harmful operations can be swiftly terminated to maintain the stability and performance of the database environment.
1818

19-
If the `MAX_EXECUTION_TIME` timeout is exceeded for a statement running a JS routine, the execution aborts execution without much delay. You can use this option to limit the execution time of a JS routine that's performing a long computation.
19+
If the `MAX_EXECUTION_TIME` timeout is exceeded for a statement running a JS routine, the execution aborts execution without much delay. You can use this option to limit the execution time of a JS routine that's performing a long computation.
20+
21+
## Further reading
22+
23+
- [js_lang stored procedure and function overview](js-lang-overview.md)
24+
- [Install js_lang component](install-js-lang.md)
25+
- [Uninstall the js_lang component](uninstall-js-lang.md)
26+
- [js_lang stored function or procedure](js-lang-procedures.md)
27+
- [js_lang privileges](js-lang-privileges.md)

docs/uninstall-js-lang.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
# Uninstall the js_lang component
22

3+
--8<--- "tech.preview.md:5:5"
4+
35
The uninstall works only when no connections are using JavaScript stored programs. If there are connections, the procedure fails with an error.
46

57
To remove the component, run the following:
68

79
```{.bash data-prompt="mysql>"}
810
mysql> UNINSTALL COMPONENT 'file://component_js_lang';
9-
```
11+
```
12+
13+
## Further reading
14+
15+
- [js_lang stored procedure and function overview](js-lang-overview.md)
16+
- [Install js_lang component](install-js-lang.md)
17+
- [js_lang stored function or procedure](js-lang-procedures.md)
18+
- [js_lang privileges](js-lang-privileges.md)
19+
- [Troubleshoot js_lang procedures and functions](js-lang-troubleshoot.md)

0 commit comments

Comments
 (0)