From 6cf1ffe4f4a506d4d8e57ada84fc71a1b4e694f1 Mon Sep 17 00:00:00 2001 From: OllyNicholass Date: Tue, 17 Sep 2024 18:37:32 +0100 Subject: [PATCH] chore(#29): generate database types --- package.json | 6 +- supabase/config.toml | 2 +- types/supabase.d.ts | 1262 +++++++++++++++++++++--------------------- 3 files changed, 629 insertions(+), 641 deletions(-) diff --git a/package.json b/package.json index 759821c..afe8db8 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,8 @@ "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", "lint": "prettier --check . && eslint .", - "format": "prettier --write ." + "format": "prettier --write .", + "generate": "supabase gen types typescript --local > types/supabase.d.ts && prettier --write types/supabase.d.ts" }, "devDependencies": { "@sveltejs/adapter-auto": "^3.0.0", @@ -51,5 +52,6 @@ }, "engines": { "node": ">=18.13.0" - } + }, + "packageManager": "pnpm@9.9.0+sha512.60c18acd138bff695d339be6ad13f7e936eea6745660d4cc4a776d5247c540d0edee1a563695c183a66eb917ef88f2b4feb1fc25f32a7adcadc7aaf3438e99c1" } diff --git a/supabase/config.toml b/supabase/config.toml index c0b3ed7..2bb0cae 100644 --- a/supabase/config.toml +++ b/supabase/config.toml @@ -1,6 +1,6 @@ # A string used to distinguish different Supabase projects on the same host. Defaults to the # working directory name when running `supabase init`. -project_id = "saas" +project_id = "SvelteKitSaasBoilerplate" [api] enabled = true diff --git a/types/supabase.d.ts b/types/supabase.d.ts index d364511..c0a26d5 100644 --- a/types/supabase.d.ts +++ b/types/supabase.d.ts @@ -1,653 +1,639 @@ -export type Json = - | string - | number - | boolean - | null - | { [key: string]: Json | undefined } - | Json[] +export type Json = string | number | boolean | null | { [key: string]: Json | undefined } | Json[]; export type Database = { - graphql_public: { - Tables: { - [_ in never]: never - } - Views: { - [_ in never]: never - } - Functions: { - graphql: { - Args: { - operationName?: string - query?: string - variables?: Json - extensions?: Json - } - Returns: Json - } - } - Enums: { - [_ in never]: never - } - CompositeTypes: { - [_ in never]: never - } - } - public: { - Tables: { - customers: { - Row: { - id: string - stripe_customer_id: string | null - } - Insert: { - id: string - stripe_customer_id?: string | null - } - Update: { - id?: string - stripe_customer_id?: string | null - } - Relationships: [ - { - foreignKeyName: "customers_id_fkey" - columns: ["id"] - isOneToOne: true - referencedRelation: "users" - referencedColumns: ["id"] - }, - ] - } - prices: { - Row: { - active: boolean | null - currency: string | null - description: string | null - id: string - interval: Database["public"]["Enums"]["pricing_plan_interval"] | null - interval_count: number | null - metadata: Json | null - product_id: string | null - trial_period_days: number | null - type: Database["public"]["Enums"]["pricing_type"] | null - unit_amount: number | null - } - Insert: { - active?: boolean | null - currency?: string | null - description?: string | null - id: string - interval?: Database["public"]["Enums"]["pricing_plan_interval"] | null - interval_count?: number | null - metadata?: Json | null - product_id?: string | null - trial_period_days?: number | null - type?: Database["public"]["Enums"]["pricing_type"] | null - unit_amount?: number | null - } - Update: { - active?: boolean | null - currency?: string | null - description?: string | null - id?: string - interval?: Database["public"]["Enums"]["pricing_plan_interval"] | null - interval_count?: number | null - metadata?: Json | null - product_id?: string | null - trial_period_days?: number | null - type?: Database["public"]["Enums"]["pricing_type"] | null - unit_amount?: number | null - } - Relationships: [ - { - foreignKeyName: "prices_product_id_fkey" - columns: ["product_id"] - isOneToOne: false - referencedRelation: "products" - referencedColumns: ["id"] - }, - ] - } - products: { - Row: { - active: boolean | null - description: string | null - id: string - image: string | null - metadata: Json | null - name: string | null - } - Insert: { - active?: boolean | null - description?: string | null - id: string - image?: string | null - metadata?: Json | null - name?: string | null - } - Update: { - active?: boolean | null - description?: string | null - id?: string - image?: string | null - metadata?: Json | null - name?: string | null - } - Relationships: [] - } - subscriptions: { - Row: { - cancel_at: string | null - cancel_at_period_end: boolean | null - canceled_at: string | null - created: string - current_period_end: string - current_period_start: string - ended_at: string | null - id: string - metadata: Json | null - price_id: string | null - quantity: number | null - status: Database["public"]["Enums"]["subscription_status"] | null - trial_end: string | null - trial_start: string | null - user_id: string - } - Insert: { - cancel_at?: string | null - cancel_at_period_end?: boolean | null - canceled_at?: string | null - created?: string - current_period_end?: string - current_period_start?: string - ended_at?: string | null - id: string - metadata?: Json | null - price_id?: string | null - quantity?: number | null - status?: Database["public"]["Enums"]["subscription_status"] | null - trial_end?: string | null - trial_start?: string | null - user_id: string - } - Update: { - cancel_at?: string | null - cancel_at_period_end?: boolean | null - canceled_at?: string | null - created?: string - current_period_end?: string - current_period_start?: string - ended_at?: string | null - id?: string - metadata?: Json | null - price_id?: string | null - quantity?: number | null - status?: Database["public"]["Enums"]["subscription_status"] | null - trial_end?: string | null - trial_start?: string | null - user_id?: string - } - Relationships: [ - { - foreignKeyName: "subscriptions_price_id_fkey" - columns: ["price_id"] - isOneToOne: false - referencedRelation: "prices" - referencedColumns: ["id"] - }, - { - foreignKeyName: "subscriptions_user_id_fkey" - columns: ["user_id"] - isOneToOne: false - referencedRelation: "users" - referencedColumns: ["id"] - }, - ] - } - users: { - Row: { - avatar_url: string | null - billing_address: Json | null - full_name: string | null - id: string - payment_method: Json | null - } - Insert: { - avatar_url?: string | null - billing_address?: Json | null - full_name?: string | null - id: string - payment_method?: Json | null - } - Update: { - avatar_url?: string | null - billing_address?: Json | null - full_name?: string | null - id?: string - payment_method?: Json | null - } - Relationships: [ - { - foreignKeyName: "users_id_fkey" - columns: ["id"] - isOneToOne: true - referencedRelation: "users" - referencedColumns: ["id"] - }, - ] - } - } - Views: { - [_ in never]: never - } - Functions: { - [_ in never]: never - } - Enums: { - pricing_plan_interval: "day" | "week" | "month" | "year" - pricing_type: "one_time" | "recurring" - subscription_status: - | "trialing" - | "active" - | "canceled" - | "incomplete" - | "incomplete_expired" - | "past_due" - | "unpaid" - } - CompositeTypes: { - [_ in never]: never - } - } - storage: { - Tables: { - buckets: { - Row: { - allowed_mime_types: string[] | null - avif_autodetection: boolean | null - created_at: string | null - file_size_limit: number | null - id: string - name: string - owner: string | null - owner_id: string | null - public: boolean | null - updated_at: string | null - } - Insert: { - allowed_mime_types?: string[] | null - avif_autodetection?: boolean | null - created_at?: string | null - file_size_limit?: number | null - id: string - name: string - owner?: string | null - owner_id?: string | null - public?: boolean | null - updated_at?: string | null - } - Update: { - allowed_mime_types?: string[] | null - avif_autodetection?: boolean | null - created_at?: string | null - file_size_limit?: number | null - id?: string - name?: string - owner?: string | null - owner_id?: string | null - public?: boolean | null - updated_at?: string | null - } - Relationships: [] - } - migrations: { - Row: { - executed_at: string | null - hash: string - id: number - name: string - } - Insert: { - executed_at?: string | null - hash: string - id: number - name: string - } - Update: { - executed_at?: string | null - hash?: string - id?: number - name?: string - } - Relationships: [] - } - objects: { - Row: { - bucket_id: string | null - created_at: string | null - id: string - last_accessed_at: string | null - metadata: Json | null - name: string | null - owner: string | null - owner_id: string | null - path_tokens: string[] | null - updated_at: string | null - version: string | null - } - Insert: { - bucket_id?: string | null - created_at?: string | null - id?: string - last_accessed_at?: string | null - metadata?: Json | null - name?: string | null - owner?: string | null - owner_id?: string | null - path_tokens?: string[] | null - updated_at?: string | null - version?: string | null - } - Update: { - bucket_id?: string | null - created_at?: string | null - id?: string - last_accessed_at?: string | null - metadata?: Json | null - name?: string | null - owner?: string | null - owner_id?: string | null - path_tokens?: string[] | null - updated_at?: string | null - version?: string | null - } - Relationships: [ - { - foreignKeyName: "objects_bucketId_fkey" - columns: ["bucket_id"] - isOneToOne: false - referencedRelation: "buckets" - referencedColumns: ["id"] - }, - ] - } - s3_multipart_uploads: { - Row: { - bucket_id: string - created_at: string - id: string - in_progress_size: number - key: string - owner_id: string | null - upload_signature: string - version: string - } - Insert: { - bucket_id: string - created_at?: string - id: string - in_progress_size?: number - key: string - owner_id?: string | null - upload_signature: string - version: string - } - Update: { - bucket_id?: string - created_at?: string - id?: string - in_progress_size?: number - key?: string - owner_id?: string | null - upload_signature?: string - version?: string - } - Relationships: [ - { - foreignKeyName: "s3_multipart_uploads_bucket_id_fkey" - columns: ["bucket_id"] - isOneToOne: false - referencedRelation: "buckets" - referencedColumns: ["id"] - }, - ] - } - s3_multipart_uploads_parts: { - Row: { - bucket_id: string - created_at: string - etag: string - id: string - key: string - owner_id: string | null - part_number: number - size: number - upload_id: string - version: string - } - Insert: { - bucket_id: string - created_at?: string - etag: string - id?: string - key: string - owner_id?: string | null - part_number: number - size?: number - upload_id: string - version: string - } - Update: { - bucket_id?: string - created_at?: string - etag?: string - id?: string - key?: string - owner_id?: string | null - part_number?: number - size?: number - upload_id?: string - version?: string - } - Relationships: [ - { - foreignKeyName: "s3_multipart_uploads_parts_bucket_id_fkey" - columns: ["bucket_id"] - isOneToOne: false - referencedRelation: "buckets" - referencedColumns: ["id"] - }, - { - foreignKeyName: "s3_multipart_uploads_parts_upload_id_fkey" - columns: ["upload_id"] - isOneToOne: false - referencedRelation: "s3_multipart_uploads" - referencedColumns: ["id"] - }, - ] - } - } - Views: { - [_ in never]: never - } - Functions: { - can_insert_object: { - Args: { - bucketid: string - name: string - owner: string - metadata: Json - } - Returns: undefined - } - extension: { - Args: { - name: string - } - Returns: string - } - filename: { - Args: { - name: string - } - Returns: string - } - foldername: { - Args: { - name: string - } - Returns: string[] - } - get_size_by_bucket: { - Args: Record - Returns: { - size: number - bucket_id: string - }[] - } - list_multipart_uploads_with_delimiter: { - Args: { - bucket_id: string - prefix_param: string - delimiter_param: string - max_keys?: number - next_key_token?: string - next_upload_token?: string - } - Returns: { - key: string - id: string - created_at: string - }[] - } - list_objects_with_delimiter: { - Args: { - bucket_id: string - prefix_param: string - delimiter_param: string - max_keys?: number - start_after?: string - next_token?: string - } - Returns: { - name: string - id: string - metadata: Json - updated_at: string - }[] - } - operation: { - Args: Record - Returns: string - } - search: { - Args: { - prefix: string - bucketname: string - limits?: number - levels?: number - offsets?: number - search?: string - sortcolumn?: string - sortorder?: string - } - Returns: { - name: string - id: string - updated_at: string - created_at: string - last_accessed_at: string - metadata: Json - }[] - } - } - Enums: { - [_ in never]: never - } - CompositeTypes: { - [_ in never]: never - } - } -} + graphql_public: { + Tables: { + [_ in never]: never; + }; + Views: { + [_ in never]: never; + }; + Functions: { + graphql: { + Args: { + operationName?: string; + query?: string; + variables?: Json; + extensions?: Json; + }; + Returns: Json; + }; + }; + Enums: { + [_ in never]: never; + }; + CompositeTypes: { + [_ in never]: never; + }; + }; + public: { + Tables: { + customers: { + Row: { + id: string; + stripe_customer_id: string | null; + }; + Insert: { + id: string; + stripe_customer_id?: string | null; + }; + Update: { + id?: string; + stripe_customer_id?: string | null; + }; + Relationships: [ + { + foreignKeyName: 'customers_id_fkey'; + columns: ['id']; + isOneToOne: true; + referencedRelation: 'users'; + referencedColumns: ['id']; + } + ]; + }; + prices: { + Row: { + active: boolean | null; + currency: string | null; + description: string | null; + id: string; + interval: Database['public']['Enums']['pricing_plan_interval'] | null; + interval_count: number | null; + metadata: Json | null; + product_id: string; + trial_period_days: number | null; + type: Database['public']['Enums']['pricing_type'] | null; + unit_amount: number | null; + }; + Insert: { + active?: boolean | null; + currency?: string | null; + description?: string | null; + id: string; + interval?: Database['public']['Enums']['pricing_plan_interval'] | null; + interval_count?: number | null; + metadata?: Json | null; + product_id: string; + trial_period_days?: number | null; + type?: Database['public']['Enums']['pricing_type'] | null; + unit_amount?: number | null; + }; + Update: { + active?: boolean | null; + currency?: string | null; + description?: string | null; + id?: string; + interval?: Database['public']['Enums']['pricing_plan_interval'] | null; + interval_count?: number | null; + metadata?: Json | null; + product_id?: string; + trial_period_days?: number | null; + type?: Database['public']['Enums']['pricing_type'] | null; + unit_amount?: number | null; + }; + Relationships: [ + { + foreignKeyName: 'prices_product_id_fkey'; + columns: ['product_id']; + isOneToOne: false; + referencedRelation: 'products'; + referencedColumns: ['id']; + } + ]; + }; + products: { + Row: { + active: boolean | null; + created_at: string; + description: string | null; + features: string[] | null; + id: string; + images: string[] | null; + metadata: Json | null; + name: string | null; + updated_at: string; + }; + Insert: { + active?: boolean | null; + created_at?: string; + description?: string | null; + features?: string[] | null; + id: string; + images?: string[] | null; + metadata?: Json | null; + name?: string | null; + updated_at?: string; + }; + Update: { + active?: boolean | null; + created_at?: string; + description?: string | null; + features?: string[] | null; + id?: string; + images?: string[] | null; + metadata?: Json | null; + name?: string | null; + updated_at?: string; + }; + Relationships: []; + }; + subscriptions: { + Row: { + cancel_at: string | null; + cancel_at_period_end: boolean | null; + canceled_at: string | null; + created: string; + current_period_end: string; + current_period_start: string; + ended_at: string | null; + id: string; + metadata: Json | null; + price_id: string | null; + quantity: number | null; + status: Database['public']['Enums']['subscription_status'] | null; + trial_end: string | null; + trial_start: string | null; + user_id: string; + }; + Insert: { + cancel_at?: string | null; + cancel_at_period_end?: boolean | null; + canceled_at?: string | null; + created?: string; + current_period_end?: string; + current_period_start?: string; + ended_at?: string | null; + id: string; + metadata?: Json | null; + price_id?: string | null; + quantity?: number | null; + status?: Database['public']['Enums']['subscription_status'] | null; + trial_end?: string | null; + trial_start?: string | null; + user_id: string; + }; + Update: { + cancel_at?: string | null; + cancel_at_period_end?: boolean | null; + canceled_at?: string | null; + created?: string; + current_period_end?: string; + current_period_start?: string; + ended_at?: string | null; + id?: string; + metadata?: Json | null; + price_id?: string | null; + quantity?: number | null; + status?: Database['public']['Enums']['subscription_status'] | null; + trial_end?: string | null; + trial_start?: string | null; + user_id?: string; + }; + Relationships: [ + { + foreignKeyName: 'subscriptions_price_id_fkey'; + columns: ['price_id']; + isOneToOne: false; + referencedRelation: 'prices'; + referencedColumns: ['id']; + }, + { + foreignKeyName: 'subscriptions_user_id_fkey'; + columns: ['user_id']; + isOneToOne: false; + referencedRelation: 'users'; + referencedColumns: ['id']; + } + ]; + }; + users: { + Row: { + id: string; + name: string | null; + }; + Insert: { + id: string; + name?: string | null; + }; + Update: { + id?: string; + name?: string | null; + }; + Relationships: [ + { + foreignKeyName: 'users_id_fkey'; + columns: ['id']; + isOneToOne: true; + referencedRelation: 'users'; + referencedColumns: ['id']; + } + ]; + }; + }; + Views: { + [_ in never]: never; + }; + Functions: { + [_ in never]: never; + }; + Enums: { + pricing_plan_interval: 'day' | 'week' | 'month' | 'year'; + pricing_type: 'one_time' | 'recurring'; + subscription_status: + | 'trialing' + | 'active' + | 'canceled' + | 'incomplete' + | 'incomplete_expired' + | 'past_due' + | 'unpaid' + | 'paused'; + }; + CompositeTypes: { + [_ in never]: never; + }; + }; + storage: { + Tables: { + buckets: { + Row: { + allowed_mime_types: string[] | null; + avif_autodetection: boolean | null; + created_at: string | null; + file_size_limit: number | null; + id: string; + name: string; + owner: string | null; + owner_id: string | null; + public: boolean | null; + updated_at: string | null; + }; + Insert: { + allowed_mime_types?: string[] | null; + avif_autodetection?: boolean | null; + created_at?: string | null; + file_size_limit?: number | null; + id: string; + name: string; + owner?: string | null; + owner_id?: string | null; + public?: boolean | null; + updated_at?: string | null; + }; + Update: { + allowed_mime_types?: string[] | null; + avif_autodetection?: boolean | null; + created_at?: string | null; + file_size_limit?: number | null; + id?: string; + name?: string; + owner?: string | null; + owner_id?: string | null; + public?: boolean | null; + updated_at?: string | null; + }; + Relationships: []; + }; + migrations: { + Row: { + executed_at: string | null; + hash: string; + id: number; + name: string; + }; + Insert: { + executed_at?: string | null; + hash: string; + id: number; + name: string; + }; + Update: { + executed_at?: string | null; + hash?: string; + id?: number; + name?: string; + }; + Relationships: []; + }; + objects: { + Row: { + bucket_id: string | null; + created_at: string | null; + id: string; + last_accessed_at: string | null; + metadata: Json | null; + name: string | null; + owner: string | null; + owner_id: string | null; + path_tokens: string[] | null; + updated_at: string | null; + version: string | null; + }; + Insert: { + bucket_id?: string | null; + created_at?: string | null; + id?: string; + last_accessed_at?: string | null; + metadata?: Json | null; + name?: string | null; + owner?: string | null; + owner_id?: string | null; + path_tokens?: string[] | null; + updated_at?: string | null; + version?: string | null; + }; + Update: { + bucket_id?: string | null; + created_at?: string | null; + id?: string; + last_accessed_at?: string | null; + metadata?: Json | null; + name?: string | null; + owner?: string | null; + owner_id?: string | null; + path_tokens?: string[] | null; + updated_at?: string | null; + version?: string | null; + }; + Relationships: [ + { + foreignKeyName: 'objects_bucketId_fkey'; + columns: ['bucket_id']; + isOneToOne: false; + referencedRelation: 'buckets'; + referencedColumns: ['id']; + } + ]; + }; + s3_multipart_uploads: { + Row: { + bucket_id: string; + created_at: string; + id: string; + in_progress_size: number; + key: string; + owner_id: string | null; + upload_signature: string; + version: string; + }; + Insert: { + bucket_id: string; + created_at?: string; + id: string; + in_progress_size?: number; + key: string; + owner_id?: string | null; + upload_signature: string; + version: string; + }; + Update: { + bucket_id?: string; + created_at?: string; + id?: string; + in_progress_size?: number; + key?: string; + owner_id?: string | null; + upload_signature?: string; + version?: string; + }; + Relationships: [ + { + foreignKeyName: 's3_multipart_uploads_bucket_id_fkey'; + columns: ['bucket_id']; + isOneToOne: false; + referencedRelation: 'buckets'; + referencedColumns: ['id']; + } + ]; + }; + s3_multipart_uploads_parts: { + Row: { + bucket_id: string; + created_at: string; + etag: string; + id: string; + key: string; + owner_id: string | null; + part_number: number; + size: number; + upload_id: string; + version: string; + }; + Insert: { + bucket_id: string; + created_at?: string; + etag: string; + id?: string; + key: string; + owner_id?: string | null; + part_number: number; + size?: number; + upload_id: string; + version: string; + }; + Update: { + bucket_id?: string; + created_at?: string; + etag?: string; + id?: string; + key?: string; + owner_id?: string | null; + part_number?: number; + size?: number; + upload_id?: string; + version?: string; + }; + Relationships: [ + { + foreignKeyName: 's3_multipart_uploads_parts_bucket_id_fkey'; + columns: ['bucket_id']; + isOneToOne: false; + referencedRelation: 'buckets'; + referencedColumns: ['id']; + }, + { + foreignKeyName: 's3_multipart_uploads_parts_upload_id_fkey'; + columns: ['upload_id']; + isOneToOne: false; + referencedRelation: 's3_multipart_uploads'; + referencedColumns: ['id']; + } + ]; + }; + }; + Views: { + [_ in never]: never; + }; + Functions: { + can_insert_object: { + Args: { + bucketid: string; + name: string; + owner: string; + metadata: Json; + }; + Returns: undefined; + }; + extension: { + Args: { + name: string; + }; + Returns: string; + }; + filename: { + Args: { + name: string; + }; + Returns: string; + }; + foldername: { + Args: { + name: string; + }; + Returns: string[]; + }; + get_size_by_bucket: { + Args: Record; + Returns: { + size: number; + bucket_id: string; + }[]; + }; + list_multipart_uploads_with_delimiter: { + Args: { + bucket_id: string; + prefix_param: string; + delimiter_param: string; + max_keys?: number; + next_key_token?: string; + next_upload_token?: string; + }; + Returns: { + key: string; + id: string; + created_at: string; + }[]; + }; + list_objects_with_delimiter: { + Args: { + bucket_id: string; + prefix_param: string; + delimiter_param: string; + max_keys?: number; + start_after?: string; + next_token?: string; + }; + Returns: { + name: string; + id: string; + metadata: Json; + updated_at: string; + }[]; + }; + operation: { + Args: Record; + Returns: string; + }; + search: { + Args: { + prefix: string; + bucketname: string; + limits?: number; + levels?: number; + offsets?: number; + search?: string; + sortcolumn?: string; + sortorder?: string; + }; + Returns: { + name: string; + id: string; + updated_at: string; + created_at: string; + last_accessed_at: string; + metadata: Json; + }[]; + }; + }; + Enums: { + [_ in never]: never; + }; + CompositeTypes: { + [_ in never]: never; + }; + }; +}; -type PublicSchema = Database[Extract] +type PublicSchema = Database[Extract]; export type Tables< - PublicTableNameOrOptions extends - | keyof (PublicSchema["Tables"] & PublicSchema["Views"]) - | { schema: keyof Database }, - TableName extends PublicTableNameOrOptions extends { schema: keyof Database } - ? keyof (Database[PublicTableNameOrOptions["schema"]]["Tables"] & - Database[PublicTableNameOrOptions["schema"]]["Views"]) - : never = never, + PublicTableNameOrOptions extends + | keyof (PublicSchema['Tables'] & PublicSchema['Views']) + | { schema: keyof Database }, + TableName extends PublicTableNameOrOptions extends { schema: keyof Database } + ? keyof (Database[PublicTableNameOrOptions['schema']]['Tables'] & + Database[PublicTableNameOrOptions['schema']]['Views']) + : never = never > = PublicTableNameOrOptions extends { schema: keyof Database } - ? (Database[PublicTableNameOrOptions["schema"]]["Tables"] & - Database[PublicTableNameOrOptions["schema"]]["Views"])[TableName] extends { - Row: infer R - } - ? R - : never - : PublicTableNameOrOptions extends keyof (PublicSchema["Tables"] & - PublicSchema["Views"]) - ? (PublicSchema["Tables"] & - PublicSchema["Views"])[PublicTableNameOrOptions] extends { - Row: infer R - } - ? R - : never - : never + ? (Database[PublicTableNameOrOptions['schema']]['Tables'] & + Database[PublicTableNameOrOptions['schema']]['Views'])[TableName] extends { + Row: infer R; + } + ? R + : never + : PublicTableNameOrOptions extends keyof (PublicSchema['Tables'] & PublicSchema['Views']) + ? (PublicSchema['Tables'] & PublicSchema['Views'])[PublicTableNameOrOptions] extends { + Row: infer R; + } + ? R + : never + : never; export type TablesInsert< - PublicTableNameOrOptions extends - | keyof PublicSchema["Tables"] - | { schema: keyof Database }, - TableName extends PublicTableNameOrOptions extends { schema: keyof Database } - ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"] - : never = never, + PublicTableNameOrOptions extends keyof PublicSchema['Tables'] | { schema: keyof Database }, + TableName extends PublicTableNameOrOptions extends { schema: keyof Database } + ? keyof Database[PublicTableNameOrOptions['schema']]['Tables'] + : never = never > = PublicTableNameOrOptions extends { schema: keyof Database } - ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends { - Insert: infer I - } - ? I - : never - : PublicTableNameOrOptions extends keyof PublicSchema["Tables"] - ? PublicSchema["Tables"][PublicTableNameOrOptions] extends { - Insert: infer I - } - ? I - : never - : never + ? Database[PublicTableNameOrOptions['schema']]['Tables'][TableName] extends { + Insert: infer I; + } + ? I + : never + : PublicTableNameOrOptions extends keyof PublicSchema['Tables'] + ? PublicSchema['Tables'][PublicTableNameOrOptions] extends { + Insert: infer I; + } + ? I + : never + : never; export type TablesUpdate< - PublicTableNameOrOptions extends - | keyof PublicSchema["Tables"] - | { schema: keyof Database }, - TableName extends PublicTableNameOrOptions extends { schema: keyof Database } - ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"] - : never = never, + PublicTableNameOrOptions extends keyof PublicSchema['Tables'] | { schema: keyof Database }, + TableName extends PublicTableNameOrOptions extends { schema: keyof Database } + ? keyof Database[PublicTableNameOrOptions['schema']]['Tables'] + : never = never > = PublicTableNameOrOptions extends { schema: keyof Database } - ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends { - Update: infer U - } - ? U - : never - : PublicTableNameOrOptions extends keyof PublicSchema["Tables"] - ? PublicSchema["Tables"][PublicTableNameOrOptions] extends { - Update: infer U - } - ? U - : never - : never + ? Database[PublicTableNameOrOptions['schema']]['Tables'][TableName] extends { + Update: infer U; + } + ? U + : never + : PublicTableNameOrOptions extends keyof PublicSchema['Tables'] + ? PublicSchema['Tables'][PublicTableNameOrOptions] extends { + Update: infer U; + } + ? U + : never + : never; export type Enums< - PublicEnumNameOrOptions extends - | keyof PublicSchema["Enums"] - | { schema: keyof Database }, - EnumName extends PublicEnumNameOrOptions extends { schema: keyof Database } - ? keyof Database[PublicEnumNameOrOptions["schema"]]["Enums"] - : never = never, + PublicEnumNameOrOptions extends keyof PublicSchema['Enums'] | { schema: keyof Database }, + EnumName extends PublicEnumNameOrOptions extends { schema: keyof Database } + ? keyof Database[PublicEnumNameOrOptions['schema']]['Enums'] + : never = never > = PublicEnumNameOrOptions extends { schema: keyof Database } - ? Database[PublicEnumNameOrOptions["schema"]]["Enums"][EnumName] - : PublicEnumNameOrOptions extends keyof PublicSchema["Enums"] - ? PublicSchema["Enums"][PublicEnumNameOrOptions] - : never - + ? Database[PublicEnumNameOrOptions['schema']]['Enums'][EnumName] + : PublicEnumNameOrOptions extends keyof PublicSchema['Enums'] + ? PublicSchema['Enums'][PublicEnumNameOrOptions] + : never;