@minatojs/sql-utils
Advanced tools
Comparing version 5.4.1 to 5.5.0
{ | ||
"name": "@minatojs/sql-utils", | ||
"version": "5.4.1", | ||
"version": "5.5.0", | ||
"description": "SQL Utilities for Minato", | ||
@@ -26,9 +26,9 @@ "type": "module", | ||
"type": "git", | ||
"url": "git+https://github.com/shigma/minato.git", | ||
"url": "git+https://github.com/cordiverse/minato.git", | ||
"directory": "packages/sql-utils" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/shigma/minato/issues" | ||
"url": "https://github.com/cordiverse/minato/issues" | ||
}, | ||
"homepage": "https://github.com/shigma/minato/packages/sql-utils#readme", | ||
"homepage": "https://github.com/cordiverse/minato/packages/sql-utils#readme", | ||
"keywords": [ | ||
@@ -44,4 +44,7 @@ "orm", | ||
], | ||
"devDependencies": { | ||
"cordis": "^3.18.1" | ||
}, | ||
"peerDependencies": { | ||
"minato": "^3.4.1" | ||
"minato": "^3.6.0" | ||
}, | ||
@@ -48,0 +51,0 @@ "dependencies": { |
@@ -5,4 +5,4 @@ # @minatojs/sql-utils | ||
[![npm](https://img.shields.io/npm/v/@minatojs/sql-utils?style=flat-square)](https://www.npmjs.com/package/@minatojs/sql-utils) | ||
[![GitHub](https://img.shields.io/github/license/shigma/minato?style=flat-square)](https://github.com/shigma/minato/blob/master/LICENSE) | ||
[![GitHub](https://img.shields.io/github/license/cordiverse/minato?style=flat-square)](https://github.com/cordiverse/minato/blob/master/LICENSE) | ||
SQL Utilities for Minato. |
@@ -129,3 +129,3 @@ import { Dict, isNullable } from 'cosmokit' | ||
$: (key) => this.getRecursive(key), | ||
$select: (args) => `${args.map(arg => this.parseEval(arg, false)).join(', ')}`, | ||
$select: (args) => `${args.map(arg => this.parseEval(arg)).join(', ')}`, | ||
$if: (args) => `if(${args.map(arg => this.parseEval(arg)).join(', ')})`, | ||
@@ -200,2 +200,5 @@ $ifNull: (args) => `ifnull(${args.map(arg => this.parseEval(arg)).join(', ')})`, | ||
$array: (expr) => this.groupArray(this.transform(this.parseEval(expr, false), expr, 'encode')), | ||
$get: ([x, key]) => typeof key === 'string' | ||
? this.asEncoded(`json_extract(${this.parseEval(x, false)}, '$.${key}')`, true) | ||
: this.asEncoded(`json_extract(${this.parseEval(x, false)}, concat('$[', ${this.parseEval(key)}, ']'))`, true), | ||
@@ -513,3 +516,3 @@ $exec: (sel) => this.parseSelection(sel as Selection), | ||
prefix = this.escapeId(table) | ||
} else if (table instanceof Selection) { | ||
} else if (Selection.is(table)) { | ||
prefix = this.get(table, true) | ||
@@ -561,3 +564,3 @@ if (!prefix) return | ||
if (inline && !args[0].fields && !suffix && (typeof table === 'string' || table instanceof Selection)) { | ||
if (inline && !args[0].fields && !suffix && (typeof table === 'string' || Selection.is(table))) { | ||
return (addref && isBracketed(prefix)) ? `${prefix} ${ref}` : prefix | ||
@@ -564,0 +567,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
165007
1
2384