{"id":43633,"library":"plv8ify","title":"plv8ify","description":"Bundles TypeScript/JavaScript input into SQL files containing Postgres functions using PLV8. Current stable version: 0.0.67, pre-1.0 with frequent releases. Differentiators: enables code sharing between API and database by transpiling TypeScript to PLV8 (Postgres JavaScript engine) functions; supports triggers, custom schemas, and custom type mappings; similar to plv8ts but with CLI focus and schema support.","status":"active","version":"0.0.67","language":"javascript","source_language":"en","source_url":"https://github.com/divyenduz/plv8ify","tags":["javascript","typescript"],"install":[{"cmd":"npm install plv8ify","lang":"bash","label":"npm"},{"cmd":"yarn add plv8ify","lang":"bash","label":"yarn"},{"cmd":"pnpm add plv8ify","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"plv8ify is a CLI tool, not a library. It is used via npx or global install.","wrong":"require('plv8ify')","symbol":"plv8ify CLI","correct":"npx plv8ify generate input.ts"}],"quickstart":{"code":"// input.ts\nimport { point } from '@turf/helpers'\n\nexport function myPoint(lat: number, long: number): { coordinates: number[] } {\n  const pt = point([lat, long])\n  return pt\n}\n\n// Run: npx plv8ify generate input.ts\n// Executes ./plv8-dist/plv8ify_myPoint.plv8.sql in Postgres\n// Then call: SELECT plv8ify_myPoint(52.52, 13.405);","lang":"typescript","description":"Demonstrates basic usage: write a TypeScript function using a npm package, generate SQL via CLI, and call it from Postgres."},"warnings":[{"fix":"Install globally or use npx: npx plv8ify generate ...","message":"plv8ify is a CLI tool; do not import it as a module. Attempting require('plv8ify') will fail with 'MODULE_NOT_FOUND'.","severity":"gotcha","affected_versions":"*"},{"fix":"Install PLV8 extension: CREATE EXTENSION IF NOT EXISTS plv8;","message":"The generated SQL must be executed in a Postgres instance with PLV8 installed. Without PLV8, functions will not work.","severity":"gotcha","affected_versions":"*"},{"fix":"Monitor releases for breaking changes; pin version in package.json.","message":"Version 0.0.x is pre-1.0 and API may change. The --types-config-file option and custom type mapping are experimental.","severity":"deprecated","affected_versions":"<1.0.0"},{"fix":"Export all functions you want as Postgres functions; use esbuild or other bundler for dependencies.","message":"Only exported functions generate SQL. Helper functions not exported are inlined unless bundled with a bundler like esbuild.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"search_vec":"'-1.0':18 '0.0.67':16 'api':27 'bundl':2 'cli':52 'code':24 'contain':8 'current':13 'custom':41,44 'databas':29 'differenti':22 'enabl':23 'engin':37 'file':7 'focus':53 'frequent':20 'function':10,38 'input':4 'javascript':36,57 'map':46 'plv8':12,34 'plv8ify':1 'plv8ts':49 'postgr':9,35 'pre':17 'releas':21 'schema':42,55 'share':25 'similar':47 'sql':6 'stabl':14 'support':39,56 'transpil':31 'trigger':40 'type':45 'typescript':32,58 'typescript/javascript':3 'use':11 'version':15","created_at":"2026-06-05T17:00:43.998565+00:00","updated_at":"2026-06-05T17:00:43.998565+00:00","problems":[{"fix":"Use npx plv8ify generate ... or install globally with npm install -g plv8ify","cause":"Trying to import plv8ify as a Node module instead of using CLI.","error":"Error: Cannot find module 'plv8ify'"},{"fix":"Run npx plv8ify generate ... or npm install -g plv8ify","cause":"plv8ify is not installed or not in PATH.","error":"plv8ify: command not found"},{"fix":"Run the generated SQL file in your Postgres database using psql or your preferred client.","cause":"The generated SQL has not been executed in Postgres or the function name is incorrect.","error":"ERROR: function plv8ify_xxx does not exist"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/divyenduz/plv8ify#readme","github":"https://github.com/divyenduz/plv8ify","docs":null,"changelog":null,"pypi":null,"npm":"plv8ify","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database","devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-05","next_check":"2026-09-03","install_tag":null}}