Skip to content

Commit

Permalink
Add subaccount usernames table to list of tables to export.
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentwschau committed Jan 8, 2025
1 parent 2a79ca0 commit c8790e0
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import {
getAthenaTableCreationStatement,
getExternalAthenaTableCreationStatement,
} from '../../helpers/sql';

const TABLE_NAME: string = 'subaccount_usernames';
const RAW_TABLE_COLUMNS: string = `
\`username\` string,
\`subaccountId\` string
`;
const TABLE_COLUMNS: string = `
"username",
"subaccountId"
`;

export function generateRawTable(tablePrefix: string, rdsExportIdentifier: string): string {
return getExternalAthenaTableCreationStatement(
tablePrefix,
rdsExportIdentifier,
TABLE_NAME,
RAW_TABLE_COLUMNS,
);
}

export function generateTable(tablePrefix: string): string {
return getAthenaTableCreationStatement(
tablePrefix,
TABLE_NAME,
TABLE_COLUMNS,
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import * as athenaTradingRewards from '../lib/athena-ddl-tables/trading_rewards'
import * as athenaTransfers from '../lib/athena-ddl-tables/transfers';
import * as athenaVaults from '../lib/athena-ddl-tables/vaults';
import * as athenaWallets from '../lib/athena-ddl-tables/wallets';
import * as athenaSubaccountUsernames from '../lib/athena-ddl-tables/subaccount_usernames';

export const tablesToAddToAthena: { [table: string]: AthenaTableDDLQueries } = {
asset_positions: athenaAssetPositions,
Expand All @@ -64,6 +65,7 @@ export const tablesToAddToAthena: { [table: string]: AthenaTableDDLQueries } = {
affiliate_info: athenaAffiliateInfo,
affiliate_referred_users: athenaAffiliateReferredUsers,
vaults: athenaVaults,
subaccount_usernames: athenaSubaccountUsernames,
};

const statStart: string = `${config.SERVICE_NAME}.update_research_environment`;
Expand Down

0 comments on commit c8790e0

Please sign in to comment.