MCPcopy Create free account
hub / github.com/cameri/nostream / findByPubkey

Method findByPubkey

src/repositories/user-repository.ts:16–25  ·  view source on GitHub ↗
(pubkey: Pubkey, client: DatabaseClient = this.dbClient)

Source from the content-addressed store, hash-verified

14 ) {}
15
16 public async findByPubkey(pubkey: Pubkey, client: DatabaseClient = this.dbClient): Promise<User | undefined> {
17 logger('find by pubkey: %s', pubkey)
18 const [dbuser] = await client<DBUser>('users').where('pubkey', toBuffer(pubkey)).select()
19
20 if (!dbuser) {
21 return
22 }
23
24 return fromDBUser(dbuser)
25 }
26
27 public async upsert(user: Partial<User>, client: DatabaseClient = this.dbClient): Promise<number> {
28 logger('upsert: %o', user)

Callers 1

isVanishedMethod · 0.95

Calls 1

toBufferFunction · 0.90

Tested by

no test coverage detected