Skip to content

Instantly share code, notes, and snippets.

@uno-de-piera
Created June 12, 2020 04:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uno-de-piera/7c1231446578ba722a1185ffc9c07828 to your computer and use it in GitHub Desktop.
Save uno-de-piera/7c1231446578ba722a1185ffc9c07828 to your computer and use it in GitHub Desktop.
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