mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-29 15:43:59 +00:00
insert into tables with identity
This commit is contained in:
@@ -198,6 +198,7 @@ class SqlDumper {
|
||||
lambda(item);
|
||||
}
|
||||
}
|
||||
|
||||
/** @param table {import('@dbgate/types').TableInfo} */
|
||||
createTable(table) {
|
||||
this.put('^create ^table %f ( &>&n', table);
|
||||
@@ -253,6 +254,12 @@ class SqlDumper {
|
||||
if (fk.deleteAction) this.put(' ^on ^delete %k', fk.deleteAction);
|
||||
if (fk.updateAction) this.put(' ^on ^update %k', fk.updateAction);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param table {import('@dbgate/types').NamedObjectInfo}
|
||||
* @param allow {boolean}
|
||||
*/
|
||||
allowIdentityInsert(table, allow) {}
|
||||
}
|
||||
|
||||
module.exports = SqlDumper;
|
||||
|
||||
@@ -11,6 +11,10 @@ class MsSqlDumper extends SqlDumper {
|
||||
}
|
||||
super.putStringValue(value);
|
||||
}
|
||||
|
||||
allowIdentityInsert(table, allow) {
|
||||
this.putCmd("^set ^identity_insert %f %k;&n", table, allow ? "on" : "off");
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = MsSqlDumper;
|
||||
|
||||
Reference in New Issue
Block a user