Files
Agent-n8n/n8n-n8n-1.109.2/packages/@n8n/db/src/repositories/settings.repository.ts
2025-09-08 04:48:28 +08:00

16 lines
391 B
TypeScript
Executable File

import { Service } from '@n8n/di';
import { DataSource, Repository } from '@n8n/typeorm';
import { Settings } from '../entities';
@Service()
export class SettingsRepository extends Repository<Settings> {
constructor(dataSource: DataSource) {
super(Settings, dataSource.manager);
}
async findByKey(key: string): Promise<Settings | null> {
return await this.findOneBy({ key });
}
}