tony133 / nestjs-knexjs Goto Github PK
View Code? Open in Web Editor NEWKnexjs module for Nest framework (node.js) ๐ป
License: MIT License
Knexjs module for Nest framework (node.js) ๐ป
License: MIT License
@Tony133 There is no dist
directory in npm package v0.0.7, version 0.0.6 has it
see https://registry.npmjs.org/nest-knexjs/-/nest-knexjs-0.0.7.tgz
When an application loses its connection to the database, the application crashes with the error
TypeError: Cannot read properties of undefined (reading '__knexUid')
Fix \knex\lib\client.js:344:58 connection.__knexUid to connection?.__knexUid
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
.github/workflows/codeql-analysis.yml
actions/checkout v4
github/codeql-action v3
github/codeql-action v3
github/codeql-action v3
.github/workflows/nodejs-environment.yml
actions/checkout v4
actions/setup-node v4
actions/checkout v4
actions/setup-node v4
actions/setup-node v4
package.json
@commitlint/cli 19.2.2
@commitlint/config-angular 19.2.2
@nestjs/common 10.3.8
@nestjs/core 10.3.8
@nestjs/platform-fastify ^10.3.7
@nestjs/testing 10.3.8
@types/jest 29.5.12
@types/node 20.12.7
@types/supertest 6.0.2
@typescript-eslint/eslint-plugin 7.7.0
@typescript-eslint/parser 7.7.0
eslint 8.57.0
eslint-config-prettier 9.1.0
eslint-plugin-import 2.29.1
husky 9.0.11
jest 29.7.0
knex 3.1.0
mysql 2.18.1
prettier 3.2.5
reflect-metadata 0.2.2
release-it 17.2.0
rxjs 7.8.1
supertest 6.3.4
ts-jest 29.1.2
ts-node 10.9.2
tsconfig-paths 4.2.0
typescript 5.4.5
@nestjs/common ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0
@nestjs/core ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0
knex ^0.21.17 || ^0.95.0 || ^1.0.0 || ^2.0.0 || ^3.0.0
reflect-metadata ^0.1.13 || ^0.2.0
rxjs ^6.6.3 || ^7.2.0
Is it possible to avoid the declaration of a knexfile.js
and make the migrations and seeds work?
I would like to keep the Knex configuration in the AppModule's imports only.
I need to use multiple databases for Knexjs......
any suggestions on how to do this??
I will use this package in a commercial application, but I don't know if this package is updated in the NPM registry, because the last commit was in a few days, but NPM was updated 2 years old. I'm installing directly from GitHub and not from NPM because of this.
Hello, I have users.service.ts
import { Injectable } from '@nestjs/common';
import { Knex } from 'knex';
import { InjectConnection } from 'nest-knexjs';
import type { UserEntity } from './entities/user.entity';
@Injectable()
export class UsersService {
constructor(@InjectConnection() private readonly knex: Knex) {}
async findOne(email: UserEntity['email']): Promise<UserEntity | undefined> {
return await this.knex
.select()
.from('users')
.where({ email: email })
.first();
}
}
and test like
import { Test, TestingModule } from '@nestjs/testing';
import { UsersService } from './users.service';
describe('UsersService', () => {
let service: UsersService;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
providers: [UsersService],
}).compile();
service = module.get<UsersService>(UsersService);
});
it('should be defined', () => {
expect(service).toBeDefined();
});
});
I'm getting error
UsersService โบ should be defined
Nest can't resolve dependencies of the UsersService (?). Please make sure that the argument default at index [0] is available in the RootTestModule context.
Potential solutions:
- Is RootTestModule a valid NestJS module?
- If default is a provider, is it part of the current RootTestModule?
- If default is exported from a separate @Module, is that module imported within RootTestModule?
@Module({
imports: [ /* the Module containing default */ ]
})
```
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.