diff --git a/docs/install-js-lang.md b/docs/install-js-lang.md index e8dd8a10982..4bb98c46136 100644 --- a/docs/install-js-lang.md +++ b/docs/install-js-lang.md @@ -1,6 +1,6 @@ # Install js_lang component ---8<--- "experimental.md" +--8<--- "tech.preview.md:5:5" 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. @@ -14,4 +14,12 @@ If you decide to uninstall the component, you may have to restart the server bef 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. -For more details, check out [INSTALL COMPONENT](install-component.md). \ No newline at end of file +For more details, check out [INSTALL COMPONENT](install-component.md). + +## Further reading + +- [js_lang stored procedure and function overview](js-lang-overview.md) +- [Uninstall the js_lang component](uninstall-js-lang.md) +- [js_lang stored function or procedure](js-lang-procedures.md) +- [js_lang privileges](js-lang-privileges.md) +- [Troubleshoot js_lang procedures and functions](js-lang-troubleshoot.md) \ No newline at end of file diff --git a/docs/js-lang-overview.md b/docs/js-lang-overview.md index 35f90d5783f..f8e4ff1d153 100644 --- a/docs/js-lang-overview.md +++ b/docs/js-lang-overview.md @@ -1,19 +1,19 @@ -# JS stored procedure and function overview +# js_lang stored procedure and function overview ---8<--- "experimental.md" +--8<--- "tech.preview.md:5: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. +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. | Benefit | Description | |------------------------------------|-----------------------------------------------------------------------------------------------| -| Familiarity | Developers who are already proficient in JS can leverage their existing skills. | -| Efficiency | JS allows for more efficient execution of complex data processing tasks. | -| Performance | Stored procedures and functions in JS can enhance database performance by reducing client load.| -| Reusability | Encapsulated logic in stored procedures and functions can be reused across multiple applications.| -| Scalability | Facilitates easier maintenance and scalability of database operations. | -| Simplified Development Process | Streamlines the development process, making it more manageable for those skilled in JS. | -| Integration with Client Applications| Seamless integration with client applications, reducing the need for additional processing. | -| Optimization | Optimizes overall system performance through efficient data processing. | +| Familiarity | Developers who already know JS can use their existing skills. | +| Efficiency | JS can run complex data processing tasks more efficiently. | +| Performance | Stored procedures and functions in JS improve database performance. They reduce the work done by client applications.| +| Reusability | You can write code once in stored procedures and functions. Then you can use that code in multiple applications.| +| Scalability | Using stored procedures and functions makes database operations easier to maintain and scale. | +| Simplified Development Process | This feature makes development easier for developers who know JS. | +| Integration with Client Applications| Stored procedures and functions work well with client applications. You need less additional processing.| +| Optimization | This feature improves overall system performance through efficient data processing. | ## Limitations @@ -73,3 +73,11 @@ The system always maps JS null and undefined values to SQL NULL, regardless of t | `SET` | - Numbers: stored as integers/doubles
- BigInts: stored as integers
- Others: converted to strings with charset conversion if needed | Tries native storage before falling back to strings | `1` → `1`
`"value"` → `"value"` | | `GEOMETRY` | - Valid `ArrayBuffer`/`View`: stored as binary
- Others: cause an error | Enforces format rules to maintain spatial integrity | valid buffer → `GEOMETRY` | | `JSON` | Converted using `JSON.stringify()` | Converts objects or arrays to serialized strings | `{key: "value"}` → `"{"key":"value"}"` | + +## Further reading + +- [Install js_lang component](install-js-lang.md) +- [Uninstall the js_lang component](uninstall-js-lang.md) +- [js_lang stored function or procedure](js-lang-procedures.md) +- [js_lang privileges](js-lang-privileges.md) +- [Troubleshoot js_lang procedures and functions](js-lang-troubleshoot.md) diff --git a/docs/js-lang-privileges.md b/docs/js-lang-privileges.md index b83df71fd7e..999c3994f0f 100644 --- a/docs/js-lang-privileges.md +++ b/docs/js-lang-privileges.md @@ -1,6 +1,6 @@ -# JS privileges +# js_lang privileges ---8<--- "experimental.md" +--8<--- "tech.preview.md:5:5" 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. @@ -14,4 +14,12 @@ mysql> GRANT CREATE_JS_ROUTINE ON *.* TO user1@localhost; 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. -However, it is important to note that at this time, the creation of JS triggers or events is not supported. \ No newline at end of file +However, it is important to note that at this time, the creation of JS triggers or events is not supported. + +## Further reading + +- [js_lang stored procedure and function overview](js-lang-overview.md) +- [Install js_lang component](install-js-lang.md) +- [Uninstall the js_lang component](uninstall-js-lang.md) +- [js_lang stored function or procedure](js-lang-procedures.md) +- [Troubleshoot js_lang procedures and functions](js-lang-troubleshoot.md) \ No newline at end of file diff --git a/docs/js-lang-procedures.md b/docs/js-lang-procedures.md index b56cc12388f..44502033873 100644 --- a/docs/js-lang-procedures.md +++ b/docs/js-lang-procedures.md @@ -1,6 +1,6 @@ -# JS stored function or procedure +# js_lang stored function or procedure ---8<--- "experimental.md" +--8<--- "tech.preview.md:5:5" Once the component's installed, you can write stored functions and procedures in JavaScript. The syntax looks like this: @@ -34,3 +34,11 @@ $$ 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. +## Further reading + +- [js_lang stored procedure and function overview](js-lang-overview.md) +- [Install js_lang component](install-js-lang.md) +- [Uninstall the js_lang component](uninstall-js-lang.md) +- [js_lang privileges](js-lang-privileges.md) +- [Troubleshoot js_lang procedures and functions](js-lang-troubleshoot.md) + diff --git a/docs/js-lang-troubleshoot.md b/docs/js-lang-troubleshoot.md index 79b32bc7078..859b2e55455 100644 --- a/docs/js-lang-troubleshoot.md +++ b/docs/js-lang-troubleshoot.md @@ -1,6 +1,6 @@ -# Troubleshoot JS procedures and functions +# Troubleshoot js_lang procedures and functions ---8<--- "experimental.md" +--8<--- "tech.preview.md:5:5" 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. @@ -16,4 +16,12 @@ To terminate a connection or statement executing a JS routine, you can take imme 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. -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. \ No newline at end of file +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. + +## Further reading + +- [js_lang stored procedure and function overview](js-lang-overview.md) +- [Install js_lang component](install-js-lang.md) +- [Uninstall the js_lang component](uninstall-js-lang.md) +- [js_lang stored function or procedure](js-lang-procedures.md) +- [js_lang privileges](js-lang-privileges.md) \ No newline at end of file diff --git a/docs/uninstall-js-lang.md b/docs/uninstall-js-lang.md index 9d484d255d1..78729d3b1d4 100644 --- a/docs/uninstall-js-lang.md +++ b/docs/uninstall-js-lang.md @@ -1,9 +1,19 @@ # Uninstall the js_lang component +--8<--- "tech.preview.md:5:5" + 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'; -``` \ No newline at end of file +``` + +## Further reading + +- [js_lang stored procedure and function overview](js-lang-overview.md) +- [Install js_lang component](install-js-lang.md) +- [js_lang stored function or procedure](js-lang-procedures.md) +- [js_lang privileges](js-lang-privileges.md) +- [Troubleshoot js_lang procedures and functions](js-lang-troubleshoot.md) \ No newline at end of file diff --git a/mkdocs-base.yml b/mkdocs-base.yml index 21fb01b2910..dd3acd93472 100644 --- a/mkdocs-base.yml +++ b/mkdocs-base.yml @@ -229,7 +229,7 @@ nav: - binlog-space.md - extended-select-into-outfile.md - innodb-expanded-fast-index-creation.md - - JS language support: + - js-lang language support: - js-lang-overview.md - install-js-lang.md - js-lang-privileges.md