Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot load multiples instance if db files needs to be created #15

Open
lowlighter opened this issue Jun 26, 2021 · 0 comments
Open

Cannot load multiples instance if db files needs to be created #15

lowlighter opened this issue Jun 26, 2021 · 0 comments
Assignees
Labels
bug Something isn't working WIP

Comments

@lowlighter
Copy link

It seems it is not possible to use multiple instances at once when files needs to be created:

import Datastore from 'https://deno.land/x/dndb@0.3.3/mod.ts'

const a = new Datastore({filename:"a", autoload:true})
const b = new Datastore({filename:"b", autoload:true})
console.log(await b.findOne({}))

Will result in:

error: Uncaught (in promise) NotFound: The system cannot find the file specified. (os error 2)
    const file = await Deno.open(this.filename);

Running it twice (i.e. when "a" file is already created) will work.

deno 1.11.2 (release, x86_64-pc-windows-msvc)
v8 9.1.269.35
typescript 4.3.2
@denyncrawford denyncrawford self-assigned this Aug 5, 2021
@denyncrawford denyncrawford added bug Something isn't working WIP labels Aug 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working WIP
Projects
None yet
Development

No branches or pull requests

2 participants