-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support enableWal for the better-sqlite3 driver (#9619)
- Loading branch information
1 parent
c418aae
commit 8731858
Showing
3 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import "reflect-metadata" | ||
import { expect } from "chai" | ||
import { DataSource } from "../../../src/data-source/DataSource" | ||
import { | ||
closeTestingConnections, | ||
createTestingConnections, | ||
reloadTestingDatabases, | ||
} from "../../utils/test-utils" | ||
|
||
describe("better-sqlite3 driver > enable wal", () => { | ||
let connections: DataSource[] | ||
before( | ||
async () => | ||
(connections = await createTestingConnections({ | ||
entities: [], | ||
enabledDrivers: ["better-sqlite3"], | ||
driverSpecific: { | ||
enableWAL: true, | ||
}, | ||
})), | ||
) | ||
beforeEach(() => reloadTestingDatabases(connections)) | ||
after(() => closeTestingConnections(connections)) | ||
|
||
it("github issues > #9410 The better-sqlite3 driver should support the enableWal flag", () => | ||
Promise.all( | ||
connections.map(async (connection) => { | ||
const result = await connection.query("PRAGMA journal_mode") | ||
|
||
expect(result).to.eql([{ journal_mode: "wal" }]) | ||
}), | ||
)) | ||
}) |