1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:38:10 +00:00

LibSQL: Create databases in writable directory

This commit is contained in:
coderdreams 2021-06-22 10:03:59 -03:00 committed by Ali Mohammad Pur
parent 6bc7f2204e
commit 49340f98f7
3 changed files with 30 additions and 30 deletions

View file

@ -143,9 +143,9 @@ NonnullRefPtr<SQL::BTree> setup_btree(SQL::Heap& heap)
void insert_and_get_to_and_from_btree(int num_keys)
{
ScopeGuard guard([]() { unlink("test.db"); });
ScopeGuard guard([]() { unlink("/tmp/test.db"); });
{
auto heap = SQL::Heap::construct("test.db");
auto heap = SQL::Heap::construct("/tmp/test.db");
auto btree = setup_btree(heap);
for (auto ix = 0; ix < num_keys; ix++) {
@ -160,7 +160,7 @@ void insert_and_get_to_and_from_btree(int num_keys)
}
{
auto heap = SQL::Heap::construct("test.db");
auto heap = SQL::Heap::construct("/tmp/test.db");
auto btree = setup_btree(heap);
for (auto ix = 0; ix < num_keys; ix++) {
@ -175,9 +175,9 @@ void insert_and_get_to_and_from_btree(int num_keys)
void insert_into_and_scan_btree(int num_keys)
{
ScopeGuard guard([]() { unlink("test.db"); });
ScopeGuard guard([]() { unlink("/tmp/test.db"); });
{
auto heap = SQL::Heap::construct("test.db");
auto heap = SQL::Heap::construct("/tmp/test.db");
auto btree = setup_btree(heap);
for (auto ix = 0; ix < num_keys; ix++) {
@ -192,7 +192,7 @@ void insert_into_and_scan_btree(int num_keys)
}
{
auto heap = SQL::Heap::construct("test.db");
auto heap = SQL::Heap::construct("/tmp/test.db");
auto btree = setup_btree(heap);
int count = 0;