1.0.3 • Published 1 year ago

surrealdb-rest-ts v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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)
    • db.query(sql, vars)
    • db.select(thing)
    • db.create(thing, data)
    • db.update(thing, data
    • db.change(thing, data)
    • db.modify(thing, data)
    • db.delete(thing)
  • consider fetch-h2 instead of node-fetch
  • unit test with DB docker image

Similar projects: