MCPcopy Create free account
hub / github.com/dataddo/pgq / ensureUUIDExtension

Function ensureUUIDExtension

validator_test.go:170–181  ·  view source on GitHub ↗
(t *testing.T, db *sqlx.DB)

Source from the content-addressed store, hash-verified

168}
169
170func ensureUUIDExtension(t *testing.T, db *sqlx.DB) {
171 _, err := db.Exec(`
172 DO $$
173 BEGIN
174 IF current_setting('server_version_num')::int < 130000 THEN
175 -- If PostgreSQL version is less than 13, enable pgcrypto
176 CREATE EXTENSION IF NOT EXISTS pgcrypto;
177 END IF;
178 END $$;
179 `)
180 require.NoError(t, err)
181}
182
183func generateRandomString(length int) string {
184 b := make([]byte, length)

Callers 1

openDBFunction · 0.70

Calls 1

NoErrorFunction · 0.92

Tested by

no test coverage detected