Skip to content

Commit 9c1b8e3

Browse files
authored
Merge branch 'main' into CC-1158-gleam
2 parents 20db5f4 + 093f5bd commit 9c1b8e3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+540
-39
lines changed

compiled_starters/cpp/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.13)
2-
project(git-starter-cpp)
2+
project(sqlite-starter-cpp)
33
set(CMAKE_CXX_STANDARD 20) # Enable the C++20 standard
44

55
set(SOURCE_FILES src/Server.cpp)

compiled_starters/csharp/your_sqlite3.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
# CodeCrafters uses this file to test your code. Don't make any changes here!
66
#
77
# DON'T EDIT THIS!
8-
exec dotnet run --project . --configuration Release "$@"
8+
exec dotnet run --project . --configuration Release -- "$@"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
*.db
2+
node_modules/

compiled_starters/javascript/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Time to move on to the next stage!
3030

3131
Note: This section is for stages 2 and beyond.
3232

33-
1. Ensure you have `node (16)` installed locally
33+
1. Ensure you have `node (21)` installed locally
3434
1. Run `./your_sqlite3.sh` to run your program, which is implemented in
3535
`app/main.js`.
3636
1. Commit your changes and run `git push origin master` to submit your solution

compiled_starters/javascript/codecrafters.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ debug: false
77
# Use this to change the JavaScript version used to run your code
88
# on Codecrafters.
99
#
10-
# Available versions: nodejs-18
11-
language_pack: nodejs-18
10+
# Available versions: nodejs-21
11+
language_pack: nodejs-21

compiled_starters/javascript/package-lock.json

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
{
2-
"name": "sqlite-starter-javascript",
3-
"version": "1.0.0",
4-
"description": "This is a starting point for JavaScript solutions to the Build Your Own SQLite challenge",
5-
"main": "app/main.js",
6-
"author": "CodeCrafters",
7-
"type": "module",
8-
"license": "MIT"
9-
}
2+
"name": "@codecrafters/build-your-own-sqlite",
3+
"version": "1.0.0",
4+
"description": "Build your own SQLite challenge, from CodeCrafters",
5+
"main": "main.js",
6+
"type": "module",
7+
"scripts": {
8+
"dev": "node app/main.js"
9+
},
10+
"keywords": [
11+
"build-your-own-x"
12+
],
13+
"author": "",
14+
"license": "MIT",
15+
"dependencies": {}
16+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
![progress-banner](https://codecrafters.io/landing/images/default_progress_banners/sqlite.png)
2+
3+
This is a starting point for TypeScript solutions to the
4+
["Build Your Own SQLite" Challenge](https://codecrafters.io/challenges/sqlite).
5+
6+
In this challenge, you'll build a barebones SQLite implementation that supports
7+
basic SQL queries like `SELECT`. Along the way we'll learn about
8+
[SQLite's file format](https://www.sqlite.org/fileformat.html), how indexed data
9+
is
10+
[stored in B-trees](https://jvns.ca/blog/2014/10/02/how-does-sqlite-work-part-2-btrees/)
11+
and more.
12+
13+
**Note**: If you're viewing this repo on GitHub, head over to
14+
[codecrafters.io](https://codecrafters.io) to try the challenge.
15+
16+
# Passing the first stage
17+
18+
The entry point for your SQLite implementation is in `app/main.ts`. Study and
19+
uncomment the relevant code, and push your changes to pass the first stage:
20+
21+
```sh
22+
git add .
23+
git commit -m "pass 1st stage" # any msg
24+
git push origin master
25+
```
26+
27+
Time to move on to the next stage!
28+
29+
# Stage 2 & beyond
30+
31+
Note: This section is for stages 2 and beyond.
32+
33+
1. Ensure you have `bun (1.1)` installed locally
34+
1. Run `./your_sqlite3.sh` to run your program, which is implemented in
35+
`app/main.ts`.
36+
1. Commit your changes and run `git push origin master` to submit your solution
37+
to CodeCrafters. Test output will be streamed to your terminal.
38+
39+
# Sample Databases
40+
41+
To make it easy to test queries locally, we've added a sample database in the
42+
root of this repository: `sample.db`.
43+
44+
This contains two tables: `apples` & `oranges`. You can use this to test your
45+
implementation for the first 6 stages.
46+
47+
You can explore this database by running queries against it like this:
48+
49+
```sh
50+
$ sqlite3 sample.db "select id, name from apples"
51+
1|Granny Smith
52+
2|Fuji
53+
3|Honeycrisp
54+
4|Golden Delicious
55+
```
56+
57+
There are two other databases that you can use:
58+
59+
1. `superheroes.db`:
60+
- This is a small version of the test database used in the table-scan stage.
61+
- It contains one table: `superheroes`.
62+
- It is ~1MB in size.
63+
1. `companies.db`:
64+
- This is a small version of the test database used in the index-scan stage.
65+
- It contains one table: `companies`, and one index: `idx_companies_country`
66+
- It is ~7MB in size.
67+
68+
These aren't included in the repository because they're large in size. You can
69+
download them by running this script:
70+
71+
```sh
72+
./download_sample_databases.sh
73+
```
74+
75+
If the script doesn't work for some reason, you can download the databases
76+
directly from
77+
[codecrafters-io/sample-sqlite-databases](https://github.com/codecrafters-io/sample-sqlite-databases).

0 commit comments

Comments
 (0)