πŸš€ A really straight-forward SurrealDB Rest API wrapper.

Overview

SurrealDB Node.js

npm i surrealdb

Quick Start

surreal start --root user --pass user
import SurrealDB from 'surrealdb'

const Surreal = new SurrealDB('http://127.0.0.1:8000', {
  user: 'root',
  pass: 'root',
  database: 'test',
  namespace: 'test',
})

Guide

// Async
const Async = await Surreal.Query(`CREATE company:surrealdb SET name = 'SurrealDB', cofounders = [person:tobie, person:jaime];`)

// Promise
Surreal.Query(
  `CREATE company:surrealdb SET name = 'SurrealDB', cofounders = [person:tobie, person:jaime];`,
)
  .then((data) => {
    console.log(data)
  })
  .catch((err) => {
    console.log(err)
  })

Surreal Query Builder

import { SurrealQueryBuilder } from 'surrealdb'

const SQB = new SurrealQueryBuilder()
    .DefineParam('username', 'John Doe')
    .AppendCreate('user', [
      {
        key: 'name',
        type: 'default',
        value: '$username',
      },
      {
        key: 'age',
        type: 'int',
        value: 18,
      },
      {
        key: 'friends',
        type: 'array',
        value: [
          {
            name: 'James',
            age: 17,
          },
          {
            name: 'Bob',
            age: 18,
          },
        ],
      },
    ])
    .WrapTransaction('COMMIT')

console.log(SQB.query) // OR SQB.Finalize()
BEGIN TRANSACTION;
LET $username = 'John Doe';
CREATE user SET name = $username, age = <int> 18, friends = [
  {
    name: 'James',
    age: 17
  },
  {
    name: 'Bob',
    age: 18
  }
];
COMMIT TRANSACTION;
You might also like...

A guide for your daily "professional" interactions (not really)

A guide for your daily

How to professionally say A guide for your daily professional interactions. A simple static website for common phrases we might want to say to your co

Dec 14, 2022

Million is a lightweight (1kb) Virtual DOM. It's really fast and makes it easy to create user interfaces.

🎦 Watch Video πŸ“š Read the docs πŸ’¬ Join our Discord What is Million? Million is a lightweight (1kb) Virtual DOM. It's really fast and makes it easy t

Aug 24, 2022

πŸͺ’ A really tiny library that generates classname strings.

cnz (β€œclassnamez”) The smallest classnames-compatible package yet (I think). This is an extremely simple javascript utility for conditionally joining

Dec 15, 2022

Webb-tracker-api - James Webb Space Telescope (JWST) tracking REST API

Webb-tracker-api - James Webb Space Telescope (JWST) tracking REST API

James Webb Telescope tracking REST API Public REST API to track JWST's current status API data source: https://www.jwst.nasa.gov/content/webbLaunch/wh

Nov 22, 2022

Lolis-rest - RESTful API for lolis-api

Lolis REST RESTful + Website for Lolis API. Introduction This is a RESTful API which will be used on Lolis API Website and Wrapper. This API uses Imgu

Aug 11, 2022

A base API template for a REST API using express.

A base API template for a REST API using express.

express-api-template A base API template for a REST API using express. Philosophy Setting up a new project can be a long and tedious process, especial

May 29, 2022

An Amazon Kendra REST API CDK example with an API Gateway, including authentication with AWS Cognito and AWS X-Ray Tracing

An Amazon Kendra REST API CDK example with an API Gateway, including authentication with AWS Cognito and AWS X-Ray Tracing

Amazon Kendra Web Service CDK Sample Amazon Kendra has a robust JSON API for use with the AWS SDK (software development kit), but does not expose endp

Nov 28, 2022

An open source API wrapper for TechHost API.

TechHost API Wrapper An open source API wrapper for TechHost API. Badges Installation Install techhost-api-wrapper with npm. npm install techhost-api-

Jun 23, 2022

News API Wrapper for Violetics API News

News API Wrapper for Violetics API News

Mar 23, 2022
πŸ’° Straight-forward budgeting.

financier βš™ Github β€” ?? Production app β€” Staging app β€” ?? Staging Docs β€” ?? Trello β€” ?? Website β€” ?? Docker A web-based, offline-first app. Built with

Financier 40 Dec 17, 2022
a simple wrapper nestjs dynamic module on top of surrealdb.js driver, with a consumer app to show case library in action, nothing fancy

README README Project Components Dynamic Module Consumer App Install SurrealDb Starts SurrealDb Init surrealDb Database Run App from Source Code Launc

MΓ‘rio Monteiro 0 Oct 3, 2022
SurrealDB on the edge!

surrealdb-cloudflare SurrealDB on the edge! Cloudflare workers This module has been build specifically to be compatible with cloudflare workers. Teste

The Open Source Company 18 Dec 10, 2022
This is a vanilla Node.js rest API created to show that it is possible to create a rest API using only vanilla Node.js

This is a vanilla Node.js rest API created to show that it is possible to create a rest API using only vanilla Node.js. But in most cases, I would recommend you to use something like Express in a production project for productivity purposes.

Eduardo Dantas 7 Jul 19, 2022
A modern and fashion-forward retail portal.

Atelier Atelier is an ecommerce product detail page built for a fictional clothing company as an exercise in front-end development. It contains three

null 1 Aug 30, 2022
A chrome extension to automatically forward BNS names to their respective web bridges.

bns-chrome-extension A chrome extension to automatically forward BNS names to their respective web bridges. Currently, in order to use .btc names you

Alex Rudloff 3 Oct 3, 2022
Skip the ads on Thingiverse, and get straight to the good stuff.

Thingiverse STL Downloader Those ads sure are annoying. Skip 'em, and get straight to the good stuff. This repository is here for the normal purposes

Stephan Casas 17 Mar 13, 2022
Get started with GatsbyJS straight away without having to spend a whole day configuring your usual addons.

Gatsby Starter Infinite Get started with GatsbyJS straight away without having to spend a whole day configuring your usual addons. This starter includ

Matt Patterson 3 Jun 27, 2022
A small, lightweight JavaScript plugin for placing items in straight rows (jQuery and vanilla JS version) – Demo:

rowGrid.js rowGrid.js is a small, lightweight (~1000 bytes gzipped) jQuery plugin for placing images (or other items) in straight rows. The grid is si

Bruno Joseph 669 Jul 22, 2022
A simple browser extension, intended to get you "Back To Work" when you start slacking off to one of those really addictive sites.

Back to Work A simple browser extension, intended to get you Back To Work when you start slacking off to one of those really addictive sites. What doe

Dheeraj Lalwani 29 Nov 19, 2022