Code Monkey home page Code Monkey logo

Comments (10)

cbalano avatar cbalano commented on June 29, 2024 1

Read-only confirmed as working now. Thank you, good sir!

from bow.

zippoxer avatar zippoxer commented on June 29, 2024

This must be some update call bow makes when it's initializing. I'll be checking this later today, and hopefully commit a fix and let you know.

from bow.

cbalano avatar cbalano commented on June 29, 2024

Alright, sounds good; please let me know.

from bow.

zippoxer avatar zippoxer commented on June 29, 2024

Okay, I think I found the issue -- when you're Open-ing a brand new database that hasn't been opened before, bow tries to create and store it's meta structure (containing information about buckets) even if it's opened with ReadOnly.

This same problem happens when you access a bucket that doesn't exist -- bow will try to create it regardless of the ReadOnly restriction.

Thanks for reporting this issue, I will fix it and let you know.

from bow.

cbalano avatar cbalano commented on June 29, 2024

Excellent. Read-only is a big deal if you access the database from a different process. Inside the same process, one can delegate all Bow operations to a dedicated goroutine and thus avoid dealing with DB locks.

from bow.

zippoxer avatar zippoxer commented on June 29, 2024

Update: I've set up a read-only test, and I'm fixing stuff until it passes. Will let you know.

from bow.

zippoxer avatar zippoxer commented on June 29, 2024

@cbalano

Commit 6703512 resolves this issue.

You can now Open with SetReadOnly(true) and you should be able to read freely, but not write.

Please let me know how it works out for you 😄

from bow.

cbalano avatar cbalano commented on June 29, 2024

When I attempt to open read-only in a directory that does not exist, I get a panic, rather than an error. Is that the intended behavior?

from bow.

zippoxer avatar zippoxer commented on June 29, 2024

@cbalano This behaviour is inherited from BadgerDB. Would you prefer to get an error when opening the database instead? Maybe something like ErrNoDatabase?

from bow.

cbalano avatar cbalano commented on June 29, 2024

Well, it's a nicety, not a must.

from bow.

Related Issues (9)

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.