Files
dbgate/plugins/dbgate-plugin-sqlite/src/frontend/Dumper.js
2023-02-11 10:17:10 +01:00

26 lines
590 B
JavaScript

const { SqlDumper, arrayToHexString } = global.DBGATE_TOOLS;
class Dumper extends SqlDumper {
renameColumn(column, newcol) {
this.putCmd('^alter ^table %f ^rename ^column %i ^to %i', column, column.columnName, newcol);
}
renameTable(obj, newname) {
this.putCmd('^alter ^table %f ^rename ^to %i', obj, newname);
}
putByteArrayValue(value) {
this.putRaw(`x'${arrayToHexString(value)}'`);
}
truncateTable(name) {
this.putCmd('^delete ^from %f', name);
}
selectScopeIdentity() {
this.put('^select last_insert_rowid()')
}
}
module.exports = Dumper;