@@ -60,7 +60,7 @@ function getIpType(ipTypeStr: string | undefined) {
6060}
6161
6262// Function to create a database connection pool using IAM authentication
63- async function getIamConnection ( ) {
63+ async function createIamConnectionPool ( ) {
6464 const instanceConnectionName = process . env . INSTANCE_CONNECTION_NAME || '' ;
6565 // IAM service account email
6666 const dbUser = process . env . DB_IAM_USER || '' ;
@@ -104,7 +104,7 @@ async function getIamConnection() {
104104}
105105
106106// Function to create a database connection pool using password authentication
107- async function getPasswordConnection ( ) {
107+ async function createPasswordConnectionPool ( ) {
108108 const instanceConnectionName = process . env . INSTANCE_CONNECTION_NAME || '' ;
109109 // Database username
110110 const dbUser = process . env . DB_USER || '' ;
@@ -147,19 +147,19 @@ async function getPasswordConnection() {
147147}
148148
149149// Helper to get or create the password pool
150- async function getConnectionSettings ( ) {
150+ async function getPasswordConnectionPool ( ) {
151151 if ( ! passwordClient ) {
152- const { prisma, close} = await getPasswordConnection ( ) ;
152+ const { prisma, close} = await createPasswordConnectionPool ( ) ;
153153 passwordClient = prisma ;
154154 passwordCleanup = close ;
155155 }
156156 return passwordClient ;
157157}
158158
159159// Helper to get or create the IAM pool
160- async function getIamConnectionSettings ( ) {
160+ async function getIamConnectionPool ( ) {
161161 if ( ! iamClient ) {
162- const { prisma, close} = await getIamConnection ( ) ;
162+ const { prisma, close} = await createIamConnectionPool ( ) ;
163163 iamClient = prisma ;
164164 iamCleanup = close ;
165165 }
@@ -168,7 +168,7 @@ async function getIamConnectionSettings() {
168168
169169app . get ( '/' , async ( req , res ) => {
170170 try {
171- const prisma = await getConnectionSettings ( ) ;
171+ const prisma = await getPasswordConnectionPool ( ) ;
172172 const result = await prisma . $queryRaw `SELECT 1` ;
173173 const serialized = JSON . stringify ( result , ( key , value ) =>
174174 typeof value === 'bigint' ? value . toString ( ) : value
@@ -190,7 +190,7 @@ app.get('/', async (req, res) => {
190190
191191app . get ( '/iam' , async ( req , res ) => {
192192 try {
193- const prisma = await getIamConnectionSettings ( ) ;
193+ const prisma = await getIamConnectionPool ( ) ;
194194 const result = await prisma . $queryRaw `SELECT 1` ;
195195 const serialized = JSON . stringify ( result , ( key , value ) =>
196196 typeof value === 'bigint' ? value . toString ( ) : value
0 commit comments