From 8ba6acb82f92c03f9d516aeab55dcade1dad954d Mon Sep 17 00:00:00 2001 From: David Vargas Date: Mon, 29 Dec 2025 16:21:10 -0500 Subject: [PATCH] cxn end and lambda bumps --- api/roamjsauth/get.ts | 2 +- api/roamjsauth/post.ts | 2 +- api/roamjsauth/put.ts | 2 +- data/main.ts | 2 +- patches/drizzle-orm+0.45.1.patch | 40 ++++++++++++++++++++++++++++++++ 5 files changed, 44 insertions(+), 4 deletions(-) diff --git a/api/roamjsauth/get.ts b/api/roamjsauth/get.ts index afcd837a..79865523 100644 --- a/api/roamjsauth/get.ts +++ b/api/roamjsauth/get.ts @@ -20,7 +20,7 @@ const logic = async ({ .from(oauthClients) .innerJoin(apps, eq(apps.id, oauthClients.appId)) .where(and(eq(oauthClients.id, otp), eq(apps.code, service))); - // await cxn.end(); + await cxn.end(); return { success: !!oauth }; }; diff --git a/api/roamjsauth/post.ts b/api/roamjsauth/post.ts index 832b60f3..42908671 100644 --- a/api/roamjsauth/post.ts +++ b/api/roamjsauth/post.ts @@ -20,7 +20,7 @@ const logic = async ({ .from(oauthClients) .innerJoin(apps, eq(apps.id, oauthClients.appId)) .where(and(eq(oauthClients.id, otp), eq(apps.code, service))); - // await cxn.end(); + await cxn.end(); if (!oauth) return { code: 204 }; return { auth: oauth.secret }; }; diff --git a/api/roamjsauth/put.ts b/api/roamjsauth/put.ts index 2a3ad8bf..2a427ab0 100644 --- a/api/roamjsauth/put.ts +++ b/api/roamjsauth/put.ts @@ -28,7 +28,7 @@ const logic = async ({ id: otp, }) .onConflictDoUpdate({ target: oauthClients.id, set: { secret: auth } }); - // await cxn.end(); + await cxn.end(); return { success: true }; }; diff --git a/data/main.ts b/data/main.ts index b30fe404..05460477 100644 --- a/data/main.ts +++ b/data/main.ts @@ -1128,7 +1128,7 @@ resource "aws_s3_bucket_policy" "bucket_policy" { role: (lambdaRoleMapping[lambdaPath] ?? lambdaRole).arn, handler: `${functionNames[lambdaPath]}.handler`, filename: dummyFile.outputPath, - runtime: "nodejs18.x", + runtime: "roamjs" in functionNames[lambdaPath] ? "nodejs20.x" : "nodejs18.x", publish: false, timeout: lambdaTimeouts[lambdaPath] ?? 60, memorySize: 5120, diff --git a/patches/drizzle-orm+0.45.1.patch b/patches/drizzle-orm+0.45.1.patch index c7bf27cc..45562663 100644 --- a/patches/drizzle-orm+0.45.1.patch +++ b/patches/drizzle-orm+0.45.1.patch @@ -10,3 +10,43 @@ index 15564ce..5578429 100644 } export type MySQLWithReplicas = Q & { $primary: Q; +diff --git a/node_modules/drizzle-orm/mysql-core/db.js b/node_modules/drizzle-orm/mysql-core/db.js +index cdb0cd1..35e3c6f 100644 +--- a/node_modules/drizzle-orm/mysql-core/db.js ++++ b/node_modules/drizzle-orm/mysql-core/db.js +@@ -227,6 +227,9 @@ class MySqlDatabase { + execute(query) { + return this.session.execute(typeof query === "string" ? sql.raw(query) : query.getSQL()); + } ++ async end() { ++ return await this.session.end(); ++ } + transaction(transaction, config) { + return this.session.transaction(transaction, config); + } +diff --git a/node_modules/drizzle-orm/pg-core/db.d.ts b/node_modules/drizzle-orm/pg-core/db.d.ts +index 202f79f..016af70 100644 +--- a/node_modules/drizzle-orm/pg-core/db.d.ts ++++ b/node_modules/drizzle-orm/pg-core/db.d.ts +@@ -279,6 +279,7 @@ export declare class PgDatabase = Record>(query: SQLWrapper | string): PgRaw>; + transaction(transaction: (tx: PgTransaction) => Promise, config?: PgTransactionConfig): Promise; ++ end(): Promise; + } + export type PgWithReplicas = Q & { + $primary: Q; +diff --git a/node_modules/drizzle-orm/pg-core/db.js b/node_modules/drizzle-orm/pg-core/db.js +index a0f5337..850c508 100644 +--- a/node_modules/drizzle-orm/pg-core/db.js ++++ b/node_modules/drizzle-orm/pg-core/db.js +@@ -269,6 +269,9 @@ class PgDatabase { + refreshMaterializedView(view) { + return new PgRefreshMaterializedView(view, this.session, this.dialect); + } ++ async end() { ++ return await this.session.end(); ++ } + authToken; + execute(query) { + const sequel = typeof query === "string" ? sql.raw(query) : query.getSQL();