fix db
This commit is contained in:
@@ -8,7 +8,7 @@ export default {
|
|||||||
handle: async (interaction, database) => {
|
handle: async (interaction, database) => {
|
||||||
await interaction.defer(MessageFlags.EPHEMERAL)
|
await interaction.defer(MessageFlags.EPHEMERAL)
|
||||||
|
|
||||||
const db = database.table(`rr`)
|
const db = await database.table(`rr`)
|
||||||
|
|
||||||
const splitID = interaction.data.customID.split('.')
|
const splitID = interaction.data.customID.split('.')
|
||||||
|
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
handle: async (interaction, database) => {
|
handle: async (interaction, database) => {
|
||||||
const db = database.table(`rr`)
|
const db = await database.table(`rr`)
|
||||||
|
|
||||||
const action = interaction.data.options.getSubCommand()[0]
|
const action = interaction.data.options.getSubCommand()[0]
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ export default {
|
|||||||
handle: async (interaction, database) => {
|
handle: async (interaction, database) => {
|
||||||
await interaction.defer(MessageFlags.EPHEMERAL)
|
await interaction.defer(MessageFlags.EPHEMERAL)
|
||||||
|
|
||||||
const db = database.table(`rr`)
|
const db = await database.table(`rr`)
|
||||||
|
|
||||||
const splitID = interaction.data.customID.split('.')
|
const splitID = interaction.data.customID.split('.')
|
||||||
|
|
||||||
|
|||||||
@@ -32,10 +32,12 @@ export class KVDB {
|
|||||||
/**
|
/**
|
||||||
* Switch database table/context sharing the same connection pool
|
* Switch database table/context sharing the same connection pool
|
||||||
* @param {string} newTableName
|
* @param {string} newTableName
|
||||||
* @returns {KVDB}
|
* @returns {Promise<KVDB>}
|
||||||
*/
|
*/
|
||||||
table(newTableName) {
|
async table(newTableName) {
|
||||||
return new KVDB(this.pool, newTableName);
|
const newDb = new KVDB(this.pool, newTableName);
|
||||||
|
await newDb.init();
|
||||||
|
return newDb;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user