Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nocobase/database

Package Overview
Dependencies
Maintainers
1
Versions
428
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nocobase/database - npm Package Compare versions

Comparing version 0.5.0-alpha.20 to 0.5.0-alpha.21

1

lib/database.js

@@ -178,3 +178,2 @@ "use strict";

const state = this.hookTypes.get(hookType);
console.log('sequelize.addHook', event, hookType);
this.sequelize.addHook(hookType, (...args) => __awaiter(this, void 0, void 0, function* () {

@@ -181,0 +180,0 @@ var _a, _b, _c, _d, _e, _f;

2

lib/model.d.ts

@@ -35,3 +35,3 @@ import { Model as SequelizeModel, ProjectionAlias, SaveOptions } from 'sequelize';

get database(): Database;
static withCountAttribute(options?: string | WithCountAttributeOptions): (string | ProjectionAlias);
static withCountAttribute(options?: string | WithCountAttributeOptions): string | ProjectionAlias;
static selectQuery(options?: {}): string;

@@ -38,0 +38,0 @@ static parseApiJson(options: ApiJsonOptions): any;

@@ -75,19 +75,31 @@ "use strict";

}));
op.set('$includes', value => ({
[sequelize_1.Op.iLike]: `%${value}%`
op.set('$includes', (value, {
dialect
}) => ({
[dialect === 'postgres' ? sequelize_1.Op.iLike : sequelize_1.Op.like]: `%${value}%`
}));
op.set('$notIncludes', value => ({
[sequelize_1.Op.notILike]: `%${value}%`
op.set('$notIncludes', (value, {
dialect
}) => ({
[dialect === 'postgres' ? sequelize_1.Op.notILike : sequelize_1.Op.notLike]: `%${value}%`
}));
op.set('$startsWith', value => ({
[sequelize_1.Op.iLike]: `${value}%`
op.set('$startsWith', (value, {
dialect
}) => ({
[dialect === 'postgres' ? sequelize_1.Op.iLike : sequelize_1.Op.like]: `${value}%`
}));
op.set('$notStartsWith', value => ({
[sequelize_1.Op.notILike]: `${value}%`
op.set('$notStartsWith', (value, {
dialect
}) => ({
[dialect === 'postgres' ? sequelize_1.Op.notILike : sequelize_1.Op.notLike]: `${value}%`
}));
op.set('$endsWith', value => ({
[sequelize_1.Op.iLike]: `%${value}`
op.set('$endsWith', (value, {
dialect
}) => ({
[dialect === 'postgres' ? sequelize_1.Op.iLike : sequelize_1.Op.like]: `%${value}`
}));
op.set('$notEndsWith', value => ({
[sequelize_1.Op.notILike]: `%${value}`
op.set('$notEndsWith', (value, {
dialect
}) => ({
[dialect === 'postgres' ? sequelize_1.Op.notILike : sequelize_1.Op.notLike]: `%${value}`
}));

@@ -149,3 +161,2 @@ op.set('$dateOn', value => ({

const sql = values.map(value => `(${column})::jsonb @> '${JSON.stringify(value)}'`).join(' OR ');
console.log(sql);
return sequelize_1.Sequelize.literal(sql);

@@ -171,3 +182,2 @@ });

const sql = values.map(value => `(${column})::jsonb @> '${JSON.stringify(value)}'`).join(' OR ');
console.log(sql);
return sequelize_1.Sequelize.literal(`not (${sql})`);

@@ -218,3 +228,2 @@ });

exports.default = Operator;
;
//# sourceMappingURL=op.js.map

@@ -17,3 +17,3 @@ import { InitOptions, ModelAttributes, ModelOptions, ModelIndexesOptions, SyncOptions } from 'sequelize';

}
export interface TabelContext {
export interface TableContext {
database: Database;

@@ -36,3 +36,3 @@ }

get sortable(): boolean;
constructor(options: TableOptions, context: TabelContext);
constructor(options: TableOptions, context: TableContext);
initSortable(): void;

@@ -39,0 +39,0 @@ modelInit(reinitialize?: Reinitialize): void;

@@ -307,4 +307,14 @@ "use strict";

for (const key in fields) {
this.addField(fields[key], false);
var _iterator3 = _createForOfIteratorHelper(fields),
_step3;
try {
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
const filed = _step3.value;
this.addField(filed, false);
}
} catch (err) {
_iterator3.e(err);
} finally {
_iterator3.f();
}

@@ -423,14 +433,14 @@

var _iterator3 = _createForOfIteratorHelper(this.getRelatedTableNames()),
_step3;
var _iterator4 = _createForOfIteratorHelper(this.getRelatedTableNames()),
_step4;
try {
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
const name = _step3.value;
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
const name = _step4.value;
tables.push(name);
}
} catch (err) {
_iterator3.e(err);
_iterator4.e(err);
} finally {
_iterator3.f();
_iterator4.f();
}

@@ -437,0 +447,0 @@

@@ -106,2 +106,3 @@ "use strict";

database,
dialect: database.sequelize.getDialect(),
fieldPath: name ? `${name}.${prefix}` : prefix

@@ -108,0 +109,0 @@ });

{
"name": "@nocobase/database",
"version": "0.5.0-alpha.20",
"version": "0.5.0-alpha.21",
"description": "",

@@ -13,3 +13,3 @@ "main": "./lib/index.js",

"glob": "^7.1.6",
"sequelize": "^6.3.3"
"sequelize": "6.7.0"
},

@@ -21,3 +21,3 @@ "repository": {

},
"gitHead": "d80c875d5e3acacf2f682c954f3b6e63c0386340"
"gitHead": "181872cf075dd9e65f9f2ff0d1ff18c541e0d7cd"
}

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

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc