UNPKG

@getsolara/solara.db

Version:

Optional database functionality for @getsolara/solara.js using quick.db

20 lines 868 B
module.exports = { name: "$dbPush", description: "Pushes a value onto an array in the database. Args: key;value", takesBrackets: true, execute: async (context, args) => { if (!context.client.db) { return "[Error: $dbPush requires database features to be enabled. Ensure @getsolara/solara.db is installed and configured correctly.]"; } if (args.length < 2) return "[Error: $dbPush requires a key and a value]"; const key = args[0]; const value = args.slice(1).join(';'); try { await context.client.db.push(key, value); return ""; } catch (e) { console.error(`Solara.db Error ($dbPush): Failed to push to key '${key}'. Error: ${e.message}`); return `[DB Error pushing to key '${key}': ${e.message}]`; } } };