Started work on Database code

This commit is contained in:
OmniaX-Dev 2026-06-22 06:52:04 +02:00
parent 2788a63495
commit bc1b5b5e53
4 changed files with 84 additions and 0 deletions

9
extra/testQuery.oq Normal file
View file

@ -0,0 +1,9 @@
GET UNIQUE name AS "Name", age, country, children # * can be used to get all columns; UNIQUE is optional
IN test_table
FOR ([age == 20] OR [year <= 1998]) AND # FOR conditions should support all regular comparison operators (==, !=, <, <=, >, >=) when applicable
([name == "Alberto"] OR [name MATCHES "regex"]) AND
[country IN {"Spain", "Italy", "Germany"}] AND
NOT [children BETWEEN 2,4 INCL] # Possible values: INCL (default, implicit), EXCL, INCL_L, INCL_R
CROSS test_table_2 MATCH # Possible values: MATCH (default, implicit), LEFT, RIGHT, FULL
IF test_table.id == test_table_2.user_id # Debating if this should support only equality, or more complex conditions, maybe even matching FOR conditions
ORDER age, year DESC; # Possible values: ASC (default, implicit), DESC

17
other/test.txt Normal file
View file

@ -0,0 +1,17 @@
enum class eTokenType {
Keyword, // GET, IN, FOR, CROSS, IF, ORDER, UNIQUE, AS, OR, AND, NOT,
// IN, MATCHES, BETWEEN, INCL, EXCL, INCL_L, INCL_R,
// MATCH, LEFT, RIGHT, FULL, ASC, DESC, NULL
Identifier, // name, age, test_table.id
StringLit, // "Alberto"
NumberLit, // 20, 1998
Operator, // == != < <= > >=
Symbol, // ( ) [ ] { } , . * ;
EndOfInput
};
struct Token {
eTokenType type;
String value; // raw text
u32 line, col; // for error reporting — add from day one, you'll regret skipping it
};

View file

@ -0,0 +1,28 @@
/*
OmniaFramework - A collection of useful functionality
Copyright (C) 2026 OmniaX-Dev
This file is part of OmniaFramework.
OmniaFramework is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OmniaFramework is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OmniaFramework. If not, see <https://www.gnu.org/licenses/>.
*/
#include "Lexer.hpp"
namespace ostd
{
namespace db
{
}
}

View file

@ -0,0 +1,30 @@
/*
OmniaFramework - A collection of useful functionality
Copyright (C) 2026 OmniaX-Dev
This file is part of OmniaFramework.
OmniaFramework is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OmniaFramework is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OmniaFramework. If not, see <https://www.gnu.org/licenses/>.
*/
#pragma once
#include <ostd/string/String.hpp>
namespace ostd
{
namespace db
{
}
}