npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

surrealdb.node

v0.3.0

Published

Node.js driver for SurrealDB

Downloads

626

Readme

surrealdb.node

The official SurrealDB library for Node.js.

SurrealDB is an end-to-end cloud-native database designed for modern applications, including web, mobile, serverless, Jamstack, backend, and traditional applications. With SurrealDB, you can simplify your database and API infrastructure, reduce development time, and build secure, performant apps quickly and cost-effectively.

Key features of SurrealDB include:

  • Reduces development time: SurrealDB simplifies your database and API stack by removing the need for most server-side components, allowing you to build secure, performant apps faster and cheaper.
  • Real-time collaborative API backend service: SurrealDB functions as both a database and an API backend service, enabling real-time collaboration.
  • Support for multiple querying languages: SurrealDB supports SQL querying from client devices, GraphQL, ACID transactions, WebSocket connections, structured and unstructured data, graph querying, full-text indexing, and geospatial querying.
  • Granular access control: SurrealDB provides row-level permissions-based access control, giving you the ability to manage data access with precision.

View the features, the latest releases, the product roadmap, and documentation.

// import as ES module or common JS
import {Surreal} from 'surrealdb.node';
const {Surreal} = require('surrealdb.node');

const db = new Surreal();

// use in-memory database
await db.connect('memory');
// connect to database server
await db.connect('ws://127.0.0.1:8000');
// use rocksdb file
await db.connect(`rocksdb://${process.cwd()}/test.db`);

// Select a specific namespace / database
await db.use({ ns: "test", db: "test" });

// Create a new person with a random id
let created = await db.create("person", {
    title: "Founder & CEO",
    name: {
        first: "Tobie",
        last: "Morgan Hitchcock",
    },
    marketing: true,
    identifier: Math.random().toString(36).substr(2, 10),
});

// Update a person record with a specific id
let updated = await db.merge("person:jaime", {
    marketing: true
});

// Select all people records
let people = await db.select("person");

// Perform a custom advanced query
let groups = await db.query(
    "SELECT marketing, count() FROM type::table($table) GROUP BY marketing",
    {
        table: "person",
    },
);

// Delete all people upto but not including Jaime
let deleted = await db.delete("person:..jaime");

// Delete all people
await db.delete("person");

Supported targets

| Tripple | supported | rocksdb support | reason | | ----------------------------- | :-------: | :-------------: | ---------------: | | aarch64-apple-darwin | ✓ | x | | | aarch64-linux-android | ✓ | ✓ | | | aarch64-unknown-linux-gnu | ✓ | ✓ | | | aarch64-unknown-linux-musl | ✓ | x | | | aarch64-pc-windows-msvc | x | x | ring build fails | | armv7-unknown-linux-gnueabihf | x | x | psm build fails | | x86_64-unknown-linux-musl | ✓ | x | | | x86_64-unknown-freebsd | ✓ | x | | | i686-pc-windows-msvc | ✓ | ✓ | | | armv7-linux-androideabi | ✓ | ✓ | | | universal-apple-darwi | ✓ | x | |