Better root organization

This commit is contained in:
Adrien Bouvais 2024-10-07 23:27:05 +02:00
parent 3c3d40a019
commit 817ba4de2f
8 changed files with 9 additions and 141 deletions

View File

@ -6,9 +6,7 @@ ZipponDB is a relational database written entirely in Zig from stractch.
It use a custom query language named ZipponQL or ZiQL for short.
The first time you run ZipponDB, it will create a new ZipponDB directory and start the Zippon CLI.
From here, you can create a new engine by running `schema build`. It will use the file `schema.zipponschema` and build a custom binary
using zig, that the CLI will then use to manipulate data. You then interact with the engine by using `run "My query go here"` or
by directly using the engine binary.
From here, you can update the schema by running `schema update`, that use `schema.zipponschema` by default.
### Why Zippon ?
@ -133,6 +131,7 @@ v 0.1 - Base
[X] Tokenizers
[ ] Schema management
[ ] File management
[ ] Loging
[ ] Base Parser
v 0.2 - Usable

View File

@ -1,59 +0,0 @@
# All class of ZipponDB
## Tokenizer
All tokenizer are inspiered (highly ;) ) by the Zig tokenizer. https://github.com/ziglang/zig/blob/master/lib/std/zig/tokenizer.zig
Each tokenizer have it's own token. Each token have multiple tag in the form of an enum. For example the CLI Token can have all those tag:
```zig
pub const Tag = enum {
eof,
invalid,
keyword_run,
keyword_help,
keyword_describe,
keyword_schema,
keyword_build,
keyword_quit,
string_literal,
identifier,
};
```
The tokenizer take a buffer as an array of character (u8) when init, it is the text to tokenize.
Then a unique function next, that will iterate over each characther of the buffer and find the next token. The token can be invalid and is then return.
### ZiQL
The ZiQL tokenizer is the main tokenizer. It is the one that tokenize query.
### CLI
The CLI tokenizer is the one that take command and do stuff. It is the simplier as it only have keywords like run, help and describe. As well as string for query (Betwwen "").
### Schema
The schema tokenizer take the .zipponschema file and generate the dtypes.zig file that is then use to build the engine.
## DataEngine
The DataEngine is the class that do stuff with files. Nowhere else should file be manipulate.
## Parser
All Parser take a tokenizer and an allocator and do stuff.
### ZiQL
The ZiQL Parser will take the tokenizer and do stuff depending of the main action (GRAB, DELETE, ADD, UPDATE).
### CLI
The CLI doesnt really have a Parser struct but the main function of the console act like it. Maybe I will do a proper Parser in the future.
### Schema
TODO

View File

@ -1,6 +0,0 @@
[ ] Finish the filter parsing
[ ] Create a TEST_DATA dataset without any link
[ ] Do some test on filter using the TEST_DATA
[ ] Do some test on DataEngine to check if can add stuff to the TEST_DATA
[ ] Check memory leak of Parser
[ ] Do testing on parser

Binary file not shown.

Before

Width:  |  Height:  |  Size: 532 KiB

View File

@ -24,6 +24,7 @@ pub fn build(b: *std.Build) void {
.target = target,
.optimize = optimize,
.name = "Data parsing",
.test_runner = b.path("test_runner.zig"),
});
const run_tests1 = b.addRunArtifact(tests1);
@ -32,6 +33,7 @@ pub fn build(b: *std.Build) void {
.target = target,
.optimize = optimize,
.name = "CLI tokenizer",
.test_runner = b.path("test_runner.zig"),
});
const run_tests2 = b.addRunArtifact(tests2);
@ -40,6 +42,7 @@ pub fn build(b: *std.Build) void {
.target = target,
.optimize = optimize,
.name = "ZiQL tokenizer",
.test_runner = b.path("test_runner.zig"),
});
const run_tests3 = b.addRunArtifact(tests3);
@ -48,6 +51,7 @@ pub fn build(b: *std.Build) void {
.target = target,
.optimize = optimize,
.name = "Schema tokenizer",
.test_runner = b.path("test_runner.zig"),
});
const run_tests4 = b.addRunArtifact(tests4);
@ -56,6 +60,7 @@ pub fn build(b: *std.Build) void {
.target = target,
.optimize = optimize,
.name = "UUID",
.test_runner = b.path("test_runner.zig"),
});
const run_tests5 = b.addRunArtifact(tests5);
@ -64,6 +69,7 @@ pub fn build(b: *std.Build) void {
.target = target,
.optimize = optimize,
.name = "File Engine",
.test_runner = b.path("test_runner.zig"),
});
const run_tests6 = b.addRunArtifact(tests6);
@ -72,7 +78,7 @@ pub fn build(b: *std.Build) void {
.target = target,
.optimize = optimize,
.name = "ZiQL parser",
//.test_runner = b.path("test_runner.zig"),
.test_runner = b.path("test_runner.zig"),
});
const run_tests7 = b.addRunArtifact(tests7);

View File

@ -1,72 +0,0 @@
.{
// This is the default name used by packages depending on this one. For
// example, when a user runs `zig fetch --save <url>`, this field is used
// as the key in the `dependencies` table. Although the user can choose a
// different name, most users will stick with this provided value.
//
// It is redundant to include "zig" in this name because it is already
// within the Zig package namespace.
.name = "zippon2",
// This is a [Semantic Version](https://semver.org/).
// In a future version of Zig it will be used for package deduplication.
.version = "0.0.0",
// This field is optional.
// This is currently advisory only; Zig does not yet do anything
// with this value.
//.minimum_zig_version = "0.11.0",
// This field is optional.
// Each dependency must either provide a `url` and `hash`, or a `path`.
// `zig build --fetch` can be used to fetch all dependencies of a package, recursively.
// Once all dependencies are fetched, `zig build` no longer requires
// internet connectivity.
.dependencies = .{
// See `zig fetch --save <url>` for a command-line interface for adding dependencies.
//.example = .{
// // When updating this field to a new URL, be sure to delete the corresponding
// // `hash`, otherwise you are communicating that you expect to find the old hash at
// // the new URL.
// .url = "https://example.com/foo.tar.gz",
//
// // This is computed from the file contents of the directory of files that is
// // obtained after fetching `url` and applying the inclusion rules given by
// // `paths`.
// //
// // This field is the source of truth; packages do not come from a `url`; they
// // come from a `hash`. `url` is just one of many possible mirrors for how to
// // obtain a package matching this `hash`.
// //
// // Uses the [multihash](https://multiformats.io/multihash/) format.
// .hash = "...",
//
// // When this is provided, the package is found in a directory relative to the
// // build root. In this case the package's hash is irrelevant and therefore not
// // computed. This field and `url` are mutually exclusive.
// .path = "foo",
// // When this is set to `true`, a package is declared to be lazily
// // fetched. This makes the dependency only get fetched if it is
// // actually used.
// .lazy = false,
//},
},
// Specifies the set of files and directories that are included in this package.
// Only files and directories listed here are included in the `hash` that
// is computed for this package. Only files listed here will remain on disk
// when using the zig package manager. As a rule of thumb, one should list
// files required for compilation plus any license(s).
// Paths are relative to the build root. Use the empty string (`""`) to refer to
// the build root itself.
// A directory listed here means that all files within, recursively, are included.
.paths = .{
"build.zig",
"build.zig.zon",
"src",
// For example...
//"LICENSE",
//"README.md",
},
}

BIN
logo/banner.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 740 KiB

View File

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 79 KiB