@@ -27,6 +27,13 @@ export const preparePostgresDB = async (
2727 credentials : PostgresCredentials ,
2828) : Promise <
2929 DB & {
30+ packageName :
31+ | '@aws-sdk/client-rds-data'
32+ | 'pglite'
33+ | 'pg'
34+ | 'postgres'
35+ | '@vercel/postgres'
36+ | '@neondatabase/serverless' ;
3037 proxy : Proxy ;
3138 transactionProxy : TransactionProxy ;
3239 migrate : ( config : string | MigrationConfig ) => Promise < void > ;
@@ -102,6 +109,7 @@ export const preparePostgresDB = async (
102109 } ;
103110
104111 return {
112+ packageName : '@aws-sdk/client-rds-data' ,
105113 query,
106114 proxy,
107115 transactionProxy,
@@ -162,7 +170,7 @@ export const preparePostgresDB = async (
162170 return results ;
163171 } ;
164172
165- return { query, proxy, transactionProxy, migrate : migrateFn } ;
173+ return { packageName : 'pglite' , query, proxy, transactionProxy, migrate : migrateFn } ;
166174 }
167175
168176 assertUnreachable ( driver ) ;
@@ -255,7 +263,7 @@ export const preparePostgresDB = async (
255263 return results ;
256264 } ;
257265
258- return { query, proxy, transactionProxy, migrate : migrateFn } ;
266+ return { packageName : 'pg' , query, proxy, transactionProxy, migrate : migrateFn } ;
259267 }
260268
261269 if ( await checkPackage ( 'postgres' ) ) {
@@ -313,7 +321,7 @@ export const preparePostgresDB = async (
313321 return results ;
314322 } ;
315323
316- return { query, proxy, transactionProxy, migrate : migrateFn } ;
324+ return { packageName : 'postgres' , query, proxy, transactionProxy, migrate : migrateFn } ;
317325 }
318326
319327 if ( await checkPackage ( '@vercel/postgres' ) ) {
@@ -411,7 +419,7 @@ export const preparePostgresDB = async (
411419 return results ;
412420 } ;
413421
414- return { query, proxy, transactionProxy, migrate : migrateFn } ;
422+ return { packageName : '@vercel/postgres' , query, proxy, transactionProxy, migrate : migrateFn } ;
415423 }
416424
417425 if ( await checkPackage ( '@neondatabase/serverless' ) ) {
@@ -511,7 +519,7 @@ export const preparePostgresDB = async (
511519 return results ;
512520 } ;
513521
514- return { query, proxy, transactionProxy, migrate : migrateFn } ;
522+ return { packageName : '@neondatabase/serverless' , query, proxy, transactionProxy, migrate : migrateFn } ;
515523 }
516524
517525 console . error (
@@ -524,6 +532,7 @@ export const prepareGelDB = async (
524532 credentials ?: GelCredentials ,
525533) : Promise <
526534 DB & {
535+ packageName : 'gel' ;
527536 proxy : Proxy ;
528537 transactionProxy : TransactionProxy ;
529538 }
@@ -593,7 +602,7 @@ To link your project, please refer https://docs.geldata.com/reference/cli/gel_in
593602 return result ;
594603 } ;
595604
596- return { query, proxy, transactionProxy } ;
605+ return { packageName : 'gel' , query, proxy, transactionProxy } ;
597606 }
598607
599608 console . error (
@@ -629,6 +638,7 @@ export const connectToSingleStore = async (
629638 it : SingleStoreCredentials ,
630639) : Promise < {
631640 db : DB ;
641+ packageName : 'mysql2' ;
632642 proxy : Proxy ;
633643 transactionProxy : TransactionProxy ;
634644 database : string ;
@@ -686,6 +696,7 @@ export const connectToSingleStore = async (
686696
687697 return {
688698 db : { query } ,
699+ packageName : 'mysql2' ,
689700 proxy,
690701 transactionProxy,
691702 database : result . database ,
@@ -694,7 +705,7 @@ export const connectToSingleStore = async (
694705 }
695706
696707 console . error (
697- "To connect to SingleStore database - please install 'singlestore ' driver" ,
708+ "To connect to SingleStore database - please install 'mysql2 ' driver" ,
698709 ) ;
699710 process . exit ( 1 ) ;
700711} ;
@@ -726,6 +737,7 @@ export const connectToMySQL = async (
726737 it : MysqlCredentials ,
727738) : Promise < {
728739 db : DB ;
740+ packageName : 'mysql2' | '@planetscale/database' ;
729741 proxy : Proxy ;
730742 transactionProxy : TransactionProxy ;
731743 database : string ;
@@ -795,6 +807,7 @@ export const connectToMySQL = async (
795807
796808 return {
797809 db : { query } ,
810+ packageName : 'mysql2' ,
798811 proxy,
799812 transactionProxy,
800813 database : result . database ,
@@ -846,6 +859,7 @@ export const connectToMySQL = async (
846859
847860 return {
848861 db : { query } ,
862+ packageName : '@planetscale/database' ,
849863 proxy,
850864 transactionProxy,
851865 database : result . database ,
@@ -905,7 +919,12 @@ export const connectToSQLite = async (
905919 credentials : SqliteCredentials ,
906920) : Promise <
907921 & SQLiteDB
908- & { migrate : ( config : MigrationConfig ) => Promise < void > ; proxy : Proxy ; transactionProxy : TransactionProxy }
922+ & {
923+ packageName : 'd1-http' | '@libsql/client' | 'better-sqlite3' ;
924+ migrate : ( config : MigrationConfig ) => Promise < void > ;
925+ proxy : Proxy ;
926+ transactionProxy : TransactionProxy ;
927+ }
909928> => {
910929 if ( 'driver' in credentials ) {
911930 const { driver } = credentials ;
@@ -1037,7 +1056,7 @@ export const connectToSQLite = async (
10371056 const result = await remoteBatchCallback ( queries ) ;
10381057 return result . rows ;
10391058 } ;
1040- return { ...db , proxy, transactionProxy, migrate : migrateFn } ;
1059+ return { ...db , packageName : 'd1-http' , proxy, transactionProxy, migrate : migrateFn } ;
10411060 } else {
10421061 assertUnreachable ( driver ) ;
10431062 }
@@ -1101,7 +1120,7 @@ export const connectToSQLite = async (
11011120 return results ;
11021121 } ;
11031122
1104- return { ...db , proxy, transactionProxy, migrate : migrateFn } ;
1123+ return { ...db , packageName : '@libsql/client' , proxy, transactionProxy, migrate : migrateFn } ;
11051124 }
11061125
11071126 if ( await checkPackage ( 'better-sqlite3' ) ) {
@@ -1170,7 +1189,7 @@ export const connectToSQLite = async (
11701189 return results ;
11711190 } ;
11721191
1173- return { ...db , proxy, transactionProxy, migrate : migrateFn } ;
1192+ return { ...db , packageName : 'better-sqlite3' , proxy, transactionProxy, migrate : migrateFn } ;
11741193 }
11751194
11761195 console . log (
@@ -1181,7 +1200,12 @@ export const connectToSQLite = async (
11811200
11821201export const connectToLibSQL = async ( credentials : LibSQLCredentials ) : Promise <
11831202 & LibSQLDB
1184- & { migrate : ( config : MigrationConfig ) => Promise < void > ; proxy : Proxy ; transactionProxy : TransactionProxy }
1203+ & {
1204+ packageName : '@libsql/client' ;
1205+ migrate : ( config : MigrationConfig ) => Promise < void > ;
1206+ proxy : Proxy ;
1207+ transactionProxy : TransactionProxy ;
1208+ }
11851209> => {
11861210 if ( await checkPackage ( '@libsql/client' ) ) {
11871211 const { createClient } = await import ( '@libsql/client' ) ;
@@ -1245,7 +1269,7 @@ export const connectToLibSQL = async (credentials: LibSQLCredentials): Promise<
12451269 return results ;
12461270 } ;
12471271
1248- return { ...db , proxy, transactionProxy, migrate : migrateFn } ;
1272+ return { ...db , packageName : '@libsql/client' , proxy, transactionProxy, migrate : migrateFn } ;
12491273 }
12501274
12511275 console . log (
0 commit comments