UNPKG

@uisap/core

Version:

A modular Fastify-based framework inspired by Laravel

20 lines (16 loc) 477 B
import { DbHelper } from './utils/dbHelper.js'; export class Model { constructor(fastify, container) { this.fastify = fastify; this.container = container; this.logger = fastify.logger; this.db = fastify.container.make('sequelize'); this.dbHelper = new DbHelper(this.db, this.logger); } async rawSql(sql, replacements = []) { return await this.dbHelper.rawSql(sql, replacements); } resolve(key) { return this.container.make(key); } }