Updates
This commit is contained in:
parent
881128fcea
commit
6e334c2525
@ -1,4 +1,4 @@
|
|||||||
import { DSQL_DATASQUIREL_USER_DATABASES } from "@/package-shared/types/dsql";
|
import { DSQL_DATASQUIREL_USER_DATABASES } from "../../types/dsql";
|
||||||
type Params = {
|
type Params = {
|
||||||
userId: number | string;
|
userId: number | string;
|
||||||
database: DSQL_DATASQUIREL_USER_DATABASES;
|
database: DSQL_DATASQUIREL_USER_DATABASES;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { DSQL_DatabaseSchemaType } from "@/package-shared/types";
|
import { DSQL_DatabaseSchemaType } from "../../types";
|
||||||
type Params = {
|
type Params = {
|
||||||
userId?: string | number;
|
userId?: string | number;
|
||||||
};
|
};
|
||||||
|
@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||||||
exports.default = grabUserSchemaData;
|
exports.default = grabUserSchemaData;
|
||||||
const serverError_1 = __importDefault(require("./serverError"));
|
const serverError_1 = __importDefault(require("./serverError"));
|
||||||
const fs_1 = __importDefault(require("fs"));
|
const fs_1 = __importDefault(require("fs"));
|
||||||
const grab_dir_names_1 = __importDefault(require("@/package-shared/utils/backend/names/grab-dir-names"));
|
const grab_dir_names_1 = __importDefault(require("../../utils/backend/names/grab-dir-names"));
|
||||||
const client_exports_1 = require("@/client-exports");
|
const ejson_1 = __importDefault(require("../../utils/ejson"));
|
||||||
/**
|
/**
|
||||||
* # Grab User Schema Data
|
* # Grab User Schema Data
|
||||||
*/
|
*/
|
||||||
@ -16,7 +16,7 @@ function grabUserSchemaData({ userId, }) {
|
|||||||
try {
|
try {
|
||||||
const { userSchemaMainJSONFilePath } = (0, grab_dir_names_1.default)({ userId });
|
const { userSchemaMainJSONFilePath } = (0, grab_dir_names_1.default)({ userId });
|
||||||
const schemaJSON = fs_1.default.readFileSync(userSchemaMainJSONFilePath || "", "utf-8");
|
const schemaJSON = fs_1.default.readFileSync(userSchemaMainJSONFilePath || "", "utf-8");
|
||||||
const schemaObj = client_exports_1.EJSON.parse(schemaJSON);
|
const schemaObj = ejson_1.default.parse(schemaJSON);
|
||||||
return schemaObj;
|
return schemaObj;
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
|
@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||||||
exports.default = setUserSchemaData;
|
exports.default = setUserSchemaData;
|
||||||
const serverError_1 = __importDefault(require("./serverError"));
|
const serverError_1 = __importDefault(require("./serverError"));
|
||||||
const fs_1 = __importDefault(require("fs"));
|
const fs_1 = __importDefault(require("fs"));
|
||||||
const grab_dir_names_1 = __importDefault(require("@/package-shared/utils/backend/names/grab-dir-names"));
|
const grab_dir_names_1 = __importDefault(require("../../utils/backend/names/grab-dir-names"));
|
||||||
/**
|
/**
|
||||||
* # Set User Schema Data
|
* # Set User Schema Data
|
||||||
*/
|
*/
|
||||||
|
@ -3,12 +3,13 @@ import { default as grabUserSchemaData } from "../../functions/backend/grabUserS
|
|||||||
import { default as setUserSchemaData } from "../../functions/backend/setUserSchemaData";
|
import { default as setUserSchemaData } from "../../functions/backend/setUserSchemaData";
|
||||||
import addDbEntry from "../../functions/backend/db/addDbEntry";
|
import addDbEntry from "../../functions/backend/db/addDbEntry";
|
||||||
import slugToCamelTitle from "../../shell/utils/slugToCamelTitle";
|
import slugToCamelTitle from "../../shell/utils/slugToCamelTitle";
|
||||||
import { DSQL_DATASQUIREL_USER_DATABASES } from "@/package-shared/types/dsql";
|
import { DSQL_DATASQUIREL_USER_DATABASES } from "../../types/dsql";
|
||||||
import {
|
import {
|
||||||
DSQL_FieldSchemaType,
|
DSQL_FieldSchemaType,
|
||||||
|
DSQL_IndexSchemaType,
|
||||||
DSQL_MYSQL_SHOW_COLUMNS_Type,
|
DSQL_MYSQL_SHOW_COLUMNS_Type,
|
||||||
DSQL_TableSchemaType,
|
DSQL_TableSchemaType,
|
||||||
} from "@/package-shared/types";
|
} from "../../types";
|
||||||
|
|
||||||
type Params = {
|
type Params = {
|
||||||
userId: number | string;
|
userId: number | string;
|
||||||
@ -113,14 +114,13 @@ export default async function createDbSchemaFromDb({
|
|||||||
|
|
||||||
if (!Index_comment?.match(/^schema_index$/)) continue;
|
if (!Index_comment?.match(/^schema_index$/)) continue;
|
||||||
|
|
||||||
const indexNewObject: import("@/package-shared/types").DSQL_IndexSchemaType =
|
const indexNewObject: DSQL_IndexSchemaType = {
|
||||||
{
|
indexType: Index_type?.match(/fulltext/i)
|
||||||
indexType: Index_type?.match(/fulltext/i)
|
? "fullText"
|
||||||
? "fullText"
|
: "regular",
|
||||||
: "regular",
|
indexName: Key_name,
|
||||||
indexName: Key_name,
|
indexTableFields: [],
|
||||||
indexTableFields: [],
|
};
|
||||||
};
|
|
||||||
|
|
||||||
const targetTableFieldObject = tableColumns?.filter(
|
const targetTableFieldObject = tableColumns?.filter(
|
||||||
(col) => col.Field === Column_name
|
(col) => col.Field === Column_name
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { DSQL_DatabaseSchemaType, UserType } from "@/package-shared/types";
|
import { DSQL_DatabaseSchemaType, UserType } from "../../types";
|
||||||
import serverError from "./serverError";
|
import serverError from "./serverError";
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import grabDirNames from "@/package-shared/utils/backend/names/grab-dir-names";
|
import grabDirNames from "../../utils/backend/names/grab-dir-names";
|
||||||
import { EJSON } from "@/client-exports";
|
import EJSON from "../../utils/ejson";
|
||||||
|
|
||||||
type Params = {
|
type Params = {
|
||||||
userId?: string | number;
|
userId?: string | number;
|
||||||
|
@ -2,7 +2,7 @@ import serverError from "./serverError";
|
|||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import { DSQL_DatabaseSchemaType } from "../../types";
|
import { DSQL_DatabaseSchemaType } from "../../types";
|
||||||
import grabDirNames from "@/package-shared/utils/backend/names/grab-dir-names";
|
import grabDirNames from "../../utils/backend/names/grab-dir-names";
|
||||||
|
|
||||||
type Param = {
|
type Param = {
|
||||||
userId: string | number;
|
userId: string | number;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@moduletrace/datasquirel",
|
"name": "@moduletrace/datasquirel",
|
||||||
"version": "4.7.3",
|
"version": "4.7.4",
|
||||||
"description": "Cloud-based SQL data management tool",
|
"description": "Cloud-based SQL data management tool",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
|
Loading…
Reference in New Issue
Block a user