#remote postgresql database

1 messages · Page 1 of 1 (latest)

tall badge
#

Hi guys I have a question about the sql implementation for tauri:

"""
import Database from '@tauri-apps/plugin-sql';
// when using "withGlobalTauri": true, you may use
// const Database = window.TAURI.sql;

const db = await Database.load('postgres://user:password@host/test');
await db.execute('INSERT INTO ...');
"""

In the code snippet above you connect to a database trough the connection url. But what if you want to connect to a remote postgres instance? Is this something that happens securely? And if it is, can you trust exposing your postgres database without an api layer?

graceful night
#

You can't put postgres credentials into your app like this, you need to go via an API and authenticate your users