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

@directus/schema

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@directus/schema - npm Package Compare versions

Comparing version 9.0.0-rc.68 to 9.0.0-rc.69

@@ -28,2 +28,21 @@ "use strict";

};
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

@@ -65,7 +84,4 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }

};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var mssql_1 = __importDefault(require("knex-schema-inspector/dist/dialects/mssql"));
var mssql_1 = __importStar(require("knex-schema-inspector/dist/dialects/mssql"));
var MSSQL = /** @class */ (function (_super) {

@@ -81,3 +97,3 @@ __extends(MSSQL, _super);

return __awaiter(this, void 0, void 0, function () {
var columns, overview, _loop_1, this_1, _i, columns_1, column;
var columns, overview, _loop_1, _i, columns_1, column;
return __generator(this, function (_b) {

@@ -98,5 +114,4 @@ switch (_b.label) {

}
overview[column.table_name].columns[column.column_name] = __assign(__assign({}, column), { default_value: column.is_identity ? 'AUTO_INCREMENT' : this_1.parseDefaultValue(column.default_value), is_nullable: column.is_nullable === 'YES' });
overview[column.table_name].columns[column.column_name] = __assign(__assign({}, column), { default_value: column.is_identity ? 'AUTO_INCREMENT' : mssql_1.parseDefaultValue(column.default_value), is_nullable: column.is_nullable === 'YES' });
};
this_1 = this;
for (_i = 0, columns_1 = columns; _i < columns_1.length; _i++) {

@@ -103,0 +118,0 @@ column = columns_1[_i];

@@ -28,2 +28,21 @@ "use strict";

};
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

@@ -65,7 +84,4 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }

};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var mysql_1 = __importDefault(require("knex-schema-inspector/dist/dialects/mysql"));
var mysql_1 = __importStar(require("knex-schema-inspector/dist/dialects/mysql"));
var MySQL = /** @class */ (function (_super) {

@@ -95,3 +111,3 @@ __extends(MySQL, _super);

}
overview[column.table_name].columns[column.column_name] = __assign(__assign({}, column), { default_value: column.extra === 'auto_increment' ? 'AUTO_INCREMENT' : column.default_value, is_nullable: column.is_nullable === 'YES' });
overview[column.table_name].columns[column.column_name] = __assign(__assign({}, column), { default_value: column.extra === 'auto_increment' ? 'AUTO_INCREMENT' : mysql_1.parseDefaultValue(column.default_value), is_nullable: column.is_nullable === 'YES' });
};

@@ -98,0 +114,0 @@ for (_i = 0, _b = columns[0]; _i < _b.length; _i++) {

@@ -28,2 +28,21 @@ "use strict";

};
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

@@ -65,7 +84,4 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }

};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var postgres_1 = __importDefault(require("knex-schema-inspector/dist/dialects/postgres"));
var postgres_1 = __importStar(require("knex-schema-inspector/dist/dialects/postgres"));
var Postgres = /** @class */ (function (_super) {

@@ -79,3 +95,3 @@ __extends(Postgres, _super);

return __awaiter(this, void 0, void 0, function () {
var _c, columnsResult, primaryKeysResult, columns, primaryKeys, overview, _loop_1, this_1, _i, columns_1, column;
var _c, columnsResult, primaryKeysResult, columns, primaryKeys, overview, _loop_1, _i, columns_1, column;
return __generator(this, function (_d) {

@@ -102,5 +118,4 @@ switch (_d.label) {

? 'AUTO_INCREMENT'
: this_1.parseDefaultValue(column.default_value), is_nullable: column.is_nullable === 'YES' });
: postgres_1.parseDefaultValue(column.default_value), is_nullable: column.is_nullable === 'YES' });
};
this_1 = this;
for (_i = 0, columns_1 = columns; _i < columns_1.length; _i++) {

@@ -107,0 +122,0 @@ column = columns_1[_i];

{
"name": "@directus/schema",
"version": "9.0.0-rc.68",
"version": "9.0.0-rc.69",
"description": "Utility for extracting information about existing DB schema",

@@ -49,3 +49,3 @@ "main": "dist/index.js",

},
"gitHead": "8a94ff06edac8c6d01e53269838d999b2853be84"
"gitHead": "1d7e977eb8650127b2f5c83d529d0b6f188e7d6c"
}

@@ -1,2 +0,2 @@

import KnexMSSQL from 'knex-schema-inspector/dist/dialects/mssql';
import KnexMSSQL, { parseDefaultValue } from 'knex-schema-inspector/dist/dialects/mssql';
import { SchemaOverview } from '../types/overview';

@@ -49,3 +49,3 @@ import { SchemaInspector } from '../types/schema';

...column,
default_value: column.is_identity ? 'AUTO_INCREMENT' : this.parseDefaultValue(column.default_value),
default_value: column.is_identity ? 'AUTO_INCREMENT' : parseDefaultValue(column.default_value),
is_nullable: column.is_nullable === 'YES',

@@ -52,0 +52,0 @@ };

@@ -1,2 +0,2 @@

import KnexMySQL from 'knex-schema-inspector/dist/dialects/mysql';
import KnexMySQL, { parseDefaultValue } from 'knex-schema-inspector/dist/dialects/mysql';
import { SchemaOverview } from '../types/overview';

@@ -42,3 +42,3 @@ import { SchemaInspector } from '../types/schema';

...column,
default_value: column.extra === 'auto_increment' ? 'AUTO_INCREMENT' : column.default_value,
default_value: column.extra === 'auto_increment' ? 'AUTO_INCREMENT' : parseDefaultValue(column.default_value),
is_nullable: column.is_nullable === 'YES',

@@ -45,0 +45,0 @@ };

@@ -1,2 +0,2 @@

import KnexPostgres from 'knex-schema-inspector/dist/dialects/postgres';
import KnexPostgres, { parseDefaultValue } from 'knex-schema-inspector/dist/dialects/postgres';
import { SchemaOverview } from '../types/overview';

@@ -71,3 +71,3 @@ import { SchemaInspector } from '../types/schema';

? 'AUTO_INCREMENT'
: this.parseDefaultValue(column.default_value),
: parseDefaultValue(column.default_value),
is_nullable: column.is_nullable === 'YES',

@@ -74,0 +74,0 @@ };