Socket
Socket
Sign inDemoInstall

mql2

Package Overview
Dependencies
53
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.1 to 0.1.2

ljoin.js

3

package.json
{
"name": "mql2",
"version": "0.1.1",
"version": "0.1.2",
"description": "query builder",

@@ -15,2 +15,3 @@ "main": "index.js",

"mql.js",
"ljoin.js",
"index.js",

@@ -17,0 +18,0 @@ "LICENSE",

@@ -5,4 +5,5 @@ # MQL - Node.js 데이터베이스 쿼리 빌더

- INSERT, UPDATE, WHERE 절 등에 필요한 복잡한 쿼리를 자바스크립트 객체를 통해 쉽게 생성할 수 있습니다.
- 일반적인 SQL 문법을 유지할 수 있어, SQL을 세밀하게 튜닝하고 발전시키기 쉽습니다.
- PostgreSQL의 다양한 Operator 들을 쉽게 사용할 수 있습니다.
- 일반적인 SQL 문법을 유지할 수 있어, 서브 쿼리, 조인 등을 쉽게 작성할 수 있습니다.
- SQL을 세밀하게 튜닝하고 발전시키기 쉽습니다.
- 각 데이터베이스에서 지원하는 다양한 최신 Operator 들을 쉽게 사용할 수 있습니다.
- (예. https://www.postgresql.org/docs/current/static/functions-json.html)

@@ -21,2 +22,3 @@ - SQL Injection 공격이 불가능합니다.

- [간단한 쿼리](#간단한-쿼리)
- [서브 쿼리, 조인](#서브-쿼리-조인)
- [함수 불러오기](#함수-불러오기)

@@ -91,2 +93,26 @@ - [지원하는 헬퍼 함수](#지원하는-헬퍼-함수)

## 서브 쿼리, 조인
```javascript
const type = 'TYPE1';
const limit = 10;
QUERY `
SELECT * FROM table1 WHERE table2_id IN (
SELECT id FROM table2 WHERE type = ${type} ORDER BY id DESC LIMIT ${limit}
)
`;
const status = 'STATUS1';
QUERY `
SELECT *
FROM table1 AS t1, table2 AS t2
WHERE t1.id = t2.table1_id AND t1.status = ${status}
ORDER BY id DESC
LIMIT 10
`;
```
`CONNECT`를 통해 얻은 `QUERY`는 connection pool을 이용합니다.

@@ -93,0 +119,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc