Giter Site home page Giter Site logo

h3rald / litestore Goto Github PK

View Code? Open in Web Editor NEW
210.0 8.0 8.0 47.17 MB

A lightweight, self-contained, RESTful, searchable, multi-format NoSQL document store.

Home Page: https://h3rald.com/litestore

License: MIT License

JavaScript 7.11% CSS 8.85% Nim 70.44% Shell 0.13% HTML 0.39% Less 12.73% Dockerfile 0.34%
datastore nosql fulltext-search sqlite jwt middleware web-server self-contained

litestore's Introduction

Nimble

Release License

LiteStore is a lightweight, self-contained, RESTful, multi-format NoSQL document store server written in Nim and powered by a SQLite backend for storage. It aims to be a very simple and lightweight backend ideal for prototyping and testing REST APIs and single-page applications.

For more information, see:

Or read the full LiteStore User Guide.

litestore's People

Contributors

arikrahman avatar h3rald avatar licoricee avatar skellock avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

litestore's Issues

Pack/unpack directories

Implement methods to:

  • recursively "pack" the contents of a directory into a data store
  • "unpack" a previously-packed directory (removing also the corresponding contents from the datastore)

Serve directory contents

By default, when running LiteStore with -d option specified, the directory contents should be served by LiteStore web server.

App: Upload files

Allow file uploading by browsing local filesystem and/or drag & drop.

App: Search

Implement support for searching text files within the app.

Great Job

Man, what a gem of a project.

Thank you for open sourcing this.

๐Ÿ˜ป

mirror operation

Enable LiteStore to "mount" a local directory and keep it mirrored both on the database and the filesystem.

Open default document in browser

  • Add default_page column to info table
  • Increment db Schema version
  • Add --default:<doc_id> option to set/unset default page
  • Add logic to open default document in browser at startup if default is set

Unable to modify or cancel file upload

At present, it is not possible to edit the document ID in the upload dialog after it is set for the first time, and it is not possible to "cancel" an upload (clearing all fields of the form).

Use with Nim web-framework?

Is it possible to use Litestore as a prototype-DB for a Nim web-framework?

I am currently tinkering with Jester and I would like to add/edit/delete JSON (via the Jester-backend).

So instead of having Litestore be a client-facing datastore (as the documentation shows), I would instead like to use litestore in this manner:

Client <-> Jester-REST-API <-> litestore-DB

Is this possible to achieve?

If yes, are you able to share a small example in the readme file? It may help a lot of people that want to prototype small webapps with Jester+Litestore

Thanks!

-s:<db> does not work on windows

The executable defaults to data.db no matter what the -s or --store value is
Is the same for both the x86 and x64 builds.
Version 1.0.1

Test failing

/Users/h3rald/Development/litestore/test/http_api.nim(194, 37): Check failed: json["results"][3]["data"] == testdata
   json["results"][3]["data"] was {"age":null,"email":null}
   testdata was {"age":36,"email":"[email protected]"}
   /Users/h3rald/Development/litestore/test/http_api.nim(200, 23): Check failed: json["data"] == testdata
   json["data"] was {"age":null}
   testdata was {"age":31}

Whitespace Cleanup

Was wondering if you'd be ok with a PR that cleaned up whitespace in *.nim?

image

Thanks!

Performance Improvements

Apply the following changes to improve performance for large (> 1GB) SQLite database.

Modify compilation flags

   {.passC: "-DSQLITE_ENABLE_FTS4=1 -DSQLITE_DEFAULT_LOCKING_MODE=1".}

Configure PRAGMAs when opening the database

   discard result.db.tryExec("PRAGMA locking_mode = exclusive;".sql)
   discard result.db.tryExec("PRAGMA journal_mode = WAL;".sql)
   discard result.db.tryExec("PRAGMA page_size = 4096;".sql)
   discard result.db.tryExec("PRAGMA cache_size = 10000;".sql)
   discard result.db.tryExec("PRAGMA synchronous = NORMAL;".sql)

Execute commands on data store via command line

  • vacuum
  • optimize/rebuild

Import optimizations

  1. DROP INDEX for docid
  2. Import data
  3. CREATE INDEX for docid
  4. OPTIMIZE
  5. VACUUM

Additional indexes

     CREATE INDEX tags_document_id ON tags(document_id);
     CREATE INDEX tags_tag_id ON tags(tag_id);
     CREATE INDEX documents_id ON documents(id);

Documentation

Provide complete documentation, both as standalone document and integrated in the app.

Invalid nimble file

Move all custom fields out of the nimble file.

Error: unhandled exception: Invalid field: appame [ENimble]

Machine Tags

LiteStore should support Flickr-style machine tags.

Examples:

  http://localhost:9500/docs?sys.type=text;*.subtype=*;
  http://localhost:9500/docs?sys.format=binary;myapp.something=%22something%20else%22

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.