mirror of
https://github.com/aljazceru/ditto.git
synced 2025-12-27 02:04:26 +01:00
Simplify
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { type Filter, type Insertable, type SelectQueryBuilder } from '@/deps.ts';
|
||||
import { type Filter, type Insertable } from '@/deps.ts';
|
||||
import { type SignedEvent } from '@/event.ts';
|
||||
|
||||
import { db, type DittoDB, type EventRow, type TagRow } from '@/db.ts';
|
||||
import { db, type TagRow } from '@/db.ts';
|
||||
|
||||
function insertEvent(event: SignedEvent): Promise<void> {
|
||||
return db.transaction().execute(async (trx) => {
|
||||
@@ -34,7 +34,7 @@ function insertEvent(event: SignedEvent): Promise<void> {
|
||||
});
|
||||
}
|
||||
|
||||
function getFilterQuery(filter: Filter): SelectQueryBuilder<DittoDB, 'events', EventRow> {
|
||||
function getFilterQuery(filter: Filter) {
|
||||
let query = db.selectFrom('events').selectAll().orderBy('created_at', 'desc');
|
||||
|
||||
for (const key of Object.keys(filter)) {
|
||||
|
||||
@@ -56,7 +56,6 @@ export {
|
||||
Kysely,
|
||||
Migrator,
|
||||
type NullableInsertKeys,
|
||||
type SelectQueryBuilder,
|
||||
sql,
|
||||
} from 'npm:kysely@^0.25.0';
|
||||
export { DenoSqliteDialect } from 'https://gitlab.com/soapbox-pub/kysely-deno-sqlite/-/raw/76748303a45fac64a889cd2b9265c6c9b8ef2e8b/mod.ts';
|
||||
|
||||
Reference in New Issue
Block a user