question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

It would be great to have a way to “dry run” a migration to see what would run as well as a flag to print the SQL for a set of migrations.

For example:

$ knex --dry-run migrate:latest
Would migrate <x>
Would migrate <y>

$ knex --dry-run --print-sql migrate:latest
ALTER TABLE ...
DROP TABLE ...

That way you could easily see what would happen, and also export the sql to file for other purposes.

Let me know what you think.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Reactions:2
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
falkenhawkcommented, Nov 20, 2017

@kabirbaidhya i am looking forward! have you had any success implementing a dry-run option and showing sql queries without executing them?

1reaction
kabirbaidhyacommented, Oct 5, 2017

Makes sense. I’ll give it a try and will do a PR, can have further discussion on the PR itself.

Also, I agree on separating these features in separate PRs, I’ll try to work on the ability to print plain SQL when dry-run first.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CLI: improved - Remy Sharp
CLI : improved. ... Over the years my command line habits have improved and I often search for smarter tools for the jobs...
Read more >
cli-improved.md - gists · GitHub
CLI Improved. This document lists improvements over the default Linux command line tools. The list was initially motivated by a blog post by...
Read more >
Big Improvements Coming to the Salesforce CLI
Today, when you install the Salesforce CLI, you get two interoperable CLIs: one is called sfdx (which is the current version of the...
Read more >
CLI: Improved - Hacker News
It leads to a lot of headache as the complexity of the task grows because of the in-band signaling and lack of universal...
Read more >
Upcoming Improvements to Salesforce CLI - ASAGARWAL.COM
Salesforce is planning to come up with big improvements in Salesforce CLI. Here is the one liner description of these upcoming improvements.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found