-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsupabase.yaml
More file actions
100 lines (91 loc) · 2.39 KB
/
Copy pathsupabase.yaml
File metadata and controls
100 lines (91 loc) · 2.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# Example supabase_client_gen contract.
#
# Generate a typed Dart client from this file:
# dart pub global run supabase_client_gen:generate \
# --contract example/supabase.yaml --output example/generated
#
# This is the single source of truth for your backend's client surface.
contract:
name: example_supabase_contract
version: "0.1.0"
date: "2026-06-04"
# Connection details live under `project.remote` (name + ref are required).
project:
remote:
name: example
ref: exampleprojectref
auth:
provider: supabase
planned_sign_in_methods:
- email
schemas:
public:
exposed_to_data_api: true
purpose: Client-facing tables
data_model:
public:
# A workspace-scoped table: because it has a `workspace_id` column, the
# generated repository's select()/stream() are scoped by workspaceId.
things:
ownership: workspace
primary_key: id
description: Items a user tracks within a workspace.
fields:
id: uuid
workspace_id: uuid
name: text
category: thing_category
notes: text
created_at: timestamptz
nullable_fields:
- notes
enum_values:
thing_category:
- device
- document
- other
client_access:
select: member_of_workspace
insert: member_of_workspace
update: member_of_workspace
delete: member_of_workspace
# A global, realtime, read-only table: gets a repository with an unscoped
# select() and stream(), but no insert/update/delete (server-managed).
announcements:
ownership: global
primary_key: id
fields:
id: uuid
title: text
body: text
published_at: timestamptz
client_access:
select: authenticated
insert: edge_function_only
update: edge_function_only
delete: edge_function_only
storage:
buckets:
avatars:
public: true
allowed_mime_types:
- image/png
- image/jpeg
file_size_limit_mb: 5
edge_functions:
runtime: deno
resolve_thing:
method: POST
description: Resolve a thing from a free-text query.
required_request_fields:
- query
optional_request_fields:
- workspace_id
realtime:
publication:
allowed_tables:
- public.announcements
events:
announcement_published:
source: public.announcements
audience: authenticated