mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-26 09:56:00 +00:00
data duplicator works in simple case
This commit is contained in:
@@ -155,6 +155,10 @@ class MsSqlDumper extends SqlDumper {
|
||||
newname
|
||||
);
|
||||
}
|
||||
|
||||
selectScopeIdentity() {
|
||||
this.put('^select ^scope_identity()');
|
||||
}
|
||||
}
|
||||
|
||||
MsSqlDumper.prototype.renameView = MsSqlDumper.prototype.renameObject;
|
||||
|
||||
@@ -89,6 +89,10 @@ class Dumper extends SqlDumper {
|
||||
putByteArrayValue(value) {
|
||||
this.putRaw(`unhex('${arrayToHexString(value)}')`);
|
||||
}
|
||||
|
||||
selectScopeIdentity() {
|
||||
this.put('^select ^last_insert_id()')
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Dumper;
|
||||
|
||||
@@ -99,6 +99,14 @@ class Dumper extends SqlDumper {
|
||||
putByteArrayValue(value) {
|
||||
this.putRaw(`e'\\\\x${arrayToHexString(value)}'`);
|
||||
}
|
||||
|
||||
selectScopeIdentity(table) {
|
||||
this.put(
|
||||
"^SELECT currval(pg_get_serial_sequence('%f','%s'))",
|
||||
table,
|
||||
table.columns?.find(x => x.autoIncrement)?.[0]?.columnName
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Dumper;
|
||||
|
||||
@@ -16,6 +16,10 @@ class Dumper extends SqlDumper {
|
||||
truncateTable(name) {
|
||||
this.putCmd('^delete ^from %f', name);
|
||||
}
|
||||
|
||||
selectScopeIdentity() {
|
||||
this.put('^select last_insert_rowid()')
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Dumper;
|
||||
|
||||
Reference in New Issue
Block a user