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: {
          extensions?: Json
          operationName?: string
          query?: string
          variables?: Json
        }
        Returns: Json
      }
    }
    Enums: {
      [_ in never]: never
    }
    CompositeTypes: {
      [_ in never]: never
    }
  }
  public: {
    Tables: {
      Admin: {
        Row: {
          id: string
          schoolId: string
          username: string
        }
        Insert: {
          id: string
          schoolId: string
          username: string
        }
        Update: {
          id?: string
          schoolId?: string
          username?: string
        }
        Relationships: [
          {
            foreignKeyName: "Admin_schoolId_fkey"
            columns: ["schoolId"]
            isOneToOne: false
            referencedRelation: "School"
            referencedColumns: ["id"]
          },
        ]
      }
      Announcement: {
        Row: {
          classId: number | null
          date: string
          description: string
          id: number
          schoolId: string
          title: string
        }
        Insert: {
          classId?: number | null
          date: string
          description: string
          id?: number
          schoolId: string
          title: string
        }
        Update: {
          classId?: number | null
          date?: string
          description?: string
          id?: number
          schoolId?: string
          title?: string
        }
        Relationships: [
          {
            foreignKeyName: "Announcement_classId_fkey"
            columns: ["classId"]
            isOneToOne: false
            referencedRelation: "Class"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "Announcement_schoolId_fkey"
            columns: ["schoolId"]
            isOneToOne: false
            referencedRelation: "School"
            referencedColumns: ["id"]
          },
        ]
      }
      Assignment: {
        Row: {
          dueDate: string
          id: number
          lessonId: number
          schoolId: string
          startDate: string
          title: string
        }
        Insert: {
          dueDate: string
          id?: number
          lessonId: number
          schoolId: string
          startDate: string
          title: string
        }
        Update: {
          dueDate?: string
          id?: number
          lessonId?: number
          schoolId?: string
          startDate?: string
          title?: string
        }
        Relationships: [
          {
            foreignKeyName: "Assignment_lessonId_fkey"
            columns: ["lessonId"]
            isOneToOne: false
            referencedRelation: "Lesson"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "Assignment_schoolId_fkey"
            columns: ["schoolId"]
            isOneToOne: false
            referencedRelation: "School"
            referencedColumns: ["id"]
          },
        ]
      }
      Attendance: {
        Row: {
          date: string
          id: number
          lessonId: number
          present: boolean
          schoolId: string
          studentId: string
        }
        Insert: {
          date: string
          id?: number
          lessonId: number
          present: boolean
          schoolId: string
          studentId: string
        }
        Update: {
          date?: string
          id?: number
          lessonId?: number
          present?: boolean
          schoolId?: string
          studentId?: string
        }
        Relationships: [
          {
            foreignKeyName: "Attendance_lessonId_fkey"
            columns: ["lessonId"]
            isOneToOne: false
            referencedRelation: "Lesson"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "Attendance_schoolId_fkey"
            columns: ["schoolId"]
            isOneToOne: false
            referencedRelation: "School"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "Attendance_studentId_fkey"
            columns: ["studentId"]
            isOneToOne: false
            referencedRelation: "Student"
            referencedColumns: ["id"]
          },
        ]
      }
      Class: {
        Row: {
          capacity: number
          gradeId: number
          id: number
          name: string
          schoolId: string
          supervisorId: string | null
        }
        Insert: {
          capacity: number
          gradeId: number
          id?: number
          name: string
          schoolId: string
          supervisorId?: string | null
        }
        Update: {
          capacity?: number
          gradeId?: number
          id?: number
          name?: string
          schoolId?: string
          supervisorId?: string | null
        }
        Relationships: [
          {
            foreignKeyName: "Class_gradeId_fkey"
            columns: ["gradeId"]
            isOneToOne: false
            referencedRelation: "Grade"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "Class_schoolId_fkey"
            columns: ["schoolId"]
            isOneToOne: false
            referencedRelation: "School"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "Class_supervisorId_fkey"
            columns: ["supervisorId"]
            isOneToOne: false
            referencedRelation: "Teacher"
            referencedColumns: ["id"]
          },
        ]
      }
      Event: {
        Row: {
          classId: number | null
          description: string
          endTime: string
          id: number
          schoolId: string
          startTime: string
          title: string
        }
        Insert: {
          classId?: number | null
          description: string
          endTime: string
          id?: number
          schoolId: string
          startTime: string
          title: string
        }
        Update: {
          classId?: number | null
          description?: string
          endTime?: string
          id?: number
          schoolId?: string
          startTime?: string
          title?: string
        }
        Relationships: [
          {
            foreignKeyName: "Event_classId_fkey"
            columns: ["classId"]
            isOneToOne: false
            referencedRelation: "Class"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "Event_schoolId_fkey"
            columns: ["schoolId"]
            isOneToOne: false
            referencedRelation: "School"
            referencedColumns: ["id"]
          },
        ]
      }
      Exam: {
        Row: {
          endTime: string
          id: number
          lessonId: number
          schoolId: string
          startTime: string
          title: string
        }
        Insert: {
          endTime: string
          id?: number
          lessonId: number
          schoolId: string
          startTime: string
          title: string
        }
        Update: {
          endTime?: string
          id?: number
          lessonId?: number
          schoolId?: string
          startTime?: string
          title?: string
        }
        Relationships: [
          {
            foreignKeyName: "Exam_lessonId_fkey"
            columns: ["lessonId"]
            isOneToOne: false
            referencedRelation: "Lesson"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "Exam_schoolId_fkey"
            columns: ["schoolId"]
            isOneToOne: false
            referencedRelation: "School"
            referencedColumns: ["id"]
          },
        ]
      }
      Grade: {
        Row: {
          id: number
          level: number
        }
        Insert: {
          id?: number
          level: number
        }
        Update: {
          id?: number
          level?: number
        }
        Relationships: []
      }
      Holiday: {
        Row: {
          id: number
          schoolId: string
          name: string
          startDate: string
          endDate: string
          academicYearId: number | null
          createdById: string | null
          createdAt: string
        }
        Insert: {
          id?: number
          schoolId: string
          name: string
          startDate: string
          endDate: string
          academicYearId?: number | null
          createdById?: string | null
          createdAt?: string
        }
        Update: {
          id?: number
          schoolId?: string
          name?: string
          startDate?: string
          endDate?: string
          academicYearId?: number | null
          createdById?: string | null
          createdAt?: string
        }
        Relationships: [
          {
            foreignKeyName: "Holiday_schoolId_fkey"
            columns: ["schoolId"]
            isOneToOne: false
            referencedRelation: "School"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "Holiday_academicYearId_fkey"
            columns: ["academicYearId"]
            isOneToOne: false
            referencedRelation: "AcademicYear"
            referencedColumns: ["id"]
          },
        ]
      }
      Lesson: {
        Row: {
          classId: number
          endTime: string
          id: number
          name: string
          schoolId: string
          startTime: string
          subjectId: number
          teacherId: string
        }
        Insert: {
          classId: number
          endTime: string
          id?: number
          name: string
          schoolId: string
          startTime: string
          subjectId: number
          teacherId: string
        }
        Update: {
          classId?: number
          endTime?: string
          id?: number
          name?: string
          schoolId?: string
          startTime?: string
          subjectId?: number
          teacherId?: string
        }
        Relationships: [
          {
            foreignKeyName: "Lesson_classId_fkey"
            columns: ["classId"]
            isOneToOne: false
            referencedRelation: "Class"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "Lesson_schoolId_fkey"
            columns: ["schoolId"]
            isOneToOne: false
            referencedRelation: "School"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "Lesson_subjectId_fkey"
            columns: ["subjectId"]
            isOneToOne: false
            referencedRelation: "Subject"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "Lesson_teacherId_fkey"
            columns: ["teacherId"]
            isOneToOne: false
            referencedRelation: "Teacher"
            referencedColumns: ["id"]
          },
        ]
      }
      LessonWhiteboard: {
        Row: {
          createdAt: string
          finalSnapshotData: Json | null
          id: number
          lessonId: number
          liveSnapshotData: Json | null
          plannedSnapshotData: Json | null
          title: string | null
          updatedAt: string
        }
        Insert: {
          createdAt?: string
          finalSnapshotData?: Json | null
          id?: number
          lessonId: number
          liveSnapshotData?: Json | null
          plannedSnapshotData?: Json | null
          title?: string | null
          updatedAt?: string
        }
        Update: {
          createdAt?: string
          finalSnapshotData?: Json | null
          id?: number
          lessonId?: number
          liveSnapshotData?: Json | null
          plannedSnapshotData?: Json | null
          title?: string | null
          updatedAt?: string
        }
        Relationships: [
          {
            foreignKeyName: "LessonWhiteboard_lessonId_fkey"
            columns: ["lessonId"]
            isOneToOne: false
            referencedRelation: "Lesson"
            referencedColumns: ["id"]
          },
        ]
      }
      Parent: {
        Row: {
          address: string
          createdAt: string
          email: string | null
          id: string
          name: string
          phone: string
          schoolId: string
          surname: string
          username: string
        }
        Insert: {
          address: string
          createdAt?: string
          email?: string | null
          id: string
          name: string
          phone: string
          schoolId: string
          surname: string
          username: string
        }
        Update: {
          address?: string
          createdAt?: string
          email?: string | null
          id?: string
          name?: string
          phone?: string
          schoolId?: string
          surname?: string
          username?: string
        }
        Relationships: [
          {
            foreignKeyName: "Parent_schoolId_fkey"
            columns: ["schoolId"]
            isOneToOne: false
            referencedRelation: "School"
            referencedColumns: ["id"]
          },
        ]
      }
      Result: {
        Row: {
          assignmentId: number | null
          examId: number | null
          id: number
          schoolId: string
          score: number
          studentId: string
        }
        Insert: {
          assignmentId?: number | null
          examId?: number | null
          id?: number
          schoolId: string
          score: number
          studentId: string
        }
        Update: {
          assignmentId?: number | null
          examId?: number | null
          id?: number
          schoolId?: string
          score?: number
          studentId?: string
        }
        Relationships: [
          {
            foreignKeyName: "Result_assignmentId_fkey"
            columns: ["assignmentId"]
            isOneToOne: false
            referencedRelation: "Assignment"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "Result_examId_fkey"
            columns: ["examId"]
            isOneToOne: false
            referencedRelation: "Exam"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "Result_schoolId_fkey"
            columns: ["schoolId"]
            isOneToOne: false
            referencedRelation: "School"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "Result_studentId_fkey"
            columns: ["studentId"]
            isOneToOne: false
            referencedRelation: "Student"
            referencedColumns: ["id"]
          },
        ]
      }
      School: {
        Row: {
          adminId: string
          createdAt: string
          id: string
          name: string
          type: Database["public"]["Enums"]["SchoolType"]
        }
        Insert: {
          adminId: string
          createdAt?: string
          id: string
          name: string
          type?: Database["public"]["Enums"]["SchoolType"]
        }
        Update: {
          adminId?: string
          createdAt?: string
          id?: string
          name?: string
          type?: Database["public"]["Enums"]["SchoolType"]
        }
        Relationships: []
      }
      AcademicYear: {
        Row: {
          id: number
          schoolId: string
          startYear: number
          endYear: number
          name: string
          createdById: string | null
          createdAt: string
        }
        Insert: {
          id?: number
          schoolId: string
          startYear: number
          endYear: number
          name: string
          createdById?: string | null
          createdAt?: string
        }
        Update: {
          id?: number
          schoolId?: string
          startYear?: number
          endYear?: number
          name?: string
          createdById?: string | null
          createdAt?: string
        }
        Relationships: [
          {
            foreignKeyName: "AcademicYear_schoolId_fkey"
            columns: ["schoolId"]
            isOneToOne: false
            referencedRelation: "School"
            referencedColumns: ["id"]
          },
        ]
      }
      SchoolTimetable: {
        Row: {
          id: number
          academicYearId: number
          schoolId: string
          name: string
          createdById: string | null
          createdAt: string
        }
        Insert: {
          id?: number
          academicYearId: number
          schoolId: string
          name: string
          createdById?: string | null
          createdAt?: string
        }
        Update: {
          id?: number
          academicYearId?: number
          schoolId?: string
          name?: string
          createdById?: string | null
          createdAt?: string
        }
        Relationships: [
          {
            foreignKeyName: "SchoolTimetable_academicYearId_fkey"
            columns: ["academicYearId"]
            isOneToOne: false
            referencedRelation: "AcademicYear"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "SchoolTimetable_schoolId_fkey"
            columns: ["schoolId"]
            isOneToOne: false
            referencedRelation: "School"
            referencedColumns: ["id"]
          },
        ]
      }
      SchoolTimetableSlot: {
        Row: {
          id: number
          schoolId: string
          schoolTimetableId: number
          name: string
          startTime: string
          endTime: string
          isTeachingSlot: boolean
          position: number
          createdById: string | null
          createdAt: string
        }
        Insert: {
          id?: number
          schoolId: string
          schoolTimetableId: number
          name: string
          startTime: string
          endTime: string
          isTeachingSlot?: boolean
          position: number
          createdById?: string | null
          createdAt?: string
        }
        Update: {
          id?: number
          schoolId?: string
          schoolTimetableId?: number
          name?: string
          startTime?: string
          endTime?: string
          isTeachingSlot?: boolean
          position?: number
          createdById?: string | null
          createdAt?: string
        }
        Relationships: [
          {
            foreignKeyName: "SchoolTimetableSlot_schoolId_fkey"
            columns: ["schoolId"]
            isOneToOne: false
            referencedRelation: "School"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "SchoolTimetableSlot_schoolTimetableId_fkey"
            columns: ["schoolTimetableId"]
            isOneToOne: false
            referencedRelation: "SchoolTimetable"
            referencedColumns: ["id"]
          },
        ]
      }
      Student: {
        Row: {
          address: string
          birthday: string
          bloodType: string
          createdAt: string
          email: string | null
          gradeId: number
          id: string
          img: string | null
          name: string
          parentId: string
          phone: string | null
          schoolId: string
          sex: Database["public"]["Enums"]["UserSex"]
          surname: string
          username: string
        }
        Insert: {
          address: string
          birthday: string
          bloodType: string
          createdAt?: string
          email?: string | null
          gradeId: number
          id: string
          img?: string | null
          name: string
          parentId: string
          phone?: string | null
          schoolId: string
          sex: Database["public"]["Enums"]["UserSex"]
          surname: string
          username: string
        }
        Update: {
          address?: string
          birthday?: string
          bloodType?: string
          createdAt?: string
          email?: string | null
          gradeId?: number
          id?: string
          img?: string | null
          name?: string
          parentId?: string
          phone?: string | null
          schoolId?: string
          sex?: Database["public"]["Enums"]["UserSex"]
          surname?: string
          username?: string
        }
        Relationships: [
          {
            foreignKeyName: "Student_gradeId_fkey"
            columns: ["gradeId"]
            isOneToOne: false
            referencedRelation: "Grade"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "Student_parentId_fkey"
            columns: ["parentId"]
            isOneToOne: false
            referencedRelation: "Parent"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "Student_schoolId_fkey"
            columns: ["schoolId"]
            isOneToOne: false
            referencedRelation: "School"
            referencedColumns: ["id"]
          },
        ]
      }
      StudentClass: {
        Row: {
          studentId: string
          classId: number
        }
        Insert: {
          studentId: string
          classId: number
        }
        Update: {
          studentId?: string
          classId?: number
        }
        Relationships: [
          {
            foreignKeyName: "StudentClass_studentId_fkey"
            columns: ["studentId"]
            isOneToOne: false
            referencedRelation: "Student"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "StudentClass_classId_fkey"
            columns: ["classId"]
            isOneToOne: false
            referencedRelation: "Class"
            referencedColumns: ["id"]
          },
        ]
      }
      Subject: {
        Row: {
          id: number
          name: string
          schoolId: string
        }
        Insert: {
          id?: number
          name: string
          schoolId: string
        }
        Update: {
          id?: number
          name?: string
          schoolId?: string
        }
        Relationships: [
          {
            foreignKeyName: "Subject_schoolId_fkey"
            columns: ["schoolId"]
            isOneToOne: false
            referencedRelation: "School"
            referencedColumns: ["id"]
          },
        ]
      }
      Teacher: {
        Row: {
          address: string
          birthday: string
          bloodType: string
          createdAt: string
          email: string | null
          id: string
          img: string | null
          name: string
          phone: string | null
          sex: Database["public"]["Enums"]["UserSex"]
          surname: string
          username: string
        }
        Insert: {
          address: string
          birthday: string
          bloodType: string
          createdAt?: string
          email?: string | null
          id: string
          img?: string | null
          name: string
          phone?: string | null
          sex: Database["public"]["Enums"]["UserSex"]
          surname: string
          username: string
        }
        Update: {
          address?: string
          birthday?: string
          bloodType?: string
          createdAt?: string
          email?: string | null
          id?: string
          img?: string | null
          name?: string
          phone?: string | null
          sex?: Database["public"]["Enums"]["UserSex"]
          surname?: string
          username?: string
        }
        Relationships: []
      }
      TeacherSchool: {
        Row: {
          id: number
          isManaged: boolean
          schoolId: string
          teacherId: string
        }
        Insert: {
          id?: number
          isManaged?: boolean
          schoolId: string
          teacherId: string
        }
        Update: {
          id?: number
          isManaged?: boolean
          schoolId?: string
          teacherId?: string
        }
        Relationships: [
          {
            foreignKeyName: "TeacherSchool_schoolId_fkey"
            columns: ["schoolId"]
            isOneToOne: false
            referencedRelation: "School"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "TeacherSchool_teacherId_fkey"
            columns: ["teacherId"]
            isOneToOne: false
            referencedRelation: "Teacher"
            referencedColumns: ["id"]
          },
        ]
      }
      TeacherSubject: {
        Row: {
          assignedAt: string | null
          id: number
          isPrimary: boolean | null
          subjectId: number
          teacherId: string
        }
        Insert: {
          assignedAt?: string | null
          id?: number
          isPrimary?: boolean | null
          subjectId: number
          teacherId: string
        }
        Update: {
          assignedAt?: string | null
          id?: number
          isPrimary?: boolean | null
          subjectId?: number
          teacherId?: string
        }
        Relationships: [
          {
            foreignKeyName: "TeacherSubject_subjectId_fkey"
            columns: ["subjectId"]
            isOneToOne: false
            referencedRelation: "Subject"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "TeacherSubject_teacherId_fkey"
            columns: ["teacherId"]
            isOneToOne: false
            referencedRelation: "Teacher"
            referencedColumns: ["id"]
          },
        ]
      }
      Term: {
        Row: {
          id: number
          schoolId: string
          academicYearId: number
          name: string
          startDate: string
          endDate: string
          createdById: string | null
          createdAt: string
        }
        Insert: {
          id?: number
          schoolId: string
          academicYearId: number
          name: string
          startDate: string
          endDate: string
          createdById?: string | null
          createdAt?: string
        }
        Update: {
          id?: number
          schoolId?: string
          academicYearId?: number
          name?: string
          startDate?: string
          endDate?: string
          createdById?: string | null
          createdAt?: string
        }
        Relationships: [
          {
            foreignKeyName: "Term_schoolId_fkey"
            columns: ["schoolId"]
            isOneToOne: false
            referencedRelation: "School"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "Term_academicYearId_fkey"
            columns: ["academicYearId"]
            isOneToOne: false
            referencedRelation: "AcademicYear"
            referencedColumns: ["id"]
          },
        ]
      }
      TeacherTimetableEntry: {
        Row: {
          id: number
          teacherTimetableTemplateId: number
          schoolTimetableSlotId: number
          classId: number
          subjectId: number
          dayOfWeek: number
        }
        Insert: {
          id?: number
          teacherTimetableTemplateId: number
          schoolTimetableSlotId: number
          classId: number
          subjectId: number
          dayOfWeek: number
        }
        Update: {
          id?: number
          teacherTimetableTemplateId?: number
          schoolTimetableSlotId?: number
          classId?: number
          subjectId?: number
          dayOfWeek?: number
        }
        Relationships: [
          {
            foreignKeyName: "TeacherTimetableEntry_classId_fkey"
            columns: ["classId"]
            isOneToOne: false
            referencedRelation: "Class"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "TeacherTimetableEntry_schoolTimetableSlotId_fkey"
            columns: ["schoolTimetableSlotId"]
            isOneToOne: false
            referencedRelation: "SchoolTimetableSlot"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "TeacherTimetableEntry_subjectId_fkey"
            columns: ["subjectId"]
            isOneToOne: false
            referencedRelation: "Subject"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "TeacherTimetableEntry_teacherTimetableTemplateId_fkey"
            columns: ["teacherTimetableTemplateId"]
            isOneToOne: false
            referencedRelation: "TeacherTimetableTemplate"
            referencedColumns: ["id"]
          },
        ]
      }
      TeacherTimetableTemplate: {
        Row: {
          id: number
          schoolId: string
          schoolTimetableId: number
          name: string
          teacherId: string
          createdById: string | null
          createdAt: string
        }
        Insert: {
          id?: number
          schoolId: string
          schoolTimetableId: number
          name: string
          teacherId: string
          createdById?: string | null
          createdAt?: string
        }
        Update: {
          id?: number
          schoolId?: string
          schoolTimetableId?: number
          name?: string
          teacherId?: string
          createdById?: string | null
          createdAt?: string
        }
        Relationships: [
          {
            foreignKeyName: "TeacherTimetableTemplate_schoolId_fkey"
            columns: ["schoolId"]
            isOneToOne: false
            referencedRelation: "School"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "TeacherTimetableTemplate_schoolTimetableId_fkey"
            columns: ["schoolTimetableId"]
            isOneToOne: false
            referencedRelation: "SchoolTimetable"
            referencedColumns: ["id"]
          },
          {
            foreignKeyName: "TeacherTimetableTemplate_teacherId_fkey"
            columns: ["teacherId"]
            isOneToOne: false
            referencedRelation: "Teacher"
            referencedColumns: ["id"]
          },
        ]
      }
    }
    Views: {
      [_ in never]: never
    }
    Functions: {
      auth_user_classes: { Args: never; Returns: number[] }
      auth_user_lessons: { Args: never; Returns: number[] }
      auth_user_parents: { Args: never; Returns: string[] }
      auth_user_students: { Args: never; Returns: string[] }
      auth_user_subjects: { Args: never; Returns: number[] }
      auth_user_teachers: { Args: never; Returns: string[] }
      is_admin: { Args: never; Returns: boolean }
      requesting_user_id: { Args: never; Returns: string }
      requesting_user_role: { Args: never; Returns: string }
    }
    Enums: {
      Day: "MONDAY" | "TUESDAY" | "WEDNESDAY" | "THURSDAY" | "FRIDAY"
      SchoolType: "MANAGED" | "INDEPENDENT" | "AGENCY"
      UserSex: "MALE" | "FEMALE"
    }
    CompositeTypes: {
      [_ in never]: never
    }
  }
}

type DatabaseWithoutInternals = Omit<Database, "__InternalSupabase">

type DefaultSchema = DatabaseWithoutInternals[Extract<keyof Database, "public">]

export type Tables<
  DefaultSchemaTableNameOrOptions extends
    | keyof (DefaultSchema["Tables"] & DefaultSchema["Views"])
    | { schema: keyof DatabaseWithoutInternals },
  TableName extends DefaultSchemaTableNameOrOptions extends {
    schema: keyof DatabaseWithoutInternals
  }
    ? keyof (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] &
        DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"])
    : never = never,
> = DefaultSchemaTableNameOrOptions extends {
  schema: keyof DatabaseWithoutInternals
}
  ? (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"] &
      DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Views"])[TableName] extends {
      Row: infer R
    }
    ? R
    : never
  : DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema["Tables"] &
        DefaultSchema["Views"])
    ? (DefaultSchema["Tables"] &
        DefaultSchema["Views"])[DefaultSchemaTableNameOrOptions] extends {
        Row: infer R
      }
      ? R
      : never
    : never

export type TablesInsert<
  DefaultSchemaTableNameOrOptions extends
    | keyof DefaultSchema["Tables"]
    | { schema: keyof DatabaseWithoutInternals },
  TableName extends DefaultSchemaTableNameOrOptions extends {
    schema: keyof DatabaseWithoutInternals
  }
    ? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"]
    : never = never,
> = DefaultSchemaTableNameOrOptions extends {
  schema: keyof DatabaseWithoutInternals
}
  ? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"][TableName] extends {
      Insert: infer I
    }
    ? I
    : never
  : DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"]
    ? DefaultSchema["Tables"][DefaultSchemaTableNameOrOptions] extends {
        Insert: infer I
      }
      ? I
      : never
    : never

export type TablesUpdate<
  DefaultSchemaTableNameOrOptions extends
    | keyof DefaultSchema["Tables"]
    | { schema: keyof DatabaseWithoutInternals },
  TableName extends DefaultSchemaTableNameOrOptions extends {
    schema: keyof DatabaseWithoutInternals
  }
    ? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"]
    : never = never,
> = DefaultSchemaTableNameOrOptions extends {
  schema: keyof DatabaseWithoutInternals
}
  ? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions["schema"]]["Tables"][TableName] extends {
      Update: infer U
    }
    ? U
    : never
  : DefaultSchemaTableNameOrOptions extends keyof DefaultSchema["Tables"]
    ? DefaultSchema["Tables"][DefaultSchemaTableNameOrOptions] extends {
        Update: infer U
      }
      ? U
      : never
    : never

export type Enums<
  DefaultSchemaEnumNameOrOptions extends
    | keyof DefaultSchema["Enums"]
    | { schema: keyof DatabaseWithoutInternals },
  EnumName extends DefaultSchemaEnumNameOrOptions extends {
    schema: keyof DatabaseWithoutInternals
  }
    ? keyof DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions["schema"]]["Enums"]
    : never = never,
> = DefaultSchemaEnumNameOrOptions extends {
  schema: keyof DatabaseWithoutInternals
}
  ? DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions["schema"]]["Enums"][EnumName]
  : DefaultSchemaEnumNameOrOptions extends keyof DefaultSchema["Enums"]
    ? DefaultSchema["Enums"][DefaultSchemaEnumNameOrOptions]
    : never

export type CompositeTypes<
  PublicCompositeTypeNameOrOptions extends
    | keyof DefaultSchema["CompositeTypes"]
    | { schema: keyof DatabaseWithoutInternals },
  CompositeTypeName extends PublicCompositeTypeNameOrOptions extends {
    schema: keyof DatabaseWithoutInternals
  }
    ? keyof DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"]
    : never = never,
> = PublicCompositeTypeNameOrOptions extends {
  schema: keyof DatabaseWithoutInternals
}
  ? DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions["schema"]]["CompositeTypes"][CompositeTypeName]
  : PublicCompositeTypeNameOrOptions extends keyof DefaultSchema["CompositeTypes"]
    ? DefaultSchema["CompositeTypes"][PublicCompositeTypeNameOrOptions]
    : never

export const Constants = {
  graphql_public: {
    Enums: {},
  },
  public: {
    Enums: {
      Day: ["MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY"],
      SchoolType: ["MANAGED", "INDEPENDENT", "AGENCY"],
      UserSex: ["MALE", "FEMALE"],
    },
  },
} as const

