mysql-js-stored-procedures

Write JavaScript stored procedures and functions in Percona Server for MySQL.

1|1|Updated May 29, 2026
One-click install
npx skills add https://github.com/Percona-Lab/skills --skill mysql-js-stored-procedures
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mysql-js-stored-procedures
Source: https://github.com/Percona-Lab/skills/tree/main/mysql-js-stored-procedures
Command: npx skills add https://github.com/Percona-Lab/skills --skill mysql-js-stored-procedures

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The js_lang component lets you write stored functions and procedures in JavaScript (V8 engine) instead of SQL/PSM, addressing scenarios where complex logic is more concise in JavaScript. It is tech preview in Percona Server 8.4 and executes in a sandbox with no file or network I/O, requiring installation of the component and the appropriate privileges.

Core Features & Use Cases

  • Write stored routines in JavaScript using the V8 engine, enabling clearer implementation for complex logic.
  • Sandbox execution with no file or network I/O; restricted environment to protect the database server.
  • Requires INSTALL COMPONENT 'file://component_js_lang' and the CREATE_JS_ROUTINE privilege; supports CREATE FUNCTION and CREATE PROCEDURE with LANGUAGE JS.

Quick Start

Install the component and grant the CREATE_JS_ROUTINE privilege, then create a JS-based routine using the LANGUAGE JS syntax.

Frequently Asked Questions about mysql-js-stored-procedures

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Can I write stored procedures in JavaScript inside MySQL?

Yes, you can write stored procedures in JavaScript inside MySQL using the js_lang component in Percona Server for MySQL 8.4. It uses the V8 engine, allowing clearer implementation for complex logic compared to standard SQL/PSM.

How do I enable JavaScript stored routines in Percona Server for MySQL?

To enable JavaScript stored routines, install the js_lang component by running INSTALL COMPONENT 'file://component_js_lang' and grant the CREATE_JS_ROUTINE privilege to your database users.

Does Percona Server for MySQL 8.4 support JavaScript functions?

Percona Server for MySQL 8.4 supports JavaScript functions and procedures as a tech-preview feature. You define them using the standard CREATE FUNCTION or CREATE PROCEDURE syntax with the LANGUAGE JS clause.

What are the limitations of JavaScript stored procedures in MySQL?

JavaScript stored procedures run in a sandbox environment with no file or network I/O access. This restricted environment protects the database server, meaning your JS routines cannot make external network calls or read local files.

What privileges do I need to create JavaScript stored procedures in MySQL?

You need the CREATE_JS_ROUTINE privilege to define JavaScript stored procedures and functions in MySQL. This specific privilege controls the ability to use the LANGUAGE JS syntax for routine creation.