Skip to content

Commit

Permalink
Clarify that wrangler d1 execute defaults to remote DB (#4202)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshthoward committed Oct 18, 2023
1 parent 039acfd commit e81b161
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/wrangler/src/d1/execute.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,11 @@ async function executeLocally({
const persistencePath = getLocalPersistencePath(persistTo, config.configPath);
const d1Persist = path.join(persistencePath, "v3", "d1");

logger.log(`🌀 Loading ${id} from ${readableRelative(d1Persist)}`);
logger.log(
`🌀 Executing on local database ${name} (${id}) from ${readableRelative(
d1Persist
)}:`
);

const mf = new Miniflare({
modules: true,
Expand Down Expand Up @@ -313,7 +317,10 @@ async function executeRemotely({
);
}
const dbUuid = preview ? db.previewDatabaseUuid : db.uuid;
logger.log(`🌀 Executing on ${name} (${dbUuid}):`);
logger.log(`🌀 Executing on remote database ${name} (${dbUuid}):`);
logger.log(
"🌀 To execute on your local development database, pass the --local flag to 'wrangler d1 execute'"
);

const results: QueryResult[] = [];
for (const sql of batches) {
Expand Down

0 comments on commit e81b161

Please sign in to comment.