Skip to content

Commit

Permalink
fix: new scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
yjl9903 committed Apr 9, 2023
1 parent 5300dc7 commit 710cd5b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/d1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ cli.command('resource', 'Generate resources sql').action(async (option) => {
`);
}
const sc: string[] = [];
const chunkSize = 500;
const chunkSize = 1000;
for (let i = 0, p = 0; i < lines.length; p += 1, i += chunkSize) {
const chunk = lines.slice(i, i + chunkSize);
sc.push(`pnpm -C packages/worker d1:execute data/resource-${p}.sql`);
sc.push(`pnpm -C packages/worker db:exec data/resource-${p}.sql`);
fs.writeFile(`./packages/worker/data/resource-${p}.sql`, chunk.join('\n'), 'utf-8');
}
await fs.writeFile('upload.ps1', sc.join('\n'), 'utf-8');
Expand Down

0 comments on commit 710cd5b

Please sign in to comment.