@@ -14,7 +14,7 @@ if (!identifier) {
1414if ( identifier . startsWith ( "wrk_" ) ) {
1515await printWorkspace ( identifier )
1616} else {
17- const authData = await printTable ( "Email" , ( tx ) =>
17+ const authData = await Database . use ( async ( tx ) =>
1818tx . select ( ) . from ( AuthTable ) . where ( eq ( AuthTable . subject , identifier ) ) ,
1919)
2020if ( authData . length === 0 ) {
@@ -25,7 +25,7 @@ if (identifier.startsWith("wrk_")) {
2525
2626// Get all auth records for email
2727const accountID = authData [ 0 ] . accountID
28- await printTable ( "Auth Records " , ( tx ) => tx . select ( ) . from ( AuthTable ) . where ( eq ( AuthTable . accountID , accountID ) ) )
28+ await printTable ( "Auth" , ( tx ) => tx . select ( ) . from ( AuthTable ) . where ( eq ( AuthTable . accountID , accountID ) ) )
2929
3030// Get all workspaces for this account
3131const users = await printTable ( "Workspaces" , ( tx ) =>
@@ -60,6 +60,7 @@ async function printWorkspace(workspaceID: string) {
6060tx
6161. select ( {
6262balance : BillingTable . balance ,
63+ customerID : BillingTable . customerID ,
6364} )
6465. from ( BillingTable )
6566. where ( eq ( BillingTable . workspaceID , workspace . id ) )
@@ -113,7 +114,7 @@ async function printWorkspace(workspaceID: string) {
113114. from ( UsageTable )
114115. where ( eq ( UsageTable . workspaceID , workspace . id ) )
115116. orderBy ( sql `${ UsageTable . timeCreated } DESC` )
116- . limit ( 1000 )
117+ . limit ( 10 )
117118. then ( ( rows ) =>
118119rows . map ( ( row ) => ( {
119120 ...row ,
0 commit comments