link,[object Object]
Skip to content

Views ​

Reference of database views used for secure and optimized data access.

listing_view_secure ​

Purpose: Exposes listing rows with sensitive fields automatically blurred based on subscription level and authentication status. Applies can_view_field(listing_id, field_key, user_id) per sensitive column.

Notes:

  • Backed by blurred_fields configuration and helper function can_view_field.
  • Intended for public/anonymous access and authenticated users without over-fetching.

Common usage:

  • Public listing pages and search results
  • Server-side rendering of listing cards

subscriptions_view ​

Purpose: Surface current subscription details with safe columns for UI, hiding internal billing identifiers from non-privileged roles.

Notes:

  • Filters or excludes Stripe internal IDs for non-admin roles
  • Joins subscriptions with computed status fields when present

seller_profiles_public ​

Purpose: Publicly visible seller profile subset for active listings.

Notes:

  • Exposes only non-sensitive fields (e.g., full_name, seller_since, seller_rating)
  • Intended for listing detail pages and seller profile previews

listing_views_summary ​

Purpose: Aggregated view analytics (e.g., total views, unique viewers) per listing for dashboards.

Notes:

  • Typically aggregates listing_views
  • Optimized for time-series and per-listing analytics