MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / truncateAll

Function truncateAll

internal/testutil/db.go:105–121  ·  view source on GitHub ↗
(ctx context.Context, pool *pgxpool.Pool)

Source from the content-addressed store, hash-verified

103}
104
105func truncateAll(ctx context.Context, pool *pgxpool.Pool) error {
106 _, err := pool.Exec(ctx, `
107 TRUNCATE oauth_pkce_requests, oauth_refresh_tokens, oauth_access_tokens,
108 oauth_auth_codes, oauth_clients,
109 usage_summaries, usage_events, webhook_deliveries,
110 send_attempts, protection_events, messages,
111 idempotency_keys, api_keys,
112 agent_identities, domains,
113 user_sessions, users CASCADE
114 `)
115 if err != nil {
116 return err
117 }
118 // Re-seed shared domain (migration seeds it but truncation removes it)
119 pool.Exec(ctx, `INSERT INTO domains (domain, user_id, verified, verified_at) VALUES ('agents.e2a.dev', NULL, true, now()) ON CONFLICT DO NOTHING`)
120 return nil
121}
122
123func projectRoot() string {
124 _, filename, _, _ := runtime.Caller(0)

Callers 3

OpenPreparedTestDBFunction · 0.85
TruncateAllFunction · 0.85
CloseMethod · 0.85

Calls 1

ExecMethod · 0.65

Tested by

no test coverage detected