refactor(federation): 🔥 Remove some old SQL queries for Instances

This commit is contained in:
Jesse Wierzbinski 2024-06-29 21:08:03 -10:00
parent f2b0de779b
commit 38c8ea24a9
No known key found for this signature in database
2 changed files with 19 additions and 10 deletions

View file

@ -7,6 +7,7 @@ import {
type InferInsertModel,
type InferSelectModel,
type SQL,
count,
desc,
eq,
inArray,
@ -234,6 +235,10 @@ export class Instance extends BaseInterface<typeof Instances> {
name:
metadata.metadata.nodeName || metadata.metadata.title || "",
version: metadata.software.version,
description:
metadata.metadata.nodeDescription ||
metadata.metadata.description ||
"",
logo: undefined,
type: "ServerMetadata",
supported_extensions: [],
@ -275,4 +280,14 @@ export class Instance extends BaseInterface<typeof Instances> {
protocol: protocol,
});
}
static async getCount() {
return (
await db
.select({
count: count(),
})
.from(Instances)
)[0].count;
}
}