import { Knex } from 'knex'; export class UsersService { constructor(private knex: Knex) {} async getUser(username: string) { // Dangerous for not using ? in knex raw if the input is from users return (await this.knex.raw(`SELECT * FROM users WHERE username = '${username}';`)).rows; } }