-
-
Save uno-de-piera/7c1231446578ba722a1185ffc9c07828 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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