MCPcopy Create free account
hub / github.com/bcspragu/logseq-sync / AddGraphSalt

Method AddGraphSalt

db/sqlite/sqlite.go:119–130  ·  view source on GitHub ↗
(ctx context.Context, gID db.GraphID, salt *db.GraphSalt)

Source from the content-addressed store, hash-verified

117}
118
119func (d *DB) AddGraphSalt(ctx context.Context, gID db.GraphID, salt *db.GraphSalt) error {
120 id := uuid.NewString()
121 if err := d.q.AddGraphSalt(ctx, sqlitedb.AddGraphSaltParams{
122 ID: id,
123 GraphID: string(gID),
124 Value: salt.Value,
125 ExpiresAt: salt.ExpiredAt,
126 }); err != nil {
127 return fmt.Errorf("failed to add graph salt: %w", err)
128 }
129 return nil
130}
131
132func (d *DB) GraphSalts(ctx context.Context, id db.GraphID) ([]*db.GraphSalt, error) {
133 gss, err := d.q.GraphSalts(ctx, string(id))

Callers

nothing calls this directly

Implementers 2

DBdb/mem/mem.go
DBdb/sqlite/sqlite.go

Calls 1

AddGraphSaltMethod · 0.65

Tested by

no test coverage detected