nodejs 读写文件
import { readFileSync, writeFileSync } from 'fs';
const solutionData = JSON.parse(readFileSync('kkkkk.txt', 'utf8'));
solutionData.unassigned_aircraft_list = [];
const json = JSON.stringify(solutionData).replace(/'/g, "''");
writeFileSync(
'caonima.sql',
`UPDATE stand_allocation_solve_solutions
SET solution_data = '${json}'::jsonb
WHERE id = 'maliang-123';\n`,
'utf8',
);
漫思
浙公网安备 33010602011771号