Skip to content

Commit 8a7e4de

Browse files
committed
chore: bump version to 1.0.17 and refocus testing on PostgreSQL
- Disable MySQL and SQLite dialect tests by renaming to .txt - Simplify test scripts to focus on PostgreSQL repository tests - Add column selection support to Repository.find() method - Update test to demonstrate new column selection feature
1 parent f61c125 commit 8a7e4de

File tree

8 files changed

+12
-9
lines changed

8 files changed

+12
-9
lines changed

__tests__/dialects/mysql-repository.test.ts renamed to __tests__/dialects/mysql-repository.test.ts.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
mysqlExecutor,
77
seedMySQLTestData,
88
setupMySQLTestTables
9-
} from "../test-setups/mysql-test-setup";
9+
} from "../test-setups/mysql-test-setup.ts.txt";
1010

1111
describe("MySQL Repository", () => {
1212
let repository: Repository<DomainUser>;

__tests__/dialects/sqlite-repository.test.ts renamed to __tests__/dialects/sqlite-repository.test.ts.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
seedSQLiteTestData,
66
setupSQLiteTestTables,
77
sqliteExecutor
8-
} from "../test-setups/sqlite-test-setup";
8+
} from "../test-setups/sqlite-test-setup.ts.txt";
99

1010
describe("SQLite Repository", () => {
1111
let repository: Repository<DomainUser>;

__tests__/repository/find.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ describe("Repository findRows", () => {
3737
describe("Comparison Operators", () => {
3838
it("should find rows with neq operator", async () => {
3939
const result = await repository.find({
40-
where: neq("email", "[email protected]")
40+
operationName: "Comparison Operators",
41+
where: neq("email", "[email protected]"),
42+
columns: ["id", "name", "email"]
4143
});
4244

4345
expect(result.every((user) => user.email !== "[email protected]")).toBe(

package.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sqlkit",
3-
"version": "1.0.16",
3+
"version": "1.0.17",
44
"description": "A lightweight SQL builder for TypeScript",
55
"license": "MIT",
66
"author": {
@@ -21,11 +21,7 @@
2121
"scripts": {
2222
"build": "pkgroll --sourcemap --clean-dist --minify",
2323
"tinker": "npx tsx watch src/tinker.ts",
24-
"test": "jest --runInBand",
25-
"test:postgres": "jest --testPathPattern=repository --runInBand",
26-
"test:sqlite": "jest --testPathPattern=sqlite-repository --runInBand",
27-
"test:mysql": "jest --testPathPattern=mysql-repository --runInBand",
28-
"test:dialects": "jest --testPathPattern=dialects --runInBand",
24+
"test": "jest --testPathPattern=repository --runInBand",
2925
"format": "prettier --write \"src/**/*.ts\"",
3026
"docs": "npx typedoc src/index.ts"
3127
},

script.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
"test:postgres": "jest --testPathPattern=repository --runInBand",
2+
"test:sqlite": "jest --testPathPattern=sqlite-repository --runInBand",
3+
"test:mysql": "jest --testPathPattern=mysql-repository --runInBand",
4+
"test:dialects": "jest --testPathPattern=dialects --runInBand",

src/repository/repository.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export class Repository<T> {
3434
if (payload?.orderBy) builder.orderBy(payload.orderBy);
3535
if (payload?.limit) builder.limit(payload.limit);
3636
if (payload?.offset) builder.offset(payload.offset);
37+
if (payload?.columns) builder.select(payload.columns);
3738

3839
const result = await builder.commit();
3940

0 commit comments

Comments
 (0)