This commit is contained in:
kajvans
2024-01-19 17:57:09 +01:00
parent df4c9e6657
commit b728e1508a
5 changed files with 1984 additions and 1 deletions
+28
View File
@@ -0,0 +1,28 @@
const { Surreal } = require('surrealdb.node');
const db = new Surreal();
async function main() {
try {
// Connect to the database
await db.connect('wss://db.services.quiztimes.nl/rpc');
// Signin as a namespace, database, or root user
await db.signin({
username: 'root',
password: 'root',
});
// Select a specific namespace / database
await db.use({ ns: 'forum', db: 'forum' });
} catch (e) {
console.error('ERROR', e);
}
}
main();
module.exports = db;