{"id":16915778,"url":"https://github.com/i-sevostyanov/nanodb","last_synced_at":"2026-04-08T14:31:34.155Z","repository":{"id":41887539,"uuid":"345369752","full_name":"i-sevostyanov/NanoDB","owner":"i-sevostyanov","description":"An SQL database, written as a learning project.","archived":false,"fork":false,"pushed_at":"2024-08-15T18:46:41.000Z","size":258,"stargazers_count":11,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T10:45:40.248Z","etag":null,"topics":["database","dbms","expression-engine","relational-model","sql","sql-database","sql-parser","volcano-model"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/i-sevostyanov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-07T14:37:30.000Z","updated_at":"2024-08-15T18:46:43.000Z","dependencies_parsed_at":"2024-08-15T20:55:23.480Z","dependency_job_id":null,"html_url":"https://github.com/i-sevostyanov/NanoDB","commit_stats":{"total_commits":62,"total_committers":1,"mean_commits":62.0,"dds":0.0,"last_synced_commit":"21af16cf8ba4832ea142dc85257d4d010520f7bc"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-sevostyanov%2FNanoDB","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-sevostyanov%2FNanoDB/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-sevostyanov%2FNanoDB/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-sevostyanov%2FNanoDB/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/i-sevostyanov","download_url":"https://codeload.github.com/i-sevostyanov/NanoDB/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244944413,"owners_count":20536290,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","dbms","expression-engine","relational-model","sql","sql-database","sql-parser","volcano-model"],"created_at":"2024-10-13T19:22:34.892Z","updated_at":"2026-04-08T14:31:34.074Z","avatar_url":"https://github.com/i-sevostyanov.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CI](https://github.com/i-sevostyanov/NanoDB/actions/workflows/go.yml/badge.svg)](https://github.com/i-sevostyanov/NanoDB/actions/workflows/go.yml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/i-sevostyanov/NanoDB)](https://goreportcard.com/report/github.com/i-sevostyanov/NanoDB)\n[![codecov](https://codecov.io/gh/i-sevostyanov/NanoDB/branch/main/graph/badge.svg?token=y0lxdfxXdT)](https://codecov.io/gh/i-sevostyanov/NanoDB)\n[![GitHub license](https://img.shields.io/github/license/i-sevostyanov/NanoDB)](https://github.com/i-sevostyanov/NanoDB/blob/main/LICENSE)\n\n# NanoDB\n\nSQL database, written as a learning project to better understand the internals of a database.\n\n## Features\n\n* A good starting point to dive into database internals\n* Modular and extendable architecture\n* Implemented widely usable SQL statements (SELECT, INSERT, UPDATE, DELETE, [and more](docs/sql.md))\n* Interactive terminal for easy commands execution and experiments\n\n## Documentation\n\n* [Architecture](docs/architecture.md)\n* [SQL reference](docs/sql.md)\n* [References](docs/references.md)\n\n## Shell\n\nThe NanoDB command line provides an SQL shell that can be used to select, insert, delete, and modify data.\n\n### Run locally\n\n```shell\ngit clone https://github.com/i-sevostyanov/NanoDB.git\ncd NanoDB\ngo run ./cmd/shell/main.go\n#\u003e \\import \u003cpath to project\u003e/testdata/demo.sql\n```\n\n### Examples:\n\nImagine that we have a table with the following definition:\n\n```sql\nCREATE TABLE aircrafts\n(\n    id    INTEGER PRIMARY KEY,\n    code  TEXT    NOT NULL,\n    model TEXT    NOT NULL,\n    range INTEGER NOT NULL\n);\n```\n\n#### SELECT\n\nSelect all columns:\n\n```shell\ndemo #\u003e SELECT * FROM aircrafts\n+----+------+---------------------+-------+\n| id | code |        model        | range |\n+----+------+---------------------+-------+\n| 1  | 773  | Boeing 777-300      | 11100 |\n| 2  | 763  | Boeing 767-300      | 7900  |\n| 3  | SU9  | Sukhoi Superjet-100 | 3000  |\n| 4  | 320  | Airbus A320-200     | 5700  |\n| 5  | 321  | Airbus A321-200     | 5600  |\n| 6  | 319  | Airbus A319-100     | 6700  |\n| 7  | 733  | Boeing 737-300      | 4200  |\n| 8  | CN1  | Cessna 208 Caravan  | 1200  |\n| 9  | CR2  | Bombardier CRJ-200  | 2700  |\n+----+------+---------------------+-------+\n(9 rows)\n\n```\n\nSelect specified columns with order, limit and offset:\n\n```shell\ndemo #\u003e SELECT id, model, range FROM aircrafts WHERE range \u003c 5000 ORDER BY range ASC LIMIT 5 OFFSET 2\n+----+---------------------+-------+\n| id |        model        | range |\n+----+---------------------+-------+\n| 3  | Sukhoi Superjet-100 | 3000  |\n| 7  | Boeing 737-300      | 4200  |\n+----+---------------------+-------+\n(2 rows)\n```\n\nSelect expression:\n\n```shell\ndemo #\u003e SELECT 6+(2^3)*5-3+4/(10-2)%3\n+----------------------------------------------------+\n| (((6 + ((2 ^ 3) * 5)) - 3) + ((4 / (10 - 2)) % 3)) |\n+----------------------------------------------------+\n| 43                                                 |\n+----------------------------------------------------+\n(1 rows)\n```\n\n#### INSERT\n\n```shell\ndemo #\u003e INSERT INTO aircrafts (code, model, range) VALUES ('773', 'Boeing 777-300', 11100);\nQuery OK, 1 row affected\n```\n\n#### UPDATE\n\n```shell\ndemo #\u003e UPDATE airports SET code = 'MRN' WHERE id = 2\nQuery OK, 1 row affected\n```\n\n#### DELETE\n\n```shell\ndemo #\u003e DELETE FROM airports WHERE id \u003e 5\nQuery OK, 4 rows affected\n```\n\n## Roadmap\n\n* Indices\n* Joins\n* Subqueries\n* Aggregations (count, sum, avg, max, min)\n* Explain and query optimization\n* Transactions ([ACID](https://en.wikipedia.org/wiki/ACID),\n  [MVCC](https://en.wikipedia.org/wiki/Multiversion_concurrency_control), \n  [WAL](https://en.wikipedia.org/wiki/Write-ahead_logging))\n* Constraints (unique key, check, foreign key)\n* Built-in functions (sin, cos, abs, floor, etc)\n\n## Contributing\n\nContributions are welcome!\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi-sevostyanov%2Fnanodb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fi-sevostyanov%2Fnanodb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi-sevostyanov%2Fnanodb/lists"}