CONCORD — The state Supreme Court ruled on Thursday that the secretary of state does not have to provide a detailed voter database to the N.H. Democratic Party, the League of Women Voters and other plaintiffs in a lawsuit challenging Senate Bill 3, the new law on voter verification.

A lower court had ordered release of the database to the plaintiffs, who claimed they needed certain information from it to make their case.

“We conclude that the database is exempt from disclosure by statute, and we therefore vacate the trial court’s order,” the unanimous order of the five justices said.

The case challenging SB 3 has been working its way through the courts for the past two years. The law, enacted in 2017, changed the procedures for proof of domicile when registering to vote.

The plaintiffs have argued in several preliminary hearings that the law violates the state Constitution because it unduly burdens the right to vote and denies would-be voters trying to register within 30 days of an election equal protection under the law.

A trial in the case is expected to get under way later this year.

In preparing for the trial, the plaintiffs sought certain information from the voter database. The trial judge presiding at Hillsborough Superior Court in Manchester ordered it released. The state appealed the judge’s ruling on disclosure to the state Supreme Court, which agreed to hear the case last year.

The plaintiffs claim that SB3 makes same-day voter registration more difficult and that same-day registrants are more likely to support Democratic candidates. The database, they said, would contain information as to the identities and voting patterns of same-day registrants that would support that contention.

To further protect the database from disclosure, while the SB 3 case was proceeding, the Republican-controlled legislature last spring passed an amendment stating that the information on the database should never be disclosed “in response to a subpoena or civil discovery request.”

The plaintiffs argued that amendment was passed after they made their discovery request, was designed to thwart that request, and should not be applied retroactively.

The Supreme Court disagreed, writing in its order, “Even if we assume that the trial court did correctly construe the statute as it was in effect, the 2018 amendment conclusively demonstrates that the legislature disagreed with the trial court’s construction and effectively overruled that decision.

“When the legislature disagrees with a judicial decision, it is at liberty to change the law through statutory enactment.”

Unlike the voter checklist, which contains only full name, domicile, address, mailing address, party affiliation and voting history (did or did not vote), the database contains more personal information.

Information on the database includes birthday, gender, drivers’ license number, last four digits of social security number, place of birth or naturalization history, military service, form of identification used to prove identity and information concerning the use of absentee ballots.

The Democratic Party and League of Women Voters had agreed to a protective order under which they would seek only certain data related to their case.

The state objected on the grounds that the information is irrelevant to the case and not subject to disclosure under state law.