Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to lupdo 3.3.0 #22

Merged
merged 1 commit into from
Mar 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project from 1.0.0 forward will be documented in thi
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.5.0] - 2023-03-22

### Changed

- Update to Lupdo ^3.3.0

## [1.4.0] - 2023-03-13

### Added
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lupdo-sqlite",
"version": "1.4.0",
"version": "1.5.0",
"description": "Sqlite Driver For Lupdo",
"author": "Claudio Pennati <claudio.pennati@gmail.com>",
"license": "MIT",
Expand Down Expand Up @@ -71,7 +71,7 @@
"dependencies": {
"@types/better-sqlite3": "^7.6.2",
"better-sqlite3": "^7.6.2",
"lupdo": "^3.1.6",
"lupdo": "^3.3.0",
"tslib": "^2.4.1"
}
}
16 changes: 16 additions & 0 deletions src/__tests__/sqlite-driver.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,22 @@ describe('Sqlite Driver', () => {
await pdo.disconnect();
});

it('Work Get Version', async () => {
const pdo = createSqlitePdo(pdoData.config);
expect((await pdo.getVersion()).startsWith('3')).toBeTruthy();
});

it('Works Pdo Connection Version', async () => {
const pdo = createSqlitePdo(pdoData.config, {
created: (uuid, connection) => {
expect(connection.version.startsWith('3')).toBeTruthy();
}
});
expect((await pdo.getVersion()).startsWith('3')).toBeTruthy();
await pdo.query('SELECT 1');
await pdo.disconnect();
});

it('Works Destroy Connection Does not kill connection', async () => {
console.log = jest.fn();
console.trace = jest.fn();
Expand Down
6 changes: 6 additions & 0 deletions src/sqlite-driver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@ class SqliteDriver extends PdoDriver {
return true;
}

protected async getVersionFromConnection(connection: SqlitePoolConnection): Promise<string> {
const stmt = connection.prepare('SELECT sqlite_version() as version');
const res = await stmt.get();
return res.version as string;
}

public getRawConnection(): PdoRawConnectionI {
return new SqliteRawConnection(this.pool);
}
Expand Down