{"library":"lego-sql","type":"library","category":null,"description":"Lego is a lightweight SQL (string) builder for Node.js that uses ES6 template strings to parameterize queries. Instead of abstracting SQL, it embraces raw SQL while safely handling parameterization. Current stable version is 5.0.1, with active maintenance. Key differentiators: no ORM-like abstraction, uses tagged template literals for safe parameterized queries, supports nested queries with arrays of Lego instances, built-in row-to-object parsing, and transaction support via export. Unlike knex.js, Lego does not provide a full query building API but rather wraps SQL strings with parameter injection.","language":"javascript","status":"active","version":"5.0.1","tags":["javascript","lego","sql","postgres","knex","sql builder","template strings"],"last_verified":"Fri Jun 05","install":[{"cmd":"npm install lego-sql","imports":["import { Lego } from 'lego-sql'","import lego from 'lego-sql'","import { Lego } from 'lego-sql'; await Lego.sql `SELECT 1`","import { Lego } from 'lego-sql'; const column = 'name'; const lego = Lego.sql `UPDATE users SET ${Lego.raw(column)} = ${value}`","import { Lego } from 'lego-sql'; const rows = []; const result = Lego.parse(rows, definition)"]},{"cmd":"yarn add lego-sql","imports":[]},{"cmd":"pnpm add lego-sql","imports":[]}],"homepage":"https://github.com/martijndeh/lego#readme","github":"https://github.com/martijndeh/lego","docs":null,"changelog":null,"pypi":null,"npm":"lego-sql","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":null}