{"id":43525,"library":"pagi-help","title":"PagiHelp","description":"Pagination API helper for MySQL and PostgreSQL. Current stable version is 2.5.4. Release cadence is irregular. Key differentiators: ships two APIs (legacy and v2) from one package; v2 supports both MySQL and PostgreSQL dialects, cursor pagination, and named exports. Legacy API remains unchanged for backward compatibility.","status":"active","version":"2.5.4","language":"javascript","source_language":"en","source_url":"https://github.com/Codebucket-Solutions/PagiHelp","tags":["javascript","pagination","mysql","postgres","page","search","util","typescript"],"install":[{"cmd":"npm install pagi-help","lang":"bash","label":"npm"},{"cmd":"yarn add pagi-help","lang":"bash","label":"yarn"},{"cmd":"pnpm add pagi-help","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"v2 is available via subpath import 'pagi-help/v2' or named export. Using default 'pagi-help' gives legacy API.","wrong":"const PagiHelpV2 = require('pagi-help')","symbol":"PagiHelpV2","correct":"import { PagiHelpV2 } from 'pagi-help/v2'"},{"note":"Legacy API is default CommonJS export. ESM import may work but not officially supported.","wrong":"import PagiHelpLegacy from 'pagi-help'","symbol":"PagiHelpLegacy","correct":"const PagiHelpLegacy = require('pagi-help')"},{"note":"Compatibility alias for PagiHelpV2; new code should use PagiHelpV2.","wrong":"","symbol":"PagiHelpV210","correct":"import { PagiHelpV210 } from 'pagi-help'"}],"quickstart":{"code":"const PagiHelpV2 = require('pagi-help/v2');\n\nconst pagiHelp = new PagiHelpV2({\n  dialect: 'mysql',\n});\n\nconst queries = pagiHelp.paginate(\n  {\n    search: 'Active',\n    filters: [['status', 'IN', ['Active', 'Paused']]],\n    sort: {\n      attributes: ['created_at'],\n      sorts: ['desc'],\n    },\n    pageNo: 1,\n    itemsPerPage: 10,\n  },\n  [\n    {\n      tableName: 'events',\n      columnList: [\n        { name: 'id', alias: 'id' },\n        { name: 'status', alias: 'status' },\n        { name: 'created_at', alias: 'created_at' },\n      ],\n      searchColumnList: [{ name: 'status' }],\n    },\n  ]\n);\n\nconsole.log(queries);","lang":"javascript","description":"Demonstrates basic pagination with MySQL dialect: search, filters, sort, and column mapping."},"warnings":[{"fix":"Use v2 subpath import: require('pagi-help/v2') and set dialect to 'postgres'.","message":"Legacy default export does not support PostgreSQL dialect; only MySQL.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Only pass safeOptions.validate. Remove other safeOptions keys.","message":"v2 constructor rejects legacy compatibility options like safeOptions keys other than 'validate'.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Follow phase 1 rules: single table, use 'after', provide 'sort' and 'limit', omit pageNo/itemsPerPage/offset/before.","message":"Cursor pagination (paginateCursor) is only available on v2 and has strict phase 1 rules (single-table, after only, sort required, etc.).","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Replace PagiHelpV210 with PagiHelpV2 in imports.","message":"PagiHelpV210 named export is deprecated; use PagiHelpV2 instead.","severity":"deprecated","affected_versions":">=2.0.0"}],"env_vars":null,"search_vec":"'2.5.4':13 'api':3,22,42 'backward':46 'cadenc':15 'compat':47 'current':9 'cursor':36 'dialect':35 'differenti':19 'export':40 'helper':4 'irregular':17 'javascript':48 'key':18 'legaci':23,41 'mysql':6,32,50 'name':39 'one':27 'packag':28 'page':52 'pagihelp':1 'pagin':2,37,49 'postgr':51 'postgresql':8,34 'releas':14 'remain':43 'search':53 'ship':20 'stabl':10 'support':30 'two':21 'typescript':55 'unchang':44 'util':54 'v2':25,29 'version':11","created_at":"2026-06-05T17:00:13.176690+00:00","updated_at":"2026-06-05T17:00:13.176690+00:00","problems":[{"fix":"Update Node.js to >=12.19.0 or use named import: const { PagiHelpV2 } = require('pagi-help');","cause":"Using Node.js version that does not support subpath exports (pre v12.19.0) or missing package.json exports field.","error":"Cannot find module 'pagi-help/v2'"},{"fix":"Use require('pagi-help/v2') or named import { PagiHelpV2 }.","cause":"Importing legacy default export (which does not have paginate method) instead of v2.","error":"TypeError: pagiHelp.paginate is not a function"},{"fix":"Set dialect to 'mysql' or 'postgres'.","cause":"Only 'mysql' and 'postgres' are supported.","error":"Error: Unsupported dialect 'sqlite'"}],"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/Codebucket-Solutions/PagiHelp#readme","github":"https://github.com/Codebucket-Solutions/PagiHelp","docs":null,"changelog":null,"pypi":null,"npm":"pagi-help","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"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}}