mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
refactor(federation): 🔥 Remove some old SQL queries for Instances
This commit is contained in:
parent
f2b0de779b
commit
38c8ea24a9
2 changed files with 19 additions and 10 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue