commit
This commit is contained in:
+28
@@ -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;
|
||||
Reference in New Issue
Block a user