Models unit; session model; generalize session classes/interfaces

This commit is contained in:
garrettmills
2020-07-27 09:41:04 -05:00
parent 878de025d8
commit 25a37cf1a2
27 changed files with 331 additions and 37 deletions

View File

@@ -82,6 +82,10 @@ export default abstract class ConnectionExecutable<T> {
return 0
}
async exists(): Promise<boolean> {
return (await this.count()) > 0
}
async execute_in_connection(connection: string | Connection): Promise<QueryResult> {
const conn = typeof connection === 'string' ? make(Database).connection(connection) : connection