import 'server-only'; import { getDb, getSql, closeDb, schema } from '@rareindex/database'; /** Server-side database handle for server components, route handlers and server actions. */ export const db = () => getDb(); export { getDb, getSql, closeDb, schema }; export type { Database } from '@rareindex/database'; export { sql, eq, and, or, desc, asc, gte, lte, lt, gt, inArray, isNull, isNotNull, ilike, count, sum, avg, max, min, ne, between, notInArray } from '@rareindex/database'; // Tables are re-exported from the `schema` namespace explicitly: Turbopack cannot statically // enumerate `export *` chains that cross the package's `.js`-suffixed internal re-exports. export const { categories, brands, franchises, sets, graders, taxonomyProposals, sources, connectors, connectorRuns, connectorHealth, crawlState, costs, rawRecords, normalizedRecords, events, auditLog, assets, assetVariants, assetStats, variantStats, images, assetEmbeddings, populationReports, gradePremiums, sales, listings, listingEvents, auctions, auctionLots, priceObservations, crossListingGroups, fxRates, news, valuations, priceSnapshots, indices, indexValues, indexConstituents, categorySnapshots, radarFindings, correlations, benchmarks, users, sessions, collections, collectionItems, collectionSnapshots, watchlists, watchlistItems, alerts, alertEvents, apiKeys, apiUsage, assetViews, searchLog, authCodes, recoveryCodes, trustedDevices, loginEvents, rateLimits, notifications, savedSearches, priceTargets, uploads, userBadges, } = schema;