By Charles Lane

The destructive strike on Saudi Arabian oil production facilities on Saturday, almost certainly carried out by or on behalf of Iran, brings the Middle East a step closer to general war. The long-anticipated test of President Donald Trump’s crisis-management skills might be at hand.

It's a scary thought. Here's an even scarier one: Suppose the United States reached this moment without ever having taken advantage of the innovative oil and gas production technique known as hydraulic fracturing, or "fracking," which enabled drillers to free up previously inaccessible hydrocarbons from shale formations in North Dakota and Texas, among other places.

In December 2007, President George W. Bush declared "dependence on oil - especially oil from foreign lands" one of the most serious challenges facing the nation. Now, the United States has essentially no trade deficit in energy, according to J.P. Morgan Asset Management; it exports growing quantities of oil and gas. This country, not Saudi Arabia, is the world's largest producer of crude - daily production is now 12.1 million barrels a day, up from about half that much in 2012 - and the one best positioned to ramp up supply in response to sudden market swings.

Oil prices are likely to spike in the short-term aftermath of the attack on Saudi Arabia, but, as Clifford Krauss and Stanley Reed of The New York Times report, the availability of a secure U.S. oil supply is one of several factors - including large stockpiles around the world - that should help cushion the blow to the global economy.

In other words, fracking is a strategic U.S. asset that tips the balance against a wider Middle East war, though obviously such a catastrophe might come anyway.

Which brings us to the Democratic candidates who have been calling for a ban on fracking, due to environmental concerns. The field includes several fracking-banners, the most prominent of whom are the progressive darlings, Sens. Elizabeth Warren, D-Mass., and Bernie Sanders, I-Vt.

A fracking ban surely ranks as one of the most irresponsible promises of the campaign so far, and it would be a terrible idea even if the situation in the Middle East had not just reminded us of fracking's strategic benefits.

Shutting down all existing fracked wells would mean eliminating the source of 40 percent of all U.S. primary energy, according to J.P. Morgan Asset Management. This is probably why even Sanders has acknowledged that his ban wouldn't take effect "overnight."

A phaseout, or a ban only on new fracking, might wreak less economic havoc, but it would still set back efforts to reduce greenhouse gases.

That's because fracking has enabled the United States to substitute cleaner-burning natural gas for coal, contributing to a 14 percent reduction in energy-related carbon-dioxide emissions between 2005, when the fracking boom began, and 2016. The more cheap gas we produce, the more coal we can displace.

Oil and natural gas are still fossil fuels; burning them is still a far greater source of carbon than, say, solar, nuclear or wind power. Fracking uses tremendous amounts of water, which creates a risk of contamination and other environmental problems. Hence the candidates' objections.

The right responses are: First, natural gas remains necessary as an alternative to coal as a source of on-demand ("baseload") electric power, and it probably will be necessary until technology enables sufficient storage of intermittent wind- or solar-generated electricity. Second, smart regulation can limit fracking's negative environmental effects.

President Barack Obama's Environmental Protection Agency produced a detailed report in 2016 that described what can go wrong with fracking and what measures (spill prevention, wastewater treatment) can control the risks, contrary to Sanders's sweeping claim that "no amount of regulation can make it safe."

"Continue, but regulate" is basically the fracking position that former vice president Joe Biden has staked out, along with other more moderate Democratic candidates such as Sens. Michael Bennet of Colorado and Amy Klobuchar of Minnesota.

Not that it's the main consideration, but politically the fracking ban is also a dicey proposition for Democrats.

Their prime directive in 2020 is to beat Trump. Accomplishing that probably will require carrying Pennsylvania, with its 20 electoral votes, which in turn means bringing working-class voters in Western Pennsylvania back to the Democratic column. Yet thousands of them depend, directly or indirectly, on natural-gas fracking for their livelihoods.

Do Democrats want to turn Texas blue? The party can pretty much forget about that, too, if it embraces a fracking ban. The oil and gas industry supports hundreds of thousands of good-paying jobs in that state.

The looming crisis in the Middle East reminds us of the risks we - and the whole world - face because the White House is occupied by someone who might not really know what he's doing.

It also shows how much it really does matter whether the Democrats put forward a realistic and pragmatic alternative in 2020.

Charles Lane is a Post editorial writer specializing in economic and fiscal policy, and a weekly columnist.

The Star-Ledger/NJ.com encourages submissions of opinion. Bookmark NJ.com/Opinion. Follow us on Twitter @NJ_Opinion and on Facebook at NJ.com Opinion. Get the latest news updates right in your inbox. Subscribe to NJ.com’s newsletters.