mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-25 09:45:59 +00:00
This commit is contained in:
@@ -81,7 +81,7 @@ class Analyser extends DatabaseAnalyser {
|
|||||||
tables: tables.rows.map(table => ({
|
tables: tables.rows.map(table => ({
|
||||||
...table,
|
...table,
|
||||||
objectId: table.pureName,
|
objectId: table.pureName,
|
||||||
contentHash: table.modifyDate && table.modifyDate.toISOString(),
|
contentHash: _.isDate(table.modifyDate) ? table.modifyDate.toISOString() : table.modifyDate,
|
||||||
columns: columns.rows.filter(col => col.pureName == table.pureName).map(getColumnInfo),
|
columns: columns.rows.filter(col => col.pureName == table.pureName).map(getColumnInfo),
|
||||||
primaryKey: DatabaseAnalyser.extractPrimaryKeys(table, pkColumns.rows),
|
primaryKey: DatabaseAnalyser.extractPrimaryKeys(table, pkColumns.rows),
|
||||||
foreignKeys: DatabaseAnalyser.extractForeignKeys(table, fkColumns.rows),
|
foreignKeys: DatabaseAnalyser.extractForeignKeys(table, fkColumns.rows),
|
||||||
@@ -103,8 +103,7 @@ class Analyser extends DatabaseAnalyser {
|
|||||||
|
|
||||||
uniques: _.uniqBy(
|
uniques: _.uniqBy(
|
||||||
indexes.rows.filter(
|
indexes.rows.filter(
|
||||||
idx =>
|
idx => idx.tableName == table.pureName && uniqueNames.rows.find(x => x.constraintName == idx.constraintName)
|
||||||
idx.tableName == table.pureName && uniqueNames.rows.find(x => x.constraintName == idx.constraintName)
|
|
||||||
),
|
),
|
||||||
'constraintName'
|
'constraintName'
|
||||||
).map(idx => ({
|
).map(idx => ({
|
||||||
@@ -119,7 +118,7 @@ class Analyser extends DatabaseAnalyser {
|
|||||||
views: views.rows.map(view => ({
|
views: views.rows.map(view => ({
|
||||||
...view,
|
...view,
|
||||||
objectId: view.pureName,
|
objectId: view.pureName,
|
||||||
contentHash: view.modifyDate && view.modifyDate.toISOString(),
|
contentHash: _.isDate(view.modifyDate) ? view.modifyDate.toISOString() : view.modifyDate,
|
||||||
columns: columns.rows.filter(col => col.pureName == view.pureName).map(getColumnInfo),
|
columns: columns.rows.filter(col => col.pureName == view.pureName).map(getColumnInfo),
|
||||||
createSql: viewTexts[view.pureName],
|
createSql: viewTexts[view.pureName],
|
||||||
requiresFormat: true,
|
requiresFormat: true,
|
||||||
@@ -130,7 +129,7 @@ class Analyser extends DatabaseAnalyser {
|
|||||||
.map(x => ({
|
.map(x => ({
|
||||||
...x,
|
...x,
|
||||||
objectId: x.pureName,
|
objectId: x.pureName,
|
||||||
contentHash: x.modifyDate && x.modifyDate.toISOString(),
|
contentHash: _.isDate(x.modifyDate) ? x.modifyDate.toISOString() : x.modifyDate,
|
||||||
})),
|
})),
|
||||||
functions: programmables.rows
|
functions: programmables.rows
|
||||||
.filter(x => x.objectType == 'FUNCTION')
|
.filter(x => x.objectType == 'FUNCTION')
|
||||||
@@ -138,7 +137,7 @@ class Analyser extends DatabaseAnalyser {
|
|||||||
.map(x => ({
|
.map(x => ({
|
||||||
...x,
|
...x,
|
||||||
objectId: x.pureName,
|
objectId: x.pureName,
|
||||||
contentHash: x.modifyDate && x.modifyDate.toISOString(),
|
contentHash: _.isDate(x.modifyDate) ? x.modifyDate.toISOString() : x.modifyDate,
|
||||||
})),
|
})),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -160,14 +159,14 @@ class Analyser extends DatabaseAnalyser {
|
|||||||
.map(x => ({
|
.map(x => ({
|
||||||
...x,
|
...x,
|
||||||
objectId: x.pureName,
|
objectId: x.pureName,
|
||||||
contentHash: x.modifyDate && x.modifyDate.toISOString(),
|
contentHash: _.isDate(x.modifyDate) ? x.modifyDate.toISOString() : x.modifyDate,
|
||||||
})),
|
})),
|
||||||
views: tableModificationsQueryData.rows
|
views: tableModificationsQueryData.rows
|
||||||
.filter(x => x.objectType == 'VIEW')
|
.filter(x => x.objectType == 'VIEW')
|
||||||
.map(x => ({
|
.map(x => ({
|
||||||
...x,
|
...x,
|
||||||
objectId: x.pureName,
|
objectId: x.pureName,
|
||||||
contentHash: x.modifyDate && x.modifyDate.toISOString(),
|
contentHash: _.isDate(x.modifyDate) ? x.modifyDate.toISOString() : x.modifyDate,
|
||||||
})),
|
})),
|
||||||
procedures: procedureModificationsQueryData.rows.map(x => ({
|
procedures: procedureModificationsQueryData.rows.map(x => ({
|
||||||
contentHash: x.Modified,
|
contentHash: x.Modified,
|
||||||
|
|||||||
@@ -39,9 +39,9 @@ const drivers = driverBases.map(driverBase => ({
|
|||||||
rowsAsArray: true,
|
rowsAsArray: true,
|
||||||
supportBigNumbers: true,
|
supportBigNumbers: true,
|
||||||
bigNumberStrings: true,
|
bigNumberStrings: true,
|
||||||
|
dateStrings: true,
|
||||||
// TODO: test following options
|
// TODO: test following options
|
||||||
// multipleStatements: true,
|
// multipleStatements: true,
|
||||||
// dateStrings: true,
|
|
||||||
});
|
});
|
||||||
connection._database_name = database;
|
connection._database_name = database;
|
||||||
return connection;
|
return connection;
|
||||||
|
|||||||
Reference in New Issue
Block a user