Giter Club home page Giter Club logo

Comments (11)

kearfy avatar kearfy commented on May 20, 2024 2

Hey @alexgorbatchev and @CanRau, so sorry for the late response here! I've mainly been very busy which is unfortunately holding me back from fixing these issues. I will be focusing on some welcome improvements to the JS ecosystem the coming time again and will also make sure to tackle this issue!

from surrealdb.node.

CanRau avatar CanRau commented on May 20, 2024 1

Got it working with RocksDB 🥳

  1. Clone into yarn workspace
  2. yarn install within surrealdb.node dir
  3. changed Cargo.toml to
[package]
name = "surrealdb_node"
version = "0.4.0"
edition = "2021"

[lib]
crate-type = ["cdylib"]

[dependencies]
dmp = "0.2.0"
napi = { version = "2", features = ["async", "serde-json"] }
napi-derive = "2"
serde = "1.0.188"
serde_json = "1.0.105"
surrealdb = { version = "1.0.0", features = ["kv-mem", "kv-rocksdb"] }

[build-dependencies]
napi-build = "2.0.1"

[features]
rocksdb = ["surrealdb/kv-rocksdb"]

[profile.release]
lto = true

# [target.x86_64-pc-windows-msvc.dependencies]
# surrealdb = { version = "1.0.0", features = ["kv-mem", "kv-rocksdb"] }
# [target.x86_64-unknown-linux-gnu.dependencies]
# surrealdb = { version = "1.0.0", features = ["kv-mem", "kv-rocksdb"] }
# [target.aarch64-linux-android.dependencies]
# surrealdb = { version = "1.0.0", features = ["kv-mem", "kv-rocksdb"] }
# [target.armv7-linux-androideabi.dependencies]
# surrealdb = { version = "1.0.0", features = ["kv-mem", "kv-rocksdb"] }
[target.aarch64-apple-darwin.dependencies]
surrealdb = { version = "1.0.0", features = ["kv-mem", "kv-rocksdb"] }
  1. yarn build in surrealdb.node dir
  2. add "surrealdb.node": "0.4.0" to main project's package.json
  3. yarn install in project root
  4. yarn dev 🚀

from surrealdb.node.

CanRau avatar CanRau commented on May 20, 2024 1

Okay so the installation problem, at least in my case, was due to yarn v1, as I switched our project to pnpm couple of days ago I just tried again and installation worked though I think rocksdb might not work, also deployed in Docker didn't seem to work on first try, so I'm still desperately waiting for nodejs embedded surrealdb to advance 😇

from surrealdb.node.

CanRau avatar CanRau commented on May 20, 2024

Any chance someone could help me figure this out? 😇

from surrealdb.node.

CanRau avatar CanRau commented on May 20, 2024

Now I'm wondering why those lines where disabled, anything I should watch out for?
Tho in production it would build and run on Linux

from surrealdb.node.

MountainAndMorning avatar MountainAndMorning commented on May 20, 2024

Has development of this library been discontinued?

from surrealdb.node.

MountainAndMorning avatar MountainAndMorning commented on May 20, 2024

Thanks for your help. I follow your step to install surrealdb.node on my Macbook Air with M2 chip. Everything is OK. However, when I run the official example, as below, I encounter this error: [Error: Select either namespace or database to use] error at the line await db.use({ ns: "test", db: "test" });.

import {Surreal} from 'surrealdb.node';
const {Surreal} = require('surrealdb.node');

const db = new Surreal();

// use in-memory database
await db.connect('memory');

// 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),
});

from surrealdb.node.

CanRau avatar CanRau commented on May 20, 2024

I hope and don't think it has been discontinued just too many other priorities are the moment I guess 🥲

Though I'm also desperately waiting for it to continue & improve 🥹

Sorry can't help you as I never continued my experiments, would prefer official support 😇

from surrealdb.node.

alexgorbatchev avatar alexgorbatchev commented on May 20, 2024

Looks like this issue is being ignored... I "fixed" this by publishing the missing surrealdb.node-linux-arm-gnueabihf and surrealdb.node-win32-arm64-msvc as blank packages to prevent install errors. Cheers.

from surrealdb.node.

CanRau avatar CanRau commented on May 20, 2024

Hey @kearfy thanks for the heads up really appreciated 🙌🏼
Just to understand the situation a little better do you have a rough estimate on when you'll have the time to work on surrealdb.node? Like next week, month, later or unknown? 😇

from surrealdb.node.

Related Issues (20)

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.