You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The first step to create a remote object is to setup a server with user mappings.
CREATE SERVER test_foreign_db FOREIGN DATA WRAPPER postgres_fdw OPTIONS (host 'psql-mock-database-cloud.postgres.database.azure.com', dbname 'cars1682450166582wiwvrnbqarbjelto', port '5432');
CREATE USER MAPPING FOR twenty SERVER test_foreign_db OPTIONS(user 'agykwsuvotdyuuoqvkftpdgg@psql-mock-database-cloud', password 'atcnvtivakgkkwlnjukflihf')
IMPORT FOREIGN SCHEMA public FROM SERVER test_foreign_db INTO workspace_8z3y1vdaefh8qf1spgqfxswaq;
We need to create an API to do this.
We'll try to rely on Postgres' internal tables as much as we can to avoid duplicate data but we still need to create an intermediate table to keep a reference to the server and credentials.
Implementation
Create a new table remoteServer with the metadata schema.
Fields
id (string)
createdAt (string)
updatedAt (string)
serverName (unique)
options (string or json?)
workspaceId (foreign key)
Note: a server usually represent a connection to a database which can hold multiple schemas. To avoid having to deal with this complexity we will ask for the schema name directly upon server creation (store in options). If a database contains multiple schemas that the user wants to access in Twenty, then the user will have to add multiple remoteServers. This might evolve in future iterations but is good enough for now.
The text was updated successfully, but these errors were encountered:
Context
The first step to create a remote object is to setup a server with user mappings.
We need to create an API to do this.
We'll try to rely on Postgres' internal tables as much as we can to avoid duplicate data but we still need to create an intermediate table to keep a reference to the server and credentials.
Implementation
Create a new table
remoteServer
with themetadata
schema.Fields
Note: a server usually represent a connection to a database which can hold multiple schemas. To avoid having to deal with this complexity we will ask for the schema name directly upon server creation (store in
options
). If a database contains multiple schemas that the user wants to access in Twenty, then the user will have to add multiple remoteServers. This might evolve in future iterations but is good enough for now.The text was updated successfully, but these errors were encountered: