@cfxlabsinc/b2b-services
    Preparing search index...

    Module @cfxlabsinc/db

    db

    Houses database migrations, types and configuration for running a local PostgreSQL instance.

    Starts a postgres:18 container (requires Docker), applies all migrations, seeds it, and publishes it on port 54332, the port .env.local's DATABASE_URL names.

    It runs in the foreground: leave it in a terminal and press Ctrl-C to stop and remove the container.

    bun nx run db:start
    

    Every start is a fresh container, so migrations and seed are re-applied from scratch on each boot. To pick up a new migration, Ctrl-C and start again. (This is why there is no separate reset or stop target.)

    Seed scripts (seed/*.sql) are applied automatically on every start. To boot without them:

    bun nx run db:start:skip-seed
    

    To get an empty database (schemas only) for dbmate to migrate into, as the PR dbmate job does:

    bun nx run db:start:bare
    

    The containers run on rootless Podman (podman machine start if db:start cannot reach it). Podman forwards the ports to localhost, so DATABASE_URL and VALKEY_URL stay on 127.0.0.1.

    This will generate a blank migration file within the migrations directory.

    bun nx run db:migrate-new <name>
    
    bun nx run db:migrate-up
    
    bun nx run db:migrate-down
    
    bun nx run db:migrate-status
    
    bun nx run db:migrate-dump
    

    To add seed data to the database, you can create .sql scripts within the seed directory.

    Running the start target on this project will automatically seed the database using these seed scripts.

    This data will only be inserted into the local instance.

    The cluster, proxy, cache and workload roles are the cfx-db Pulumi stack in packages/aurora, which also generates test/fixtures/workload-roles.*.sql.

    ParsedSolanaTransactionEvent
    UtilaReferencedAsset
    UtilaTransactionAddress
    UtilaTransactionPayload
    UtilaTransactionReferencedResources
    UtilaTransactionTransfer
    AchEntryData
    AchFileMetadata
    AchInstructionData
    AiPriseBusinessProfileData
    AiPriseUserProfileData
    BackofficeWalletData
    BankAccountSweepParent
    BankAccountType
    BankDashboardTheme
    BankId
    BankTransactionRaw
    BankTransactionRawSource
    BankVendor
    ChainData
    ChainRuntime
    ColorScheme
    CustomerApplicationStatus
    DashboardSessionTable
    DbOrderByCriterion
    DbTimestampCriteria
    DepositVendorId
    DisplayTimeZone
    DocumentTable
    EmailNotification
    EmailTemplateConditionCase
    EmailTemplateKey
    EmailTemplateRegistration
    EmailTemplateRegistry
    EmailTemplateRenderCase
    EmailTemplateVariable
    EmailTemplateVariantRow
    EmailTemplateVersionData
    EscrowTransferHistoryEntry
    EscrowTransferMetadata
    EscrowTransferRequestStatus
    EscrowTransferStatus
    Fees
    ForeignSwiftWireInstructionData
    GreendotConsumptionRequest
    InsertAchFile
    InsertAiPriseBusinessProfile
    InsertAiPriseUserProfile
    InsertBackfillFailure
    InsertBackfillRun
    InsertCustomerApiKey
    InsertCustomerOrigin
    InsertCustomerSlackBotChannel
    InsertCustomerSlackBotInstallation
    InsertEscrowTransfer
    InsertEscrowTransferRequest
    InsertGreendotConsumptionEvent
    InsertGreendotSettlementBatch
    InsertGreendotSettlementEntry
    InsertProductQuote
    InsertProgram
    InsertProgramCustomer
    InsertQuilttConnection
    InsertRewardLedger
    InsertRewardProgram
    InsertShortUrl
    InsertSlackBotInstallation
    InsertSolanaAccountTransaction
    InsertSwapQuote
    InsertUtilaAsset
    InsertUtilaTransaction
    InsertUtilaWalletTransaction
    InsertVirtualAccount
    InsertWalletAccountTransaction
    InsertWalletBalanceSnapshot
    InsertWalletHistoryBackfill
    InsertWalletTransaction
    InsertWithdrawalQuote
    InternalSlackFeed
    LimitEvaluation
    Matcher
    MatcherCriteria
    MatcherField
    NonBankVendor
    NotificationFor
    ParentSearch
    PinnedLimitViolation
    PinnedMatcherCriteria
    PinnedUsageSnapshot
    PositivePayDecisionSource
    PositivePayDecisionStatus
    PositivePayFileStatus
    PositivePayFileTrigger
    PositivePayRequestedDecision
    Product
    ProductCategory
    ProductMethod
    ProductQuoteData
    ProductRouteVersionData
    QuilttAccountData
    RtpInstructionData
    RuleCondition
    RuleGroup
    SearchDocument
    SearchDocumentParts
    SelectAchBatch
    SelectAchFile
    SelectAdminDashboardPermission
    SelectAdminDashboardRole
    SelectAdminDashboardRolePermission
    SelectAdminDashboardSession
    SelectAdminDashboardUser
    SelectAdminDashboardUserActivity
    SelectAdminDashboardUserLogin
    SelectAdminMcpToolCall
    SelectAiPriseBusinessProfile
    SelectAiPriseUserProfile
    SelectAssetPrice
    SelectBackfillFailure
    SelectBackfillRun
    SelectBackofficeWallet
    SelectBank
    SelectBankAccount
    SelectBankDashboardInvite
    SelectBankDashboardMembership
    SelectBankDashboardPermission
    SelectBankDashboardRole
    SelectBankDashboardRolePermission
    SelectBankDashboardRoleSet
    SelectBankDashboardSession
    SelectBankDashboardSsoConnection
    SelectBankDashboardUser
    SelectBankDashboardUserActivity
    SelectBankDashboardUserLogin
    SelectBankDashboardWorkspace
    SelectBankDocument
    SelectBankInternalTransfer
    SelectBankTransaction
    SelectChain
    SelectCustomer
    SelectCustomerApiKey
    SelectCustomerApplication
    SelectCustomerDashboardInvite
    SelectCustomerDashboardMembership
    SelectCustomerDashboardPermission
    SelectCustomerDashboardRole
    SelectCustomerDashboardRolePermission
    SelectCustomerDashboardRoleSet
    SelectCustomerDashboardSession
    SelectCustomerDashboardSsoConnection
    SelectCustomerDashboardUser
    SelectCustomerDashboardUserActivity
    SelectCustomerDashboardUserLogin
    SelectCustomerDashboardWorkspace
    SelectCustomerDocument
    SelectCustomerOrigin
    SelectCustomerSlackBotChannel
    SelectCustomerSlackBotInstallation
    SelectDashboardSession
    SelectDeposit
    SelectDepositBankMemo
    SelectDepositQuote
    SelectDepositStatusUpdate
    SelectDocument
    SelectEmailDelivery
    SelectEmailTemplate
    SelectEmailTemplateVersion
    SelectEntityDocument
    SelectEscrowTransfer
    SelectEscrowTransferRequest
    SelectEscrowTransferStatusUpdate
    SelectFedAchDirectoryRecord
    SelectFedParticipantDirectoryRecord
    SelectFeeTransfer
    SelectFeeTransferStatusUpdate
    SelectGirasolCard
    SelectGirasolCardAccount
    SelectGirasolCardClearing
    SelectGirasolCardTransaction
    SelectGirasolCardTransactionStatusUpdate
    SelectGirasolClearingRecord
    SelectGreendotConsumptionEvent
    SelectGreendotRetailer
    SelectGreendotSettlementBatch
    SelectGreendotSettlementEntry
    SelectIdentity
    SelectInternalSlackChannel
    SelectLedgerAccount
    SelectLedgerAccountTransfer
    SelectLedgerAccountTransferStatusUpdate
    SelectLedgerAccountWithdrawal
    SelectLedgerAccountWithdrawalStatusUpdate
    SelectManualMint
    SelectOperatingEntry
    SelectOrganization
    SelectPaymentInstrument
    SelectPaymentInstrumentBlacklist
    SelectPdfAsset
    SelectPdfTemplate
    SelectPdfTemplateVersion
    SelectPositivePayDecision
    SelectPositivePayFile
    SelectProduct
    SelectProductActivationRule
    SelectProductActivationRuleVersion
    SelectProductFeeRule
    SelectProductFeeRuleVersion
    SelectProductLimitRule
    SelectProductLimitRuleVersion
    SelectProductQuote
    SelectProductRoute
    SelectProductRouteVersion
    SelectProductVendor
    SelectProductVendorVersion
    SelectProgram
    SelectProgramCustomer
    SelectQuilttConnection
    SelectRecurringFeeInvoice
    SelectRecurringFeeInvoiceLine
    SelectRedemption
    SelectRedemptionStatusUpdate
    SelectRelatedPerson
    SelectRewardAccount
    SelectRewardClaim
    SelectRewardEventConfig
    SelectRewardLedger
    SelectRewardProgram
    SelectShortUrl
    SelectSlackBotInstallation
    SelectSlackTemplate
    SelectSlackTemplateVersion
    SelectSmsTemplate
    SelectSmsTemplateVersion
    SelectSolanaAccountTransaction
    SelectSolanaNonce
    SelectSolanaProgramEvent
    SelectSolanaTransaction
    SelectSwap
    SelectSwapDepositAddress
    SelectSwapQuote
    SelectSwapStatusUpdate
    SelectToken
    SelectTransactionApprovalDecision
    SelectTransactionApprovalRequest
    SelectTransactionApprovalRule
    SelectTransactionMetadata
    SelectTransactionMetadataFile
    SelectTransactionRow
    SelectUtilaAsset
    SelectUtilaCustodialWallet
    SelectUtilaSweepWallet
    SelectUtilaTransaction
    SelectUtilaVault
    SelectUtilaWalletTransaction
    SelectVerificationTemplate
    SelectVirtualAccount
    SelectVirtualAccountProvider
    SelectWallet
    SelectWalletAccountTransaction
    SelectWalletAddress
    SelectWalletBalanceSnapshot
    SelectWalletHistoryBackfill
    SelectWalletKeyshare
    SelectWalletSecret
    SelectWalletTransaction
    SelectWireBatch
    SelectWireEmail
    SelectWireFile
    SelectWithdrawal
    SelectWithdrawalQuote
    SelectWithdrawalStatusUpdate
    SourceWalletType
    Speed
    StatusVariantOf
    StoredEmailTemplate
    StoredEscrowTransferStatus
    SwiftWireInstructionData
    TimeZone
    TimeZonePreference
    TokenData
    TokenLogoFailure
    TokenLogoMirror
    TransactionColumnRef
    TransactionSourceColumn
    Transitions
    UsdSwiftWireInstructionData
    UsWireInstructionData
    VariableOptionality
    Vendor
    VerificationReasons
    VerificationStatus
    VerificationTemplateType
    WalletChain
    WalletDelegation
    WalletHistoryEndpoint
    WalletImportSource
    WalletKeyshareKind
    WalletSecretKind
    WalletTransactionChain
    WalletTransactionSource
    WalletTransactionStatus
    WalletTransactionType
    WireBatchBankInternalTransferInstruction
    WireDetailData
    WireEmailParsed
    WireFileMetadata
    WireWithdrawalPurpose
    WithdrawalMethodVendorId
    ACH_NAME_MAX_LENGTH
    achBatchSearch
    achBatchTable
    achFileSearch
    achFileTable
    admin
    adminDashboardPermissionTable
    adminDashboardRolePermissionTable
    adminDashboardRoleTable
    adminDashboardSessionTable
    adminDashboardUserActivityTable
    adminDashboardUserAdminSearch
    adminDashboardUserLoginTable
    adminDashboardUserSearch
    adminDashboardUserTable
    adminMcpToolCallTable
    aipriseBusinessProfileSearch
    aipriseBusinessProfileTable
    aipriseUserProfileSearch
    aipriseUserProfileTable
    APPLIED_COMMIT_PER_QUOTE_INDEX
    assetPriceTable
    b2b
    b2bDialect
    backfillFailureTable
    backfillRunTable
    backofficeWalletTable
    BANK_IDS
    BANK_INTERNAL_TRANSFER_ID_PREFIX
    bankAccountAdminSearch
    bankAccountRouteFusionBeneficiaryTable
    bankAccountSearch
    bankAccountTable
    bankAccountView
    bankDashboardInviteTable
    bankDashboardMembershipTable
    bankDashboardPermissionTable
    bankDashboardRolePermissionTable
    bankDashboardRoleSetSearch
    bankDashboardRoleSetTable
    bankDashboardRoleTable
    bankDashboardSessionTable
    bankDashboardSsoConnectionTable
    bankDashboardUserActivityTable
    bankDashboardUserAdminSearch
    bankDashboardUserLoginTable
    bankDashboardUserSearch
    bankDashboardUserTable
    bankDashboardWorkspaceTable
    bankDocumentTable
    bankInstructionAccountView
    bankInstructionBankAccountView
    bankInternalTransferLegTable
    bankInternalTransferTable
    bankInternalTransferWireBatchIdSql
    bankSchema
    bankSearch
    bankTable
    bankTransactionAdminSearch
    bankTransactionReconcileQueueView
    bankTransactionSearch
    bankTransactionTable
    blockchainDepositTransactionView
    blockchainWithdrawalTransactionView
    cardTransactionView
    chainTable
    COLOR_SCHEME_DESCRIPTIONS
    COLOR_SCHEMES
    crossRouteActivationRuleView
    customerAdminSearch
    customerApiKeyTable
    customerApplicationSearch
    customerApplicationTable
    customerDashboardInviteTable
    customerDashboardMembershipTable
    customerDashboardPermissionTable
    customerDashboardRolePermissionTable
    customerDashboardRoleSetSearch
    customerDashboardRoleSetTable
    customerDashboardRoleTable
    customerDashboardSessionTable
    customerDashboardSsoConnectionTable
    customerDashboardUserActivityTable
    customerDashboardUserAdminSearch
    customerDashboardUserLoginTable
    customerDashboardUserSearch
    customerDashboardUserTable
    customerDashboardWorkspaceTable
    customerDocumentTable
    customerOriginTable
    customerSearch
    customerSlackBotChannel
    customerSlackBotInstallationTable
    customerTable
    DEPOSIT_QUOTE_TRANSITIONS
    depositBankMemoTable
    depositQuoteTable
    depositStatusUpdateTable
    depositTable
    depositTransactionView
    EMAIL_TEMPLATE_KEYS
    EMAIL_TEMPLATE_REGISTRY
    emailDeliveryTable
    emailTemplateTable
    emailTemplateVersionTable
    entityDocumentTable
    ESCROW_TRANSFER_REQUEST_STATUSES
    ESCROW_TRANSFER_STATUSES
    escrowTransferRequestTable
    escrowTransferStatusUpdateTable
    escrowTransferTable
    escrowTransferTransactionView
    fedAchDirectoryTable
    fedParticipantDirectoryTable
    feeTransferStatusUpdateTable
    feeTransferTable
    feeTransferTransactionView
    girasolCardAccountTable
    girasolCardTable
    girasolCardTransactionStatusUpdateTable
    girasolCardTransactionTable
    girasolClearingBatchTable
    girasolClearingRecordTable
    greendotConsumptionEventTable
    greendotRetailerTable
    greendotSettlementBatchTable
    greendotSettlementEntryTable
    identityAdminSearch
    identitySearch
    identityTable
    INTERNAL_SLACK_FEEDS
    internalSlackChannelTable
    KNOWN_VENDORS
    LEDGER_ACCOUNT_WITHDRAWAL_TRANSITIONS
    ledgerAccountAddressView
    ledgerAccountBalanceChangeView
    ledgerAccountMintfxAddressView
    ledgerAccountPrimaryAddressView
    ledgerAccountSearch
    ledgerAccountTable
    ledgerAccountTransferStatusUpdateTable
    ledgerAccountTransferTable
    ledgerAccountWithdrawalAdminSearch
    ledgerAccountWithdrawalSearch
    ledgerAccountWithdrawalStatusUpdateTable
    ledgerAccountWithdrawalTable
    ledgerAccountWithdrawalTransactionView
    manualBankAccountView
    manualMintTable
    manualMintTransactionView
    MATCHER_FIELDS
    MIN_INDEXED_QUERY_LENGTH
    networkTransferTransactionView
    observedBankAccountView
    operatingEntryTable
    organizationAdminSearch
    organizationSearch
    organizationTable
    paymentInstrumentAdminSearch
    paymentInstrumentBlacklistTable
    paymentInstrumentSearch
    paymentInstrumentTable
    PDF_TEMPLATE_KEYS
    pdfAssetTable
    pdfTemplateTable
    pdfTemplateVersionTable
    POSITIVE_PAY_DECISION_SOURCES
    POSITIVE_PAY_DECISION_STATUSES
    POSITIVE_PAY_FILE_STATUSES
    POSITIVE_PAY_FILE_TRIGGERS
    POSITIVE_PAY_REQUESTED_DECISIONS
    positivePayDecisionTable
    positivePayFileTable
    productActivationRuleEffectiveVersionView
    productActivationRuleTable
    productActivationRuleVersionTable
    productFeeRuleEffectiveVersionView
    productFeeRuleTable
    productFeeRuleVersionTable
    productLimitRuleEffectiveVersionView
    productLimitRuleTable
    productLimitRuleVersionTable
    productQuoteAdminSearch
    productQuoteSearch
    productQuoteTable
    productRouteEffectiveVersionView
    productRouteSearch
    productRouteTable
    productRouteVersionSearch
    productRouteVersionTable
    productSearch
    productTable
    productVendorLatestVersionView
    productVendorSearch
    productVendorTable
    productVendorVersionTable
    programCustomerTable
    programTable
    quilttConnectionTable
    recurringFeeInvoiceLineTable
    recurringFeeInvoiceTable
    REDEMPTION_TRANSITIONS
    redemptionStatusUpdateTable
    redemptionTable
    redemptionTransactionView
    relatedPersonTable
    rewardAccountTable
    rewardClaimTable
    rewardEventConfigTable
    rewardLedgerTable
    rewardProgramTable
    rewardTransactionView
    routeCriteriaCustomerProgramView
    routeCriteriaEntityView
    routeCriteriaLedgerAccountView
    routeCriteriaPaymentInstrumentView
    routeCriteriaRouteView
    routeCriteriaUsageView
    SEARCH_DOCUMENT_EXCLUDED
    SEARCH_EXCLUDED_KEY_PATTERN
    shortUrlTable
    slackBotInstallationTable
    slackTemplateTable
    slackTemplateVersionTable
    smsTemplateTable
    smsTemplateVersionTable
    solanaAccountTransactionTable
    solanaNoncePoolTable
    solanaProgramEventTable
    solanaTransactionTable
    STATUS_VARIANT_WILDCARD
    SWAP_QUOTE_TRANSITIONS
    SWAP_TRANSITIONS
    swapAdminSearch
    swapDepositAddressTable
    swapQuoteTable
    swapSearch
    swapStatusUpdateTable
    swapTable
    swapTransactionView
    TIME_ZONES
    tokenTable
    TRANSACTION_APPROVAL_REQUEST_TRANSITIONS
    TRANSACTION_SEARCH_TEXT_COLUMNS
    TRANSACTION_SOURCE_COLUMNS
    transactionAdminSearch
    transactionApprovalDecisionTable
    transactionApprovalRequestTable
    transactionApprovalRuleTable
    transactionArmColumn
    transactionDerivedColumnDdl
    transactionMetadataFileTable
    transactionMetadataTable
    transactionNameColumnsDdl
    transactionSearch
    transactionTable
    transactionTableColumn
    transactionView
    transferTransactionView
    utilaAssetTable
    utilaCustodialWalletSearch
    utilaCustodialWalletTable
    utilaSweepWalletSearch
    utilaSweepWalletTable
    utilaTransactionTable
    utilaVaultTable
    utilaWalletTransactionTable
    utilaWalletView
    VERIFICATION_TEMPLATE_TYPES
    verificationTemplateTable
    virtualAccountAdminSearch
    virtualAccountBankAccountView
    virtualAccountProviderTable
    virtualAccountSearch
    virtualAccountTable
    walletAccountTransactionTable
    walletAccountTransactionUiView
    walletAddressTable
    walletBalanceDivergenceView
    walletBalanceSnapshotTable
    walletBalanceTotalView
    walletBalanceView
    walletHistoryBackfillTable
    walletKeyshareTable
    walletSecretTable
    walletSignatureTable
    walletTable
    walletTransactionTable
    WIRE_BATCH_TRANSFER_STATUSES
    WIRE_NAME_MAX_LENGTH
    wireBatchSearch
    wireBatchTable
    wireEmailAdminSearch
    wireEmailSearch
    wireEmailTable
    wireFileSearch
    wireFileTable
    WITHDRAWAL_QUOTE_TRANSITIONS
    withdrawalAdminSearch
    withdrawalQuoteAdminSearch
    withdrawalQuoteSearch
    withdrawalQuoteTable
    withdrawalSearch
    withdrawalStatusUpdateTable
    withdrawalTable
    withdrawalTransactionView
    bankAccountBalanceAggregatesSql
    bankAccountBalanceColumnsSql
    bankAccountBalanceLateralSql
    bankAccountEntitySql
    bankAccountKeySql
    bankAccountViewColumns
    bankSupportsRail
    bankTransactionReconciliationJoinSql
    caseOn
    caseWhen
    coalesce
    composedEntityNameSql
    composedEntitySql
    createQueryBuilder
    customerAtBanks
    dbOrderBy
    dbOrderByThenId
    dbTimestampQuery
    defineDashboardSessionTable
    defineDocumentTable
    depositReceiptKey
    descriptionCaseSql
    emailTemplateConditionCases
    emailTemplateOptionalVariables
    emailTemplatePlaceholders
    emailTemplateRenderCases
    emailTemplateStatusVariants
    emailTemplateTypes
    emailTemplateTypesForVariant
    emailTemplateVariantRows
    escapeLike
    foldAccents
    getColumns
    heldByBackofficeWallet
    inArray
    invalidCutoffTimezone
    isAreaLocationTimezone
    isBankVendor
    isColorScheme
    isForeignKeyViolatedError
    isLockNotAvailableError
    isNotNullViolatedError
    isTimeZonePreference
    isUniqueConstraintViolatedError
    jsonbKeysSearchText
    jsonbSearchText
    jsonbSharedSearchText
    ledgerAccountAtBanks
    ledgerAccountsWithoutMintfx
    moveusdMint
    named
    nameIndex
    nanoId
    notInArray
    paymentInstrumentUsedAtBanks
    projectedDocument
    resolveDisplayTimeZone
    searchDocument
    searchDocumentColumn
    searchDocumentSql
    searchIndex
    searchOrder
    searchRank
    solanaTokenMint
    sweepLegSql
    textSearch
    transactionDerivedColumnsDdl
    transactionMethodDescriptionDdl
    transactionSearchTextDdl
    transactionViewColumns
    vendorBankIdMismatch