Giter VIP home page Giter VIP logo

btrdb's Issues

byte length error when Deno upgraded to v1.31.2

Hi, for a while i'm using btrdb databeses for simple data storage in Deno. After i upgrade Deno it's last version, and try to creating table and upsert some initial datas in it I encountered this error message:

error: Uncaught Error: Expect 16 == 19 throw new Error("Expect " + r.written + " == " + len); ^ at writeValue (https://deno.land/x/[email protected]/src/utils/binval.ts:75:13) at writeValue (https://deno.land/x/[email protected]/src/utils/binval.ts:107:9) at DocumentValue.writeTo (https://deno.land/x/[email protected]/src/utils/value.ts:141:5) at InFileStorage.addData (https://deno.land/x/[email protected]/src/pages/storage.ts:325:11) at async DbDocSet._set (https://deno.land/x/[email protected]/src/database/DbDocSet.ts:150:13) at async DbDocSet.upsert (https://deno.land/x/[email protected]/src/database/DbDocSet.ts:114:5)

Here is an example code how i offently upsert data usage:

const exampleWriteCode = async (dbpath, data) => {
  const db = new Database();
  await db.openFile(dbpath);
  const tbl = await db.createSet("tbl", "doc");
  await db.commit();

  for (let i = 0; i < data.length; i++) {
    const d = data[i];
    await tbl.upsert({ ...d });
  }

  await db.forceCommit();
};

After i encountered this error, downgraded deno to 1.31.1 fix this issue. This error produced v1.31.2 or later.

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.