Skip to content

Instantly share code, notes, and snippets.

@uno-de-piera
Created Jun 12, 2020
Embed
What would you like to do?
import { Database } from '../database.ts';
import { Injectable } from 'https://deno.land/x/alosaur/mod.ts';
export interface User {
id: number;
name: string;
}
@Injectable()
export class UserService {
constructor(private db: Database){}
async getUsers(): Promise<User[]> {
return (await this.db.query("SELECT * FROM users"));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment