You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CREATE TABLE "User" ("id" SERIAL NOT NULL,"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,"email" TEXT NOT NULL,"name" TEXT,CONSTRAINT "User_pkey" PRIMARY KEY ("id"));
29
+
`;
30
+
31
+
awaitsql`
32
+
INSERT INTO "User" ("email", "name") VALUES ('Foo', 'bar@baz.com');
33
+
`;
34
+
35
+
awaitsql`
36
+
UPDATE "User" SET "name" = 'Foo' WHERE "email" = 'bar@baz.com';
37
+
`;
38
+
39
+
awaitsql`
40
+
SELECT * FROM "User" WHERE "email" = 'bar@baz.com';
41
+
`;
42
+
43
+
awaitsql`SELECT * from generate_series(1,1000) as x `.cursor(10,asyncrows=>{
44
+
awaitPromise.all(rows);
45
+
});
46
+
47
+
awaitsql`
48
+
DROP TABLE "User";
49
+
`;
50
+
51
+
// This will be captured as an error as the table no longer exists
52
+
awaitsql`
53
+
SELECT * FROM "User" WHERE "email" = 'foo@baz.com';
CREATE TABLE "User" ("id" SERIAL NOT NULL,"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,"email" TEXT NOT NULL,"name" TEXT,CONSTRAINT "User_pkey" PRIMARY KEY ("id"));
19
+
`;
20
+
21
+
awaitsql`
22
+
INSERT INTO "User" ("email", "name") VALUES ('Foo', 'bar@baz.com');
23
+
`;
24
+
25
+
awaitsql`
26
+
UPDATE "User" SET "name" = 'Foo' WHERE "email" = 'bar@baz.com';
27
+
`;
28
+
29
+
awaitsql`
30
+
SELECT * FROM "User" WHERE "email" = 'bar@baz.com';
31
+
`;
32
+
33
+
awaitsql`SELECT * from generate_series(1,1000) as x `.cursor(10,asyncrows=>{
34
+
awaitPromise.all(rows);
35
+
});
36
+
37
+
awaitsql`
38
+
DROP TABLE "User";
39
+
`;
40
+
41
+
// This will be captured as an error as the table no longer exists
42
+
awaitsql`
43
+
SELECT * FROM "User" WHERE "email" = 'foo@baz.com';
"select b.oid, b.typarray from pg_catalog.pg_type a left join pg_catalog.pg_type b on b.oid = a.typelem where a.typcategory = 'A' group by b.oid, b.typarray order by b.oid",
217
+
'CREATE TABLE "User" ("id" SERIAL NOT NULL,"createdAt" TIMESTAMP(?) NOT NULL DEFAULT CURRENT_TIMESTAMP,"email" TEXT NOT NULL,"name" TEXT,CONSTRAINT "User_pkey" PRIMARY KEY ("id"))',
42
218
'sentry.op': 'db',
43
219
'sentry.origin': 'auto.db.otel.postgres',
44
220
'server.address': 'localhost',
45
221
'server.port': 5444,
46
222
}),
47
223
description:
48
-
"select b.oid, b.typarray from pg_catalog.pg_type a left join pg_catalog.pg_type b on b.oid = a.typelem where a.typcategory = 'A' group by b.oid, b.typarray order by b.oid",
224
+
'CREATE TABLE "User" ("id" SERIAL NOT NULL,"createdAt" TIMESTAMP(?) NOT NULL DEFAULT CURRENT_TIMESTAMP,"email" TEXT NOT NULL,"name" TEXT,CONSTRAINT "User_pkey" PRIMARY KEY ("id"))',
49
225
op: 'db',
50
226
status: 'ok',
51
227
origin: 'auto.db.otel.postgres',
@@ -203,7 +379,7 @@ describe('postgresjs auto instrumentation', () => {
203
379
frames: expect.arrayContaining([
204
380
expect.objectContaining({
205
381
function: 'handle',
206
-
module: 'postgres.cjs.src:connection',
382
+
module: 'postgres.src:connection',
207
383
filename: expect.any(String),
208
384
lineno: expect.any(Number),
209
385
colno: expect.any(Number),
@@ -215,7 +391,8 @@ describe('postgresjs auto instrumentation', () => {
0 commit comments