MCPcopy Create free account
hub / github.com/daodst/chat / NewPostgresQueueJSONTable

Function NewPostgresQueueJSONTable

federationapi/storage/postgres/queue_json_table.go:60–78  ·  view source on GitHub ↗
(db *sql.DB)

Source from the content-addressed store, hash-verified

58}
59
60func NewPostgresQueueJSONTable(db *sql.DB) (s *queueJSONStatements, err error) {
61 s = &queueJSONStatements{
62 db: db,
63 }
64 _, err = s.db.Exec(queueJSONSchema)
65 if err != nil {
66 return
67 }
68 if s.insertJSONStmt, err = s.db.Prepare(insertJSONSQL); err != nil {
69 return
70 }
71 if s.deleteJSONStmt, err = s.db.Prepare(deleteJSONSQL); err != nil {
72 return
73 }
74 if s.selectJSONStmt, err = s.db.Prepare(selectJSONSQL); err != nil {
75 return
76 }
77 return
78}
79
80func (s *queueJSONStatements) InsertQueueJSON(
81 ctx context.Context, txn *sql.Tx, json string,

Callers 1

NewDatabaseFunction · 0.85

Calls 1

PrepareMethod · 0.65

Tested by

no test coverage detected