-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #259 from hypercerts-org/feat/separate_metadata_im…
…age_fetching Separate metadata image fetching from metadata query
- Loading branch information
Showing
10 changed files
with
102 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { singleton } from "tsyringe"; | ||
import { kyselyCaching } from "../client/kysely.js"; | ||
import { CachingDatabase } from "../types/kyselySupabaseCaching.js"; | ||
import { BaseSupabaseService } from "./BaseSupabaseService.js"; | ||
|
||
@singleton() | ||
export class MetadataImageService extends BaseSupabaseService<CachingDatabase> { | ||
constructor() { | ||
super(kyselyCaching); | ||
} | ||
|
||
// TODO: remove these when we more refactor the services to improve typing and performance | ||
getDataQuery() { | ||
throw new Error("Method not implemented - not needed for image service"); | ||
} | ||
|
||
getCountQuery() { | ||
throw new Error("Method not implemented - not needed for image service"); | ||
} | ||
|
||
async getImageByUri(uri: string): Promise<string | null> { | ||
const result = await this.db | ||
.selectFrom("metadata") | ||
.select(["image"]) | ||
.where("uri", "=", uri) | ||
.executeTakeFirst(); | ||
|
||
return result?.image ?? null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters