SPB Git forge

spb/rareindex

Public
54commits 1branches 0releases
7.1 MBsize
maindefault branch
10 days agolast push
TypeScript 61.9% HTML 37.2% SQL 0.7%
1.6 KB · 79 lines typescript
Raw Blame History
1import 'server-only';2import { getDb, getSql, closeDb, schema } from '@rareindex/database';34/** Server-side database handle for server components, route handlers and server actions. */5export const db = () => getDb();6export { getDb, getSql, closeDb, schema };7export type { Database } from '@rareindex/database';8export { 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';910// Tables are re-exported from the `schema` namespace explicitly: Turbopack cannot statically11// enumerate `export *` chains that cross the package's `.js`-suffixed internal re-exports.12export const {13  categories,14  brands,15  franchises,16  sets,17  graders,18  taxonomyProposals,19  sources,20  connectors,21  connectorRuns,22  connectorHealth,23  crawlState,24  costs,25  rawRecords,26  normalizedRecords,27  events,28  auditLog,29  assets,30  assetVariants,31  assetStats,32  variantStats,33  images,34  assetEmbeddings,35  populationReports,36  gradePremiums,37  sales,38  listings,39  listingEvents,40  auctions,41  auctionLots,42  priceObservations,43  crossListingGroups,44  fxRates,45  news,46  valuations,47  priceSnapshots,48  indices,49  indexValues,50  indexConstituents,51  categorySnapshots,52  radarFindings,53  correlations,54  benchmarks,55  users,56  sessions,57  collections,58  collectionItems,59  collectionSnapshots,60  watchlists,61  watchlistItems,62  alerts,63  alertEvents,64  apiKeys,65  apiUsage,66  assetViews,67  searchLog,68  authCodes,69  recoveryCodes,70  trustedDevices,71  loginEvents,72  rateLimits,73  notifications,74  savedSearches,75  priceTargets,76  uploads,77  userBadges,78} = schema;79