npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@obinexusltd/sqlpolycall

v1.0.0

Published

MySQL UDF source binding for libpolycall 1.5

Readme

@obinexusltd/sqlpolycall

MySQL 8 UDF source binding for libpolycall 1.5. It exposes one SQL function:

SELECT sqlpolycall_run_config('sqlpolycallrc') AS polycall_status;

The UDF converts MySQL's length-delimited string into a safe C string, calls polycall_ffi_run_config(config_path, 1) exactly once, and returns the original libpolycall status as a SQL integer. It contains no SQL client, config parser, network stack, or duplicate runtime.

Requirements

  • MySQL Server 8.0 headers and a running MySQL server
  • libpolycall 1.5 built for the same architecture/toolchain
  • Node.js 18+ and npm 9+
  • A C11 compiler (CC, default gcc)

This workstation was verified with MySQL Community Server 8.0.45. Its client is installed at C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql.exe; add that directory to PATH or invoke the full path.

Install the npm source package

npm install @obinexusltd/sqlpolycall

The npm entry point is a source index, not a database client:

const sqlpolycall = require('@obinexusltd/sqlpolycall');

console.log(sqlpolycall.directories.sql.relativeFiles);
console.log(sqlpolycall.resolve('examples', 'run.sql'));

src, include, generated, sql, dist, examples, tests, and scripts are recursively indexed with package-relative and absolute paths.

Build the MySQL UDF

On PowerShell:

$env:MYSQL_INCLUDE_DIR = 'C:\Program Files\MySQL\MySQL Server 8.0\include'
$env:POLYCALL_LIB_DIR = 'C:\path\to\libpolycall\lib'
$env:POLYCALL_LIB_NAME = 'polycall' # optional default
npm run build

This produces dist/sqlpolycall_udf.dll on Windows or dist/sqlpolycall_udf.so on Unix. The libpolycall binary must match the MySQL server architecture and your selected C compiler.

Install in MySQL

First find the server plugin directory:

& 'C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql.exe' -uroot -p `
  -e "SHOW VARIABLES LIKE 'plugin_dir';"

Copy the built library into that plugin_dir using an elevated shell. Then register the UDF with an administrative MySQL account:

& 'C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql.exe' -uroot -p `
  -e "SOURCE C:/absolute/path/sqlpolycall/sql/install-windows.sql"

Unix users should source sql/install-unix.sql. Remove the function with sql/uninstall.sql before replacing or deleting the shared library.

Security and path behavior

The config file is opened by libpolycall inside the mysqld process. Paths are therefore resolved using the MySQL service account's filesystem permissions, not the SQL client's. Restrict EXECUTE access to trusted database roles and do not pass untrusted path input to this UDF.

SQL NULL produces SQL NULL. Embedded NUL bytes and allocation failures set the MySQL UDF error flag without calling libpolycall.

Verification and publishing

npm test
npm pack --dry-run
npm publish --access public

Tests compile the adapter against the installed MySQL UDF headers and a mock of the single libpolycall ABI function. They do not connect to MySQL or require a database password.

Author: Nnamdi Michael Okpala [email protected]

License: MIT