-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
193 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,5 @@ assets/langs/ios/ | |
|
||
# types | ||
*.d.ts | ||
|
||
src/types/supabase.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,9 +28,9 @@ export default function Details(): JSX.Element { | |
<Button | ||
onPress={async () => { | ||
try { | ||
const {error} = await supabase | ||
.from('todos') | ||
.insert({id: 1, todo: 'Buy Milk'}); | ||
const {error} = await supabase.from('User').insert({ | ||
email: '[email protected]', | ||
}); | ||
|
||
console.log('error', error); | ||
} catch (err) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,184 @@ | ||
export type Json = | ||
| string | ||
| number | ||
| boolean | ||
| null | ||
| { [key: string]: Json | undefined } | ||
| Json[] | ||
|
||
export type Database = { | ||
public: { | ||
Tables: { | ||
_prisma_migrations: { | ||
Row: { | ||
applied_steps_count: number | ||
checksum: string | ||
finished_at: string | null | ||
id: string | ||
logs: string | null | ||
migration_name: string | ||
rolled_back_at: string | null | ||
started_at: string | ||
} | ||
Insert: { | ||
applied_steps_count?: number | ||
checksum: string | ||
finished_at?: string | null | ||
id: string | ||
logs?: string | null | ||
migration_name: string | ||
rolled_back_at?: string | null | ||
started_at?: string | ||
} | ||
Update: { | ||
applied_steps_count?: number | ||
checksum?: string | ||
finished_at?: string | null | ||
id?: string | ||
logs?: string | null | ||
migration_name?: string | ||
rolled_back_at?: string | null | ||
started_at?: string | ||
} | ||
Relationships: [] | ||
} | ||
User: { | ||
Row: { | ||
avatar_url: string | null | ||
created_at: string | null | ||
description: string | null | ||
email: string | ||
full_name: string | null | ||
gender: Database["public"]["Enums"]["Gender"] | null | ||
id: string | ||
name: string | null | ||
phone: string | null | ||
provider: Database["public"]["Enums"]["AuthType"] | ||
updated_at: string | null | ||
} | ||
Insert: { | ||
avatar_url?: string | null | ||
created_at?: string | null | ||
description?: string | null | ||
email: string | ||
full_name?: string | null | ||
gender?: Database["public"]["Enums"]["Gender"] | null | ||
id?: string | ||
name?: string | null | ||
phone?: string | null | ||
provider?: Database["public"]["Enums"]["AuthType"] | ||
updated_at?: string | null | ||
} | ||
Update: { | ||
avatar_url?: string | null | ||
created_at?: string | null | ||
description?: string | null | ||
email?: string | ||
full_name?: string | null | ||
gender?: Database["public"]["Enums"]["Gender"] | null | ||
id?: string | ||
name?: string | null | ||
phone?: string | null | ||
provider?: Database["public"]["Enums"]["AuthType"] | ||
updated_at?: string | null | ||
} | ||
Relationships: [] | ||
} | ||
} | ||
Views: { | ||
[_ in never]: never | ||
} | ||
Functions: { | ||
[_ in never]: never | ||
} | ||
Enums: { | ||
AuthType: "email" | "google" | ||
Gender: "male" | "female" | "intersex" | ||
} | ||
CompositeTypes: { | ||
[_ in never]: never | ||
} | ||
} | ||
} | ||
|
||
type PublicSchema = Database[Extract<keyof Database, "public">] | ||
|
||
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 { 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 | ||
|
||
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 { 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 | ||
|
||
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 { 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 | ||
|
||
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 { schema: keyof Database } | ||
? Database[PublicEnumNameOrOptions["schema"]]["Enums"][EnumName] | ||
: PublicEnumNameOrOptions extends keyof PublicSchema["Enums"] | ||
? PublicSchema["Enums"][PublicEnumNameOrOptions] | ||
: never |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters