Skip to content

NicholasWalton/codecrafters-sqlite

Repository files navigation

Getting started

  • Install Rye. Rye is a new-ish Python project and package manager that is modeled on cargo. It also includes a linter (ruff) and a code formatter (black).
rye sync
rye build
maturin develop --skip-install --release
rye test
cargo run --bin run_perf_test --release

Codecrafters

Sample Databases

To make it easy to test queries locally, we've added a sample database in the root of this repository: sample.db.

This contains two tables: apples & oranges. You can use this to test your implementation for the first 6 stages.

You can explore this database by running queries against it like this:

$ sqlite3 sample.db "select id, name from apples"
1|Granny Smith
2|Fuji
3|Honeycrisp
4|Golden Delicious

There are two other databases that you can use:

  1. superheroes.db:
    • This is a small version of the test database used in the table-scan stage.
    • It contains one table: superheroes.
    • It is ~1MB in size.
  2. companies.db:
    • This is a small version of the test database used in the index-scan stage.
    • It contains one table: companies, and one index: idx_companies_country
    • It is ~7MB in size.

These aren't included in the repository because they're large in size. You can download them by running this script:

./download_sample_databases.sh

If the script doesn't work for some reason, you can download the databases directly from codecrafters-io/sample-sqlite-databases.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 6