Giter VIP home page Giter VIP logo

codecrafters-sqlite-go's Introduction

progress-banner

This is a starting point for Go solutions to the "Build Your Own SQLite" Challenge.

In this challenge, you'll build a barebones SQLite implementation that supports basic SQL queries like SELECT. Along the way we'll learn about SQLite's file format, how indexed data is stored in B-trees and more.

Note: If you're viewing this repo on GitHub, head over to codecrafters.io to try the challenge.

Passing the first stage

The entry point for your SQLite implementation is in app/main.go. Study and uncomment the relevant code, and push your changes to pass the first stage:

git add .
git commit -m "pass 1st stage" # any msg
git push origin master

Time to move on to the next stage!

Stage 2 & beyond

Note: This section is for stages 2 and beyond.

  1. Ensure you have go (1.16+) installed locally
  2. Run ./your_sqlite3.sh to run your program, which is implemented in app/main.go.
  3. Commit your changes and run git push origin master to submit your solution to CodeCrafters. Test output will be streamed to your terminal.

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.

codecrafters-sqlite-go's People

Contributors

codecrafters-bot avatar rohitpaulk avatar sarupbanskota avatar

Watchers

 avatar  avatar

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.