We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug db.ready() throws the following error:
He { type: 'error', defaultPrevented: false, cancelable: false, timeStamp: 3265.9472999982536 }
Example
// src/lib/server/db.ts import { Cirql } from 'cirql'; import { SURREALDB_NS, SURREALDB_DB, SURREALDB_URL, SURREALDB_USER, SURREALDB_PASS, } from "$env/static/private"; import { dev } from '$app/environment'; import { log } from '$lib/logger'; //import { withTimeout } from '$lib/utils'; declare global { var surrealdb: Cirql } export let db = global.surrealdb; export async function conectDB() { if (db) return; log.warn('creating new connection to db!'); try { db = new Cirql({ connection: { endpoint: SURREALDB_URL, namespace: SURREALDB_NS, database: SURREALDB_DB, }, credentials: { user: SURREALDB_USER, pass: SURREALDB_PASS, } }); await db.ready(); // await withTimeout(db.ready(), 'db connection timed out', 5000); if (dev) global.surrealdb = db; log.info('db connected '); } catch (error) { log.error('connecting to db:', error); } }
Expected behavior for that to not err out ig hands 🤷♂️
Environment:
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
db.ready() throws the following error:
Example
Expected behavior
for that to not err out ig hands 🤷♂️
Environment:
The text was updated successfully, but these errors were encountered: