feat(ui): add sqlite to the new resource selection

This commit is contained in:
peaklabs-dev
2026-09-24 19:03:43 +02:00
parent 387f2b3607
commit b112927000
7 changed files with 59 additions and 4 deletions
+34 -1
View File
@@ -15,6 +15,7 @@ use App\Models\StandaloneMongodb;
use App\Models\StandaloneMysql;
use App\Models\StandalonePostgresql;
use App\Models\StandaloneRedis;
use App\Models\StandaloneSqlite;
use Illuminate\Support\Facades\Cache;
use Livewire\Component;
@@ -199,6 +200,7 @@ class GlobalSearch extends Component
'new redis' => 'redis',
'new keydb' => 'keydb',
'new dragonfly' => 'dragonfly',
'new sqlite' => 'sqlite',
'new mongodb' => 'mongodb',
'new mongo' => 'mongodb',
'new clickhouse' => 'clickhouse',
@@ -237,7 +239,7 @@ class GlobalSearch extends Component
'dockerfile', 'docker-compose-empty', 'docker-image',
// Databases
'postgresql', 'mysql', 'mariadb', 'redis', 'keydb',
'dragonfly', 'mongodb', 'clickhouse',
'dragonfly', 'mongodb', 'clickhouse', 'sqlite',
]) || str_starts_with($type, 'one-click-service-')) {
return $user->can('createAnyResource');
}
@@ -513,6 +515,27 @@ class GlobalSearch extends Component
})
);
// SQLite
$databases = $databases->merge(
StandaloneSqlite::ownedByCurrentTeam()
->with(['environment.project'])
->get()
->map(function ($db) {
return [
'id' => $db->id,
'name' => $db->name,
'type' => 'database',
'subtype' => 'sqlite',
'uuid' => $db->uuid,
'description' => $db->description,
'link' => $db->link(),
'project' => $db->environment->project->name ?? null,
'environment' => $db->environment->name ?? null,
'search_text' => strtolower($db->name.' '.$db->uuid.' sqlite '.$db->description.' database databases db'),
];
})
);
// Get all servers
$servers = Server::ownedByCurrentTeam()
->get()
@@ -1124,6 +1147,16 @@ class GlobalSearch extends Component
'logo' => 'svgs/clickhouse-icon.svg',
'resourceType' => 'database',
]);
$items->push([
'name' => 'SQLite',
'description' => 'Lightweight file-based relational database',
'quickcommand' => '(type: new sqlite)',
'type' => 'sqlite',
'category' => 'Databases',
'logo' => 'svgs/resources/sqlite.svg',
'resourceType' => 'database',
]);
}
// Merge with services
+8
View File
@@ -255,6 +255,13 @@ class Select extends Component
'description' => 'A column-oriented database for real-time analytics over large datasets.',
'logo' => asset('svgs/resources/clickhouse.svg'),
],
[
'id' => 'sqlite',
'name' => 'SQLite',
'description' => 'A lightweight relational database stored in a single file.',
'logo' => asset('svgs/resources/sqlite.svg'),
'experimental' => true,
],
];
@@ -369,6 +376,7 @@ class Select extends Component
case 'dragonfly':
case 'clickhouse':
case 'mongodb':
case 'sqlite':
$this->isDatabase = true;
$this->includeSwarm = false;
if ($this->allServers instanceof Collection) {
+2
View File
@@ -67,6 +67,8 @@ class Create extends Component
$database = create_standalone_dragonfly($environment->id, $destination);
} elseif ($type->value() === 'clickhouse') {
$database = create_standalone_clickhouse($environment->id, $destination);
} elseif ($type->value() === 'sqlite') {
$database = create_standalone_sqlite($environment->id, $destination);
}
return redirect()->route('project.database.configuration', [
+4
View File
@@ -0,0 +1,4 @@
<svg width="200" height="200" viewBox="0 0 200 200" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="200" height="200" rx="55.2101" fill="#0F80CC" fill-opacity="0.15"/>
<g transform="translate(100,100) scale(6.2) translate(-12,-12)"><path fill="#003B57" d="M21.678.521c-1.032-.92-2.28-.55-3.513.544a8.71 8.71 0 0 0-.547.535c-2.109 2.237-4.066 6.38-4.674 9.544.237.48.422 1.093.544 1.561a13.044 13.044 0 0 1 .164.703s-.019-.071-.096-.296l-.05-.146a1.689 1.689 0 0 0-.033-.08c-.138-.32-.518-.995-.686-1.289-.143.423-.27.818-.376 1.176.484.884.778 2.4.778 2.4s-.025-.099-.147-.442c-.107-.303-.644-1.244-.772-1.464-.217.804-.304 1.346-.226 1.478.152.256.296.698.422 1.186.286 1.1.485 2.44.485 2.44s.006.087.018.224a22.41 22.41 0 0 0 .056 2.748c.095 1.146.273 2.13.5 2.657l.155-.084c-.334-1.038-.47-2.399-.41-3.967.09-2.398.642-5.29 1.661-8.304 1.723-4.55 4.113-8.201 6.3-9.945-1.993 1.8-4.692 7.63-5.5 9.788-.904 2.416-1.545 4.684-1.931 6.857.666-2.037 2.821-2.912 2.821-2.912s1.057-1.304 2.292-3.166c-.74.169-1.955.458-2.362.629-.6.252-.762.338-.762.338s1.945-1.184 3.613-1.72C21.695 7.9 24.756 2.6 21.678.521z"/><path fill="#003B57" d="M2.7 1.3C1.4 1.3.4 2.3.4 3.6v14.9c0 1.3 1 2.3 2.3 2.3h9.2c-.1-.4-.2-2-.3-3.6-.1-1.1-.3-2.5-.6-3.6-.1-.5-.3-.9-.4-1.2-.1-.2 0-.8.2-1.6-1.1-2-2.7-3.6-4.3-4.6l-.1.1c1.3 1 2.7 2.6 3.7 4.5.1-.3.2-.7.4-1.1-1-1.7-2.5-3.2-4-4.2v.1c1.2.9 2.5 2.4 3.5 4.1.6-1.9 1.6-4 3-5.9.4-.5.8-1 1.2-1.4.2-.2.4-.4.7-.6H2.7z"/></g>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

@@ -205,7 +205,7 @@
'new private github', 'new private gh', 'new private deploy', 'new deploy key',
'new dockerfile', 'new docker compose', 'new compose', 'new docker image', 'new image',
'new postgresql', 'new postgres', 'new mysql', 'new mariadb',
'new redis', 'new keydb', 'new dragonfly', 'new mongodb', 'new mongo', 'new clickhouse'
'new redis', 'new keydb', 'new dragonfly', 'new mongodb', 'new mongo', 'new clickhouse', 'new sqlite'
];
if (exactMatchCommands.includes(trimmed)) {
const matchingItem = this.creatableItems.find(item => {
@@ -227,9 +227,12 @@
</span>
</template>
</div>
<div class="min-w-0 flex-1">
<div class="flex min-w-0 flex-1 items-center gap-2">
<h3 class="truncate text-[13px] font-semibold text-black dark:text-fg"
x-text="database.name"></h3>
<template x-if="database.experimental">
<x-status-badge status="Experimental" type="warning" class="shrink-0" />
</template>
</div>
</div>
@@ -415,6 +418,10 @@
clickhouse: {
docs: 'https://clickhouse.com/docs',
website: 'https://clickhouse.com/'
},
sqlite: {
docs: 'https://sqlite.org/docs.html',
website: 'https://sqlite.org/'
}
},
docLinkCache: {}, // Cache resolved doc URLs: { serviceName: url | null }
@@ -17,7 +17,8 @@
$resource->getMorphClass() == 'App\Models\StandaloneDragonfly' ||
$resource->getMorphClass() == 'App\Models\StandaloneClickhouse' ||
$resource->getMorphClass() == 'App\Models\StandaloneMongodb' ||
$resource->getMorphClass() == 'App\Models\StandaloneMysql')
$resource->getMorphClass() == 'App\Models\StandaloneMysql' ||
$resource->getMorphClass() == 'App\Models\StandaloneSqlite')
<x-application.settings-section id="storage-mounts-section" title="Persistent storage" :flush="true"
:helper="$resource instanceof \App\Models\Application && $resource->git_based()
? 'Preview deployment volumes can use a -pr-#PRNumber suffix so each pull request receives isolated storage.'