2020-03-12 11:46:07 +00:00
|
|
|
const SqlDumper = require('../default/SqlDumper');
|
2020-02-02 18:27:25 +00:00
|
|
|
|
2020-03-03 07:01:24 +00:00
|
|
|
class MsSqlDumper extends SqlDumper {
|
|
|
|
autoIncrement() {
|
2020-03-12 11:46:07 +00:00
|
|
|
this.put(' ^identity');
|
|
|
|
}
|
|
|
|
|
|
|
|
putStringValue(value) {
|
|
|
|
if (/[^\u0000-\u00ff]/.test(value)) {
|
|
|
|
this.putRaw('N');
|
|
|
|
}
|
|
|
|
super.putStringValue(value);
|
2020-03-03 07:01:24 +00:00
|
|
|
}
|
2020-05-21 13:09:48 +00:00
|
|
|
|
|
|
|
allowIdentityInsert(table, allow) {
|
|
|
|
this.putCmd("^set ^identity_insert %f %k;&n", table, allow ? "on" : "off");
|
|
|
|
}
|
2020-03-03 07:01:24 +00:00
|
|
|
}
|
2020-02-02 18:27:25 +00:00
|
|
|
|
|
|
|
module.exports = MsSqlDumper;
|