Socket
Book a DemoInstallSign in
Socket

coral-sql

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

coral-sql

The nodejs module for building SQL by complec and related like coral.

latest
npmnpm
Version
1.5.5
Version published
Weekly downloads
125
-59.81%
Maintainers
1
Weekly downloads
 
Created
Source

coral-sql

npm version CI

The nodejs module for building SQL by complec and related like coral.

Installation

> npm install coral-sql
> yarn add coral-sql

Usage

import { createBuilder } from 'coral-sql'

const [sql, bindings] = createBuilder()
  .columns('age')
  .columns(unescape('COUNT(*)'), 'value')
  .from('users')
  .where('enabled', true)
  .groupBy('age')
  .having('value', '>=', 10)
  .orderBy('value', 'desc')
  .toSQL()

const query = await connection.query(sql, bindings)
// SELECT `age`, COUNT(*) AS `value` FROM `users` WHERE `enabled` = ? GROUP BY `age` HAVING `value` >= ? ORDER BY `value` DESC
// [1, 10]

Documentation

Document is here.

Keywords

sql

FAQs

Package last updated on 26 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts