Coder Social home page Coder Social logo

surrealdb / surrealdb.deno Goto Github PK

View Code? Open in Web Editor NEW
12.0 13.0 3.0 19 KB

A Deno engine for the SurrealDB JavaScript SDK

Home Page: https://surrealdb.com

License: Apache License 2.0

TypeScript 100.00%
surreal surrealdb database database-connector realtime-database iot-database deno deno-library deno-module javascript

surrealdb.deno's Introduction


 

A Deno engine for the SurrealDB JavaScript SDK.


   

     

surrealdb.deno

A Deno engine for the SurrealDB JavaScript SDK.

This library is under active development and is not yet released.

This library is a plugin for the SurrealDB JavaScript SDK, which can be used to run SurrealDB as an embedded database within a Deno server side environment.

It enables SurrealDB to be run in-memory, or to persist data by running on top of SurrealKV. It allows for a consistent JavaScript and TypeScript API when using the surrealdb.js library by adding support for embedded storage engines (memory, surrealkv) alongside the remote connection protocols (http, https, ws, wss).

Example usage

import Surreal from "https://deno.land/x/surrealdb/mod.ts";
import { surrealdbDenoEngines } from "https://deno.land/x/surrealdb.deno/mod.ts";

// Enable the WebAssembly engines
const db = new Surreal({
    engines: surrealdbDenoEngines(),
});

// Now we can start SurrealDB as an in-memory database
await db.connect("mem://");
// Or we can start a persisted SurrealKV database
await db.connect("surrealkv://demo");

// Now use the JavaScript SDK as normal.

surrealdb.deno's People

Contributors

tobiemh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

surrealdb.deno's Issues

Request hangs if query is multine in backticks

STR:

surreal start --user root --pass root
deno run --allow-net https://gist.githubusercontent.com/dector/849c1f1baf9e5929fae6f4c395ea388c/raw/b92efa5eb00f0cdad4098b4bfd2b173eaf1a76c9/surreal-deno-issue.ts

ER: Process finished
AR: Process freezes


I have issue with request like (it's hanging):

await db.query(
  `select *
   from posts`
)

but single-line version works (executed immediately):

await db.query(`select * from posts`)

Deno: 1.25.2
library: https://deno.land/x/[email protected]

deno vs. js library

Hi, I just came across the Deno, NodeJS and the JS repository. Do you think it is really necessary to maintain three separate code bases? I would suggest to create a basic TypeScript version with abstract external dependencies. What do you think?

Here is just one example how both repositories are already facing the same issues and are being maintained with redundant issues:
Deno: #4
JS: surrealdb/surrealdb.js#5

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.