{"id":43898,"library":"sql-extra","title":"sql-extra","description":"Utility library providing helper functions for generating common SQL commands programmatically. Current version 0.1.13. Lightweight, no dependencies, supports PostgreSQL-specific features like tsquery. Offers methods like createTable, createIndex, insertInto, and tableExists. Suitable for Node.js applications needing dynamic SQL generation. Not actively maintained; last update in 2021.","status":"maintenance","version":"0.1.13","language":"javascript","source_language":"en","source_url":"https://github.com/nodef/sql-extra","tags":["javascript","sql","extra"],"install":[{"cmd":"npm install sql-extra","lang":"bash","label":"npm"},{"cmd":"yarn add sql-extra","lang":"bash","label":"yarn"},{"cmd":"pnpm add sql-extra","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package is CommonJS-only; ESM import will fail.","wrong":"import extra from 'sql-extra'","symbol":"extra","correct":"const extra = require('sql-extra')"},{"note":"Use destructured require for named exports.","wrong":"import { createTable } from 'sql-extra'","symbol":"createTable","correct":"const { createTable } = require('sql-extra')"},{"note":"Alternative destructuring is fine; no TypeScript types.","wrong":"const createIndex = require('sql-extra').createIndex","symbol":"createIndex","correct":"const extra = require('sql-extra'); extra.createIndex(...)"}],"quickstart":{"code":"const extra = require('sql-extra');\n\nconst createTableSQL = extra.createTable(\n  'users',\n  {\n    id: 'INTEGER PRIMARY KEY',\n    name: 'TEXT NOT NULL',\n    email: 'TEXT UNIQUE'\n  },\n  { ifNotExists: true }\n);\nconsole.log(createTableSQL);\n// Output: CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY, name TEXT NOT NULL, email TEXT UNIQUE)","lang":"javascript","description":"Demonstrates generating a CREATE TABLE statement with options."},"warnings":[{"fix":"Use only with PostgreSQL or replace with alternative.","message":"Method 'matchTsquery' only generates PostgreSQL tsquery; not compatible with other databases.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Sanitize column names manually before passing.","message":"The library does not escape column names; SQL injection risk if user input used.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Migrate to a more maintained library like 'sql-bricks' or 'knex'.","message":"The package has not been updated since 2021; consider using 'sql-bricks' or 'knex' for active maintenance.","severity":"deprecated","affected_versions":">=0.0.1"}],"env_vars":null,"search_vec":"'0.1.13':17 '2021':50 'activ':45 'applic':39 'command':13 'common':11 'createindex':32 'createt':31 'current':15 'depend':20 'dynam':41 'extra':3,53 'featur':25 'function':8 'generat':10,43 'helper':7 'insertinto':33 'javascript':51 'last':47 'librari':5 'lightweight':18 'like':26,30 'maintain':46 'method':29 'need':40 'node.js':38 'offer':28 'postgresql':23 'postgresql-specif':22 'programmat':14 'provid':6 'specif':24 'sql':2,12,42,52 'sql-extra':1 'suitabl':36 'support':21 'tableexist':35 'tsqueri':27 'updat':48 'util':4 'version':16","created_at":"2026-06-05T17:02:00.827968+00:00","updated_at":"2026-06-05T17:02:00.827968+00:00","problems":[{"fix":"Run: npm install sql-extra","cause":"Package not installed or missing from node_modules.","error":"Cannot find module 'sql-extra'"},{"fix":"Use require('sql-extra') instead of import.","cause":"Incorrect import or usage when using ES6 imports.","error":"TypeError: extra.createTable is not a function"}],"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/nodef/sql-extra#readme","github":"https://github.com/nodef/sql-extra","docs":null,"changelog":null,"pypi":null,"npm":"sql-extra","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}}