In the battle unfolding in Congress between the Democrats and Attorney General William Barr, I’m on the side of the US Constitution. That means defending not only Barr but also President Trump. The two men stand on America’s legal bedrock.

Which is why Barr was able to make short work of his Democratic questioners at Wednesday’s hearing in the Senate. His calm, straightforward testimony made it clear that he isn’t the caricature the Democrats have been drawing of him.

And events aren’t the conspiracy they are still trying to validate, even after special counsel Robert Mueller’s finding that there was no collusion, actual or attempted, ­between Trump’s camarilla and the Kremlin. Nor any prosecutable obstruction case.

Yet no sooner did Barr, under pressure for an early summary, send a sketch of Mueller’s report to Congress than the Democrats started suggesting he had spun the story in favor of the president. That was the guts of the hearing in the Senate.

The nastiest of the Democrats — Sen. Pat Leahy of Vermont — went so far as to suggest that Barr had misled Congress in his reporting of the investigation. He tweeted that Barr “knew that Mueller had serious concerns” about Barr’s summary report.

So what? Mueller didn’t accuse Barr of misrepresenting him. He complained that Barr’s letter sketching the key elements of Mueller’s report didn’t “fully capture” the report’s “context, nature and substance.” What four-page sketch can fully capture a 448-page report?

It turns out that Mueller wanted the report released piecemeal. Barr overruled him. It looks similar to, say, a hapless middle-ranking editor (Mueller) caught between an activist staff (Mueller’s Clintonite investigators) and a hard-headed boss (Barr).

Happens all the time, even in the Justice Department. Prosecutors ­often disagree with investigators. Big whoop. Top brass frequently overrule them, too. That’s one of the things they are there for. It’s why they get paid the big bucks.

Which brings it back to Trump. He’s the constitutional adult in this drama. Of all the people in this country — including our judges and members of Congress — Trump is the only one empowered and commanded to take care that the laws be faithfully executed.

Immediately after issuing that command, the Constitution ­ordains that the president shall commission “all” the officers of the United States. In other words, it is the president who must enforce the law, and only he gets to pick the staff to do so. While he’s president, executive power flows from his very person.

No wonder Trump went into such rages at the suggestion that he can’t — or shouldn’t — fire the special counsel. For Democrats to suggest, as they continued to do in the Senate Wednesday, that it would be obstruction for Trump to fire Mueller is itself an obstruction.

It’s just weird for Sen. Kamala Harris to open the line of questioning she pursued Wednesday. She asked Barr whether Trump had suggested Barr prosecute anyone. Presidents don’t usually do that, and Barr stumbled a bit on the question.

At the end of the day, though, what would be wrong had Trump made such a suggestion? Since the president alone is commanded to faithfully execute the laws, it isn’t constitutionally kosher for Congress or a special counsel to try to restrict his freedom of action.

At one point Wednesday, Barr ­referred to Mueller’s letter to him as “snitty.” Sen. Richard Blumenthal of Connecticut then asked Barr whether he’d make available notes of one of his conversations with Mueller. Barr said he wouldn’t.

So far, so good. Things would no doubt get nastier in the House, which was due to grill Barr Thursday, though he has reportedly declined the invite. The House has one enormous club that the Senate lacks, the power to initiate impeachment. Then, the power of the president to resist starts to fall away.

That was marked long ago by President James Polk. He once said that when it comes to impeachment, “the power of the House” would “penetrate into the most ­secret recesses” of the executive branch.

“It could,” Polk added, “command the attendance of any and every agent of the government, and compel them to produce all papers, public or private, official or unofficial, and to testify on oath to all facts within their knowledge.” That’s the line Barr and Trump are walking.

Lipsky@nysun.com