Setting up a persistence in a PostgreSQL database
In the quick start guide, you worked on a persistence in YAML files. Now let's see how to set up a database persistence, in this case using PostgreSQL.
Defining the type of persistence
When working on the creation of cluster, you saw that the persistence definition was isolated in its own YAML file. You must therefore set up the database connection in this file :
northwind.connectionstring.yaml:
# Persistence type
PersistenceType: PostgreSQL
# The connection string that includes the source database name, and other parameters needed to establish the initial connection
ConnectionString: Server=[SERVER IP OR NAME];Port=[PORT];Database=Northwind;User Id=[USER];Password=[PASSWORD]
This article lists the valid names for keyword values within the ConnectionString.
Generating the database
The database will automatically be created/updated as soon as the neos server is launched:
neos run