Adds some more polish
This commit is contained in:
parent
b3d0b3a90c
commit
11bd836ec3
18 changed files with 272 additions and 29 deletions
|
|
@ -2,7 +2,7 @@ import {Repository} from "./Repository";
|
|||
import {GroupModel} from "../Models/GroupModel";
|
||||
import Groups, {DBGroup} from "../tables/Groups";
|
||||
import {DatabaseConnection} from "../DatabaseConnection";
|
||||
import {GuildMember, UserFlagsBitField} from "discord.js";
|
||||
import {GuildMember} from "discord.js";
|
||||
import {Nullable} from "../../types/Nullable";
|
||||
import {PlaydateRepository} from "./PlaydateRepository";
|
||||
import {Container} from "../../Container/Container";
|
||||
|
|
|
|||
|
|
@ -65,12 +65,12 @@ export class Repository<ModelType extends Model, IntermediateModelType = unknown
|
|||
return result.changes > 0;
|
||||
}
|
||||
|
||||
public getById(id: number): Nullable<ModelType> {
|
||||
public getById(id: number|bigint): Nullable<ModelType> {
|
||||
const sql = `SELECT * FROM ${this.schema.name} WHERE id = ? LIMIT 1`;
|
||||
return this.convertToModelType(this.database.fetch<number, IntermediateModelType>(sql, id));
|
||||
}
|
||||
|
||||
public delete(id: number) {
|
||||
public delete(id: number|bigint) {
|
||||
const sql = `DELETE FROM ${this.schema.name} WHERE id = ?`;
|
||||
return this.database.execute(sql, id);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue