Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@mikro-orm/sql

Package Overview
Dependencies
Maintainers
1
Versions
629
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mikro-orm/sql - npm Package Compare versions

Comparing version
7.1.4-dev.0
to
7.1.4-dev.1
+9
-4
dialects/postgresql/PostgreSqlSchemaHelper.js

@@ -489,6 +489,9 @@ import { DeferMode, EnumType, Type, Utils, } from '@mikro-orm/core';

// CHECK: unwrap the `CHECK ((<predicate>))` shell and drop pg-added `::type` casts so the
// inner predicate matches the user's metadata. EXCLUDE bodies are kept verbatim — the user's
// `@Check` expression is the full body (see SchemaHelper.createCheck).
// inner predicate matches the user's metadata. Bare boolean bodies (e.g. a top-level CASE)
// are emitted as the single-paren `CHECK (<predicate>)` form, which we unwrap too. EXCLUDE
// bodies are kept verbatim — the user's `@Check` expression is the full body (see
// SchemaHelper.createCheck).
const m = /^check \(\((.*)\)\)$/is.exec(check.expression);
const def = m ? m[1].replace(/\((.*?)\)::\w+/g, '$1') : check.expression;
const single = m ? null : /^check \((.*)\)$/is.exec(check.expression);
const def = m ? m[1].replace(/\((.*?)\)::\w+/g, '$1') : single ? single[1] : check.expression;
ret[key].push({

@@ -829,3 +832,5 @@ name: check.name,

const m1 = item.definition?.match(/check \(\(\("?(\w+)"?\)::/i) || item.definition?.match(/check \(\("?(\w+)"? = /i);
const m2 = item.definition?.match(/\(array\[(.*)]\)/i) || item.definition?.match(/ = (.*)\)/i);
// the single-value form must compare against a quoted literal (`= 'a'::text`); anything else
// (e.g. a JSON `->>` extraction like `name = data->>'name'`) is not an enum constraint
const m2 = item.definition?.match(/\(array\[(.*)]\)/i) || item.definition?.match(/ = ('(?:[^']|'')*'::[\w ]+)\)/i);
if (item.columnName && m1 && m2) {

@@ -832,0 +837,0 @@ /* v8 ignore next */

{
"name": "@mikro-orm/sql",
"version": "7.1.4-dev.0",
"version": "7.1.4-dev.1",
"description": "TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.",

@@ -56,3 +56,3 @@ "keywords": [

"peerDependencies": {
"@mikro-orm/core": "7.1.4-dev.0"
"@mikro-orm/core": "7.1.4-dev.1"
},

@@ -59,0 +59,0 @@ "engines": {