Mr Flibble
unread,Jan 24, 2021, 11:50:42 AM1/24/21You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Hi!
Making a C++ RDBMS, "neodb", that will be used by neoGFX:
// todo: use gtest
#include <neodb/file_database.hpp>
#include <neodb/memory_database.hpp>
using namespace neodb;
void test_file_database()
{
file_database database{ "/tmp/accounts.db" };
create_table<primary_key<string>>(
database,
"Companies"_s,
"Company Name"_s);
typedef int32_t currency;
create_table<primary_key<int32_t>, foreign_key<string>, currency>(
database,
"Invoices"_s,
"Invoice Number"_s,
as_foreign_key<string>{ "Company Name"_s, "Companies"_s, "Company Name"_s },
"Total"_s );
}
void test_memory_database()
{
memory_database database{ "Players"_s };
typedef int64_t score;
create_table<primary_key<string>, score>(
database,
"High Scores"_s,
"Player Name"_s,
"Score"_s);
}
Message ends.
/Flibble
--
😎