@@ -93,19 +93,37 @@ export class SupabaseCachingService extends BaseSupabaseService<CachingDatabase>
9393 case "attestations" :
9494 return this . db
9595 . selectFrom ( "attestations" )
96- . selectAll ( "attestations" )
96+ . innerJoin (
97+ "supported_schemas" ,
98+ "supported_schemas.id" ,
99+ "attestations.supported_schemas_id" ,
100+ )
101+ . select ( [
102+ "attestations.id" ,
103+ "attestations.uid" ,
104+ "attestations.chain_id" ,
105+ "attestations.contract_address" ,
106+ "attestations.token_id" ,
107+ "attestations.claims_id" ,
108+ "attestations.recipient" ,
109+ "attestations.attester" ,
110+ "attestations.attestation" ,
111+ "attestations.data" ,
112+ "attestations.creation_block_timestamp" ,
113+ "attestations.creation_block_number" ,
114+ "attestations.last_update_block_number" ,
115+ "attestations.last_update_block_timestamp" ,
116+ "supported_schemas.uid as schema_uid" ,
117+ ] )
97118 . $if ( args . where ?. hypercerts , ( qb ) =>
98- qb . innerJoin ( "claims" , "claims.id" , "attestations.claims_id" ) ,
119+ qb . innerJoin (
120+ "claims as claims" ,
121+ "claims.id" ,
122+ "attestations.claims_id" ,
123+ ) ,
99124 )
100125 . $if ( args . where ?. metadata , ( qb ) =>
101126 qb . innerJoin ( "metadata" , "metadata.uri" , "claims.uri" ) ,
102- )
103- . $if ( args . where ?. eas_schema , ( qb ) =>
104- qb . innerJoin (
105- "supported_schemas" ,
106- "supported_schemas.id" ,
107- "attestations.supported_schemas_id" ,
108- ) ,
109127 ) ;
110128 case "eas_schema" :
111129 case "supported_schemas" :
0 commit comments