Skip to content

janosimas/code_as_db

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code as DB

Code as db is a proof of concept for storing code in a database instead of a text file.

In fact, this currently already happens, many tools already parse the code en generate databases for fast and easy information retrieval.

The idea here is the go on step further and have the code already in a db. This would allow easier search and tooling of the code.

Build

The nightly toolchain is needed to build this project.

cargo +nightly build

Initialize

The butane_cli is required to installed before using the crates.

cargo install butane_cli

The butane models need to be used to initialize the database:

cd code_as_db_models
butane init sqlite ../code.db
butane makemigration init
butane migrate
cargo +nightly run
cd ..

Run

The database also needs to be declared in code_as_db_builder:

cd code_as_db_builder
butane init sqlite ../code.db

Then the sample code can be fetched from the database

cargo +nightly run
cd ..

About

Proof of concept of storing code in a database

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages