Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

feat(ui): list sqlite databases in dashboard, project and destination views

peaklabs-devf9d93eb7d4df
diff --git a/app/Livewire/Dashboard.php b/app/Livewire/Dashboard.php
index 05e1f2a485..31ac6cf8d7 100644
--- a/app/Livewire/Dashboard.php
+++ b/app/Livewire/Dashboard.php
@@ -33,6 +33,7 @@ class Dashboard extends Component
'mongodbs',
'mysqls',
'mariadbs',
+ 'sqlites',
])
->get();
}
diff --git a/app/Livewire/Destination/Resources.php b/app/Livewire/Destination/Resources.php
index c710104115..17d8ffab72 100644
--- a/app/Livewire/Destination/Resources.php
+++ b/app/Livewire/Destination/Resources.php
@@ -14,6 +14,7 @@ use App\Models\StandaloneMongodb;
use App\Models\StandaloneMysql;
use App\Models\StandalonePostgresql;
use App\Models\StandaloneRedis;
+use App\Models\StandaloneSqlite;
use Illuminate\Contracts\View\View;
use Livewire\Attributes\Locked;
use Livewire\Component;
@@ -61,11 +62,12 @@ class Resources extends Component
$this->destination->keydbs,
$this->destination->dragonflies,
$this->destination->clickhouses,
+ $this->destination->sqlites,
]);
}
/**
- * @param array<int, iterable<Application|Service|StandalonePostgresql|StandaloneRedis|StandaloneMongodb|StandaloneMysql|StandaloneMariadb|StandaloneKeydb|StandaloneDragonfly|StandaloneClickhouse>> $groups
+ * @param array<int, iterable<Application|Service|StandalonePostgresql|StandaloneRedis|StandaloneMongodb|StandaloneMysql|StandaloneMariadb|StandaloneKeydb|StandaloneDragonfly|StandaloneClickhouse|StandaloneSqlite>> $groups
* @return array<int, array{uuid:string,type:string,name:string,project:string|null,environment:string|null,url:string|null,search:string}>
*/
protected function collectResources(array $groups): array
@@ -81,7 +83,7 @@ class Resources extends Component
}
/**
- * @param Application|Service|StandalonePostgresql|StandaloneRedis|StandaloneMongodb|StandaloneMysql|StandaloneMariadb|StandaloneKeydb|StandaloneDragonfly|StandaloneClickhouse $resource
+ * @param Application|Service|StandalonePostgresql|StandaloneRedis|StandaloneMongodb|StandaloneMysql|StandaloneMariadb|StandaloneKeydb|StandaloneDragonfly|StandaloneClickhouse|StandaloneSqlite $resource
* @return array{uuid:string,type:string,name:string,project:string|null,environment:string|null,url:string|null,search:string}
*/
protected function resourceRow(BaseModel $resource): array
diff --git a/app/Livewire/Project/Index.php b/app/Livewire/Project/Index.php
index b1f00b147d..038d8dea33 100644
--- a/app/Livewire/Project/Index.php
+++ b/app/Livewire/Project/Index.php
@@ -27,6 +27,7 @@ class Index extends Component
'mongodbs',
'mysqls',
'mariadbs',
+ 'sqlites',
])
->get();
}
@@ -47,6 +48,7 @@ class Index extends Component
$project->mongodbs_count,
$project->mysqls_count,
$project->mariadbs_count,
+ $project->sqlites_count,
])->sum();
return [
diff --git a/app/Livewire/Project/Resource/Index.php b/app/Livewire/Project/Resource/Index.php
index 7c375d0e03..dca586fc0c 100644
--- a/app/Livewire/Project/Resource/Index.php
+++ b/app/Livewire/Project/Resource/Index.php
@@ -37,11 +37,13 @@ class Index extends Component
protected Collection $clickhouses;
+ protected Collection $sqlites;
+
protected Collection $services;
public function mount(): void
{
- $this->applications = $this->postgresqls = $this->redis = $this->mongodbs = $this->mysqls = $this->mariadbs = $this->keydbs = $this->dragonflies = $this->clickhouses = $this->services = collect();
+ $this->applications = $this->postgresqls = $this->redis = $this->mongodbs = $this->mysqls = $this->mariadbs = $this->keydbs = $this->dragonflies = $this->clickhouses = $this->sqlites = $this->services = collect();
$this->parameters = get_route_parameters();
$project = currentTeam()
->projects()
@@ -68,6 +70,7 @@ class Index extends Component
'keydbs:id,uuid,name,environment_id',
'dragonflies:id,uuid,name,environment_id',
'clickhouses:id,uuid,name,environment_id',
+ 'sqlites:id,uuid,name,environment_id',
];
$this->allEnvironments = $project->environments()
@@ -85,6 +88,7 @@ class Index extends Component
'clickhouses',
'mariadbs',
'mongodbs',
+ 'sqlites',
'services',
]);
@@ -117,6 +121,7 @@ class Index extends Component
'keydbs' => 'keydbs',
'dragonflies' => 'dragonflies',
'clickhouses' => 'clickhouses',
+ 'sqlites' => 'sqlites',
];
foreach ($databaseTypes as $property => $relation) {
@@ -163,6 +168,7 @@ class Index extends Component
'keydbs' => $this->keydbs,
'dragonflies' => $this->dragonflies,
'clickhouses' => $this->clickhouses,
+ 'sqlites' => $this->sqlites,
'services' => $this->services,
'applicationsJs' => $this->toSearchableArray($this->applications, 'application', 'Application'),
'postgresqlsJs' => $this->toSearchableArray($this->postgresqls, 'database', 'Database'),
@@ -173,6 +179,7 @@ class Index extends Component
'keydbsJs' => $this->toSearchableArray($this->keydbs, 'database', 'Database'),
'dragonfliesJs' => $this->toSearchableArray($this->dragonflies, 'database', 'Database'),
'clickhousesJs' => $this->toSearchableArray($this->clickhouses, 'database', 'Database'),
+ 'sqlitesJs' => $this->toSearchableArray($this->sqlites, 'database', 'Database'),
'servicesJs' => $this->toSearchableArray($this->services, 'service', 'Service'),
]);
}
diff --git a/app/Livewire/Project/Show.php b/app/Livewire/Project/Show.php
index 71b238e21c..0481a3f4d5 100644
--- a/app/Livewire/Project/Show.php
+++ b/app/Livewire/Project/Show.php
@@ -50,6 +50,7 @@ class Show extends Component
'mongodbs',
'mysqls',
'mariadbs',
+ 'sqlites',
])
->orderBy('created_at'),
])
@@ -105,6 +106,7 @@ class Show extends Component
$environment->mongodbs_count,
$environment->mysqls_count,
$environment->mariadbs_count,
+ $environment->sqlites_count,
])->sum();
return [
diff --git a/resources/views/components/resources/breadcrumbs.blade.php b/resources/views/components/resources/breadcrumbs.blade.php
index 95e9cbf538..52724002f1 100644
--- a/resources/views/components/resources/breadcrumbs.blade.php
+++ b/resources/views/components/resources/breadcrumbs.blade.php
@@ -24,6 +24,7 @@
'keydbs:id,uuid,name,environment_id',
'dragonflies:id,uuid,name,environment_id',
'clickhouses:id,uuid,name,environment_id',
+ 'sqlites:id,uuid,name,environment_id',
])
->get();
$currentProjectUuid = data_get($resource, 'environment.project.uuid');
@@ -141,7 +142,8 @@
->merge($environment->mariadbs ?? collect())
->merge($environment->keydbs ?? collect())
->merge($environment->dragonflies ?? collect())
- ->merge($environment->clickhouses ?? collect());
+ ->merge($environment->clickhouses ?? collect())
+ ->merge($environment->sqlites ?? collect());
$envResources = collect()
->merge($environment->applications->map(fn($app) => ['type' => 'application', 'resource' => $app]))
->merge($envDatabases->map(fn($db) => ['type' => 'database', 'resource' => $db]))
@@ -191,7 +193,8 @@
->merge($environment->mariadbs ?? collect())
->merge($environment->keydbs ?? collect())
->merge($environment->dragonflies ?? collect())
- ->merge($environment->clickhouses ?? collect());
+ ->merge($environment->clickhouses ?? collect())
+ ->merge($environment->sqlites ?? collect());
$envResources = collect()
->merge($environment->applications->map(fn($app) => ['type' => 'application', 'resource' => $app]))
->merge($envDatabases->map(fn($db) => ['type' => 'database', 'resource' => $db]))
diff --git a/resources/views/livewire/dashboard.blade.php b/resources/views/livewire/dashboard.blade.php
index 91c74cfba5..102d097be5 100644
--- a/resources/views/livewire/dashboard.blade.php
+++ b/resources/views/livewire/dashboard.blade.php
@@ -45,6 +45,7 @@
$project->mongodbs_count,
$project->mysqls_count,
$project->mariadbs_count,
+ $project->sqlites_count,
])->sum();
@endphp
diff --git a/resources/views/livewire/project/resource/index.blade.php b/resources/views/livewire/project/resource/index.blade.php
index f270e45217..d30ecfaa5f 100644
--- a/resources/views/livewire/project/resource/index.blade.php
+++ b/resources/views/livewire/project/resource/index.blade.php
@@ -368,6 +368,7 @@
...@js($keydbsJs),
...@js($dragonfliesJs),
...@js($clickhousesJs),
+ ...@js($sqlitesJs),
...@js($servicesJs),
],
get filterGroups() {