Import SQLite3 wrapper implementation from old repo

This commit is contained in:
Viktor Soukup 2025-05-17 01:25:25 +02:00
parent 6b493dcfda
commit 7744ac69f4
5 changed files with 826 additions and 0 deletions

35
Tests/SQLite/Main.cpp Normal file
View file

@ -0,0 +1,35 @@
#include <Garbage/SQLite.hpp>
using namespace Garbage::SQLite;
struct User
{
std::int64_t Id;
std::string Username;
std::string Email;
std::string PasswordHash;
};
Database db(
"UserDb",
Table(
"Users",
Column(&User::Id, "Id", ColumnFlags::PrimaryKey),
Column(&User::Username, "Username", ColumnFlags::Unique),
Column(&User::Email, "Email", ColumnFlags::Unique),
Column(&User::PasswordHash, "PasswordHash")
)
);
int main() {
User u {
.Id = 25,
.Username = "noob",
.Email = "noob@noob.io",
.PasswordHash = "ASDASDASDASDASDA",
};
Connection c(db, "Test.db");
c.Create();
c.Insert(u);
}