mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 10:01:13 +09:00
LibSQL: Create databases in writable directory
This commit is contained in:
parent
6bc7f2204e
commit
49340f98f7
Notes:
sideshowbarker
2024-07-18 11:39:56 +09:00
Author: https://github.com/Coderdreams
Commit: 49340f98f7
Pull-request: https://github.com/SerenityOS/serenity/pull/7435
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/linusg
3 changed files with 30 additions and 30 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue