Comments (3)
In #95 I'm adding an HTTP client, you could have multiple http clients with different credentials
from surrealdb.js.
Alright, short update.
I managed to fix this by opening a new connection to SurrealDB on every request and attaching the db object to ctx.state. Which isn't great of course (would be nicer to just use 1 with different auth states as proposed here: #61).
The reason why I mentioned that this would be slow is because... it was. I used const db = new Surreal("http://localhost:8000/rpc");
to create the connection. Turns out that this is several seconds slower than using const db = new Surreal("http://127.0.0.1:8000/rpc");
for some reason.
With the faster speed, invoking a new connection everytime is fine for my use case. I'll leave this open for now in case anyone has a better solution. But feel free to close this if you feel that this isn't relevant anymore :)
from surrealdb.js.
Closing this as a duplicate of #61
Anyways, to help you out: This is not possible over WebSockets as of now. The client drivers for each language are merely a representation of the APIs out there, and the WS API in SurrealDB currently does not support this :)
from surrealdb.js.
Related Issues (20)
- Feature: Safe way of using IDs in create/update statements HOT 2
- Bug: NoActiveSocket: No socket is currently connected to a SurrealDB instance. Please call the .connect() method first! HOT 8
- Bug: Not working on an IDE with Nix like Replit? HOT 2
- Bug: ErrorEvent is not defined
- Documentation: The documentation about live queries is wrong HOT 1
- Feature: Allow getting & validating signin token without authenticating token HOT 8
- Bug: type RawQueryResult doesn't allow boolean
- Bug: authenticate() can only be used with scopes. HOT 9
- Feature: Tagged Template Literals HOT 2
- Bug: Using 3rd party tokens results in "IAM error: Not enough permissions to perform this action" for create actions HOT 1
- Bug: need better error messaging HOT 2
- Feature: Temp solution for Bun websocket? HOT 7
- Feature: .open() HOT 2
- Bug: import_ws.WebSocket is not a constructor HOT 1
- Bug: HTTPStrategy doesnt seem to remain authed after 1 hour HOT 1
- Bug: Can't connect to surreal with deno HOT 7
- Bug: live query does not return a json patch
- Bug: db is not reconnecting HOT 2
- Bug: Error when serializing BigInt
- Bug: Problems with not flexible type Record<...>
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from surrealdb.js.