Table of Contents

Setting up a persistence in a SQL Server 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 SQL Server.

The framework is compatible with version 2017 or higher.

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: SqlServer
# The connection string that includes the source database name, and other parameters needed to establish the initial connection
ConnectionString: Data Source=[SERVER IP OR NAME]\[INSTANCE NAME];Initial Catalog=Northwind;User ID=[USER];Password=[PASSWORD];Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False

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