generated from betagouv/template-nextjs
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpowersync-config.yaml
59 lines (50 loc) · 1.81 KB
/
powersync-config.yaml
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
replication:
connections:
- type: postgresql
uri: !env PS_DATABASE_URL
# SSL settings
sslmode: disable # 'verify-full' (default) or 'verify-ca' or 'disable'
# Connection settings for sync bucket storage
storage:
type: mongodb
uri: mongodb://mongo:27017/powersync_demo
# The port which the PowerSync API server will listen on
port: !env PS_PORT
# Specify sync rules
sync_rules:
# TODO use specific sync rules here
content: |
bucket_definitions:
global_bucket:
data:
- SELECT * FROM clause_v2 WHERE udap_id = 'ALL'
- SELECT * FROM pictures
- SELECT * FROM picture_lines
udap_bucket:
parameters: SELECT udap_id as udap_id FROM "user" WHERE id = request.user_id()
data:
- SELECT * FROM report WHERE udap_id = bucket.udap_id
- SELECT * FROM udap WHERE id = bucket.udap_id
- SELECT * FROM "user" WHERE udap_id = bucket.udap_id
- SELECT * FROM service_instructeurs WHERE udap_id = bucket.udap_id
- SELECT * FROM clause_v2 WHERE udap_id = bucket.udap_id
user_bucket:
parameters: SELECT request.user_id() as user_id
data:
- SELECT * FROM delegation WHERE "createdBy" = bucket.user_id OR "delegatedTo" = bucket.user_id
- SELECT * FROM pdf_snapshot WHERE user_id = bucket.user_id
- SELECT * FROM transactions WHERE user_id = bucket.user_id
# Settings for client authentication
client_auth:
jwks:
keys:
- kty: oct
alg: HS256
kid: powersync
k: !env PS_JWT_SECRET
audience: ["powersync"]
# Settings for telemetry reporting
# See https://docs.powersync.com/self-hosting/telemetry
telemetry:
# Opt out of reporting anonymized usage metrics to PowerSync telemetry service
disable_telemetry_sharing: false