Skip to content

Commit d789cfa

Browse files
committed
Update example to use remote encryption
1 parent 57dda9a commit d789cfa

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

example/remote/main.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,16 @@ func run() (err error) {
2323
return fmt.Errorf("TURSO_URL environment variable not set")
2424
}
2525

26+
sep := "?"
2627
authToken := os.Getenv("TURSO_AUTH_TOKEN")
2728
if authToken != "" {
28-
dbUrl += "?authToken=" + authToken
29+
dbUrl += sep + "authToken=" + authToken
30+
sep = "&"
31+
}
32+
33+
remoteEncryptionKey := os.Getenv("TURSO_REMOTE_ENCRYPTION_KEY")
34+
if remoteEncryptionKey != "" {
35+
dbUrl += sep + "remoteEncryptionKey=" + remoteEncryptionKey
2936
}
3037

3138
// Open database connection

0 commit comments

Comments
 (0)