surrealdb-rest-ts
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

SurrealDB REST client

Stateless SurrealDB client built for serverless architectures

Motivation

I built a Next.js app with next-auth and a custom adapter for SurrealDB. I deployed it on Vercel, and realized that I needed a stateless SureralDB client because the serverless nature of Vercel functions where losing my DB connection.

To keep the custom adapter compatible with statefull backends, and benefit from a RPC connection, I built this library following the same function signatures as the official Node.js driver for SurrealDB.

To-do:

  • implement all methods:
    • [ ] Sureral.Instance
    • [ ] db.connect(url)
    • [ ] db.wait()
    • [ ] db.close()
    • [ ] db.use(ns, db)
    • [ ] db.signup(vars)
    • [ ] db.signin(vars)
    • [ ] db.invalidate()
    • [ ] db.authenticate(token)
    • [ ] db.let(key, val)
    • [x] db.query(sql, vars)
    • [x] db.select(thing)
    • [x] db.create(thing, data)
    • [ ] db.update(thing, data
    • [x] db.change(thing, data)
    • [ ] db.modify(thing, data)
    • [x] db.delete(thing)
  • consider fetch-h2 instead of node-fetch
  • unit test with DB docker image

Similar projects:

Readme

Keywords

Package Sidebar

Install

npm i surrealdb-rest-ts

Weekly Downloads

2

Version

1.0.3

License

MIT

Unpacked Size

7.51 kB

Total Files

5

Last publish

Collaborators

  • martinschaer