142 lines
4.0 KiB
JavaScript
142 lines
4.0 KiB
JavaScript
// Metro module 1920 (f1921).
|
|
import { Table, TableTransaction } from "./TableTransaction";
|
|
import { ConflictOptions } from "./Module1914";
|
|
class GuildEntityDao {
|
|
constructor(a0, a1, a2, r8 = true) {
|
|
this.originalPrefix = a0;
|
|
this.table = new Table([a0], a1, a2, r8);
|
|
}
|
|
get prefix() {
|
|
return this.table.prefix;
|
|
}
|
|
withoutLogging() {
|
|
const originalPrefix = this.originalPrefix;
|
|
const tableId = this.table.tableId;
|
|
const database = this.table.database;
|
|
const r17 = {
|
|
__proto__: GuildEntityDao.prototype
|
|
};
|
|
r17.originalPrefix = originalPrefix;
|
|
r17.table = new Table([originalPrefix], tableId, database, false);
|
|
return r17;
|
|
}
|
|
get(a0, a1) {
|
|
return this.table.get([a0, a1]);
|
|
}
|
|
getMany(a0, a1) {
|
|
return this.table.getMany([a0], a1);
|
|
}
|
|
getRange(a0, a1, a2, a3) {
|
|
return this.table.getRange([a0, a1], [a0, a2], a3);
|
|
}
|
|
getKvEntries() {
|
|
return this.table.getKvEntries();
|
|
}
|
|
getMapEntries() {
|
|
return this.table.getMapEntries();
|
|
}
|
|
getIds(a0) {
|
|
return this.table.getChildIds([a0]);
|
|
}
|
|
getGuildIds() {
|
|
return this.table.getChildIds([]);
|
|
}
|
|
getGuildId(a0) {
|
|
return this.table.getParentId([null, a0]);
|
|
}
|
|
put(c13333_0, c13333_1, r9 = ConflictOptions.Replace) {
|
|
const Replace = r9;
|
|
return this.transaction((a0) => a0.put(c13333_0, c13333_1, Replace), `${this.prefix} put`);
|
|
}
|
|
putAll(c13334_0, c13334_1, r9 = ConflictOptions.Replace) {
|
|
const Replace2 = r9;
|
|
return this.transaction((a0) => a0.putAll(c13334_0, c13334_1, Replace2), `${this.prefix} putAll`);
|
|
}
|
|
replaceAll(c13335_0, c13335_1) {
|
|
return this.transaction((a0) => a0.replaceAll(c13335_0, c13335_1), `${this.prefix} replaceAll`);
|
|
}
|
|
delete(c13336_0, c13336_1) {
|
|
return this.transaction((a0) => a0.delete(c13336_0, c13336_1), `${this.prefix} delete`);
|
|
}
|
|
deleteGeneration(c13337_0, c13337_1) {
|
|
return this.transaction((a0) => a0.deleteGeneration(c13337_0, c13337_1), `${this.prefix} deleteGeneration`);
|
|
}
|
|
transaction(c13338_0, a1) {
|
|
return this.table.transaction((a0) => {
|
|
const r10 = {
|
|
__proto__: GuildEntityDaoTransaction.prototype
|
|
};
|
|
r10.transaction = a0;
|
|
return c13338_0(r10);
|
|
}, a1);
|
|
}
|
|
upgradeTransaction(a0) {
|
|
const transaction2 = this.table.upgradeTransaction(a0);
|
|
const r11 = {
|
|
__proto__: GuildEntityDaoTransaction.prototype
|
|
};
|
|
r11.transaction = transaction2;
|
|
return r11;
|
|
}
|
|
getManySyncUnsafe(a0, a1) {
|
|
return this.table.getManySyncUnsafe([a0], a1);
|
|
}
|
|
getMapEntriesSyncUnsafe() {
|
|
return this.table.getMapEntriesSyncUnsafe();
|
|
}
|
|
deleteSyncUnsafe(a0) {
|
|
return this.table.deleteSyncUnsafe([a0]);
|
|
}
|
|
static cell(a0, a1, a2) {
|
|
return {
|
|
key: [a0, a1.id],
|
|
data: a1,
|
|
generation: a2
|
|
};
|
|
}
|
|
}
|
|
class GuildEntityDaoTransaction {
|
|
constructor(a0) {
|
|
this.transaction = a0;
|
|
}
|
|
static fromDatabaseTransaction(a0, a1, a2) {
|
|
const tableTransaction = new TableTransaction(a0, a1, a2);
|
|
const r20 = {
|
|
__proto__: GuildEntityDaoTransaction.prototype
|
|
};
|
|
r20.transaction = tableTransaction;
|
|
return r20;
|
|
}
|
|
put(a0, a1, r5 = ConflictOptions.Replace) {
|
|
return this.putWithGeneration(a0, a1, null, r5);
|
|
}
|
|
putWithGeneration(a0, a1, a2, r4 = ConflictOptions.Replace) {
|
|
return this.transaction.put(GuildEntityDao.cell(a0, a1, a2), r4);
|
|
}
|
|
putAll(c13339_0, a1, r4 = ConflictOptions.Replace) {
|
|
return this.transaction.putAll(a1.map((item) => GuildEntityDao.cell(c13339_0, item, null)), r4);
|
|
}
|
|
replaceAll(a0, a1) {
|
|
this.delete(a0);
|
|
this.putAll(a0, a1);
|
|
}
|
|
delete(a0, a1) {
|
|
const length = arguments.length;
|
|
if (length === 0) {
|
|
return this.transaction.delete([]);
|
|
}
|
|
if (length === 1) {
|
|
return this.transaction.delete([a0]);
|
|
}
|
|
return this.transaction.delete([a0, a1]);
|
|
}
|
|
deleteAllExcept(a0) {
|
|
this.transaction.deleteAllExcept([], a0);
|
|
}
|
|
deleteGeneration(a0, a1) {
|
|
return this.transaction.deleteGeneration([], a0, a1);
|
|
}
|
|
}
|
|
export { GuildEntityDao };
|
|
export { GuildEntityDaoTransaction };
|