Giter VIP home page Giter VIP logo

flakedb's Introduction

flakedb

SQLite-like database implemented in Rust as a programming exercise

flakedb's People

Contributors

fokoid avatar

Stargazers

 avatar

Watchers

 avatar

flakedb's Issues

Update README

Update readme with usage demo and some other context

Interior mutability for the pager

Ultimately, many cursors may want to simultaneously hold a borrow to the pager.

  • For reads, external behaviour of pager is immutable, but internal state must change to facilitate reading pages from the disk cache, or lazily allocating new empty pages in memory
  • For writes, a unique/mutable borrow is of course needed, but only one page need be borrowed at a time

To achieve this, the PageFile and each individual Page will be placed in a RefCell.

Partial pages do not survive round trip

Pages do not track number of populated rows, that comes from the single table object right now. But when we read back from disk, the number of rows is calculated as num_pages * ROWS_PER_PAGE, so the partial page is read back as a full page with many empty rows.

We could fix this by subtracting from row count based on size of zeroed memory at the end of the last page. However, it's not really worth the effort since we will soon be switching page format from contiguous arrays to btree nodes #4. Will mark the failing test as skip for now, and ensure it's passing with the btree implementation.

Add logging

  • add logging at various levels with the log crate
  • convert existing log lines using eprintln! to use logging macros
  • fix rexpect tests currently broken by logging output by setting log level appropriately

Review & refactor codebase

As the final task for the MVP milestone, I'd like to review the code and restructure/refactor as appropriate to clean things up ready for future changes.

Persist database to disk

  • optional file path argument to repl binary
  • pager abstraction between database operations and the underlying memory
  • support for reading/writing pages to disk
  • fall back to memory only if no path is provided
  • additional rexpect tests to assert new behaviour works correctly in REPL

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.