From 902c973c38cb2cae8cc60f90eeb56ba7ebad3f15 Mon Sep 17 00:00:00 2001 From: Jared Henderson Date: Mon, 29 Apr 2024 07:03:39 -0400 Subject: [PATCH] update postgres connect example to non-deprecated (#973) current docs show using a deprecated initializer that produces a warning. --- docs/fluent/overview.es.md | 13 ++++++++++++- docs/fluent/overview.md | 13 ++++++++++++- docs/fluent/overview.zh.md | 13 ++++++++++++- 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/docs/fluent/overview.es.md b/docs/fluent/overview.es.md index d9a691298..36aebf2c4 100644 --- a/docs/fluent/overview.es.md +++ b/docs/fluent/overview.es.md @@ -61,7 +61,18 @@ Una vez agregadas las dependencias, configura la base de datos con Fluent utiliz import Fluent import FluentPostgresDriver -app.databases.use(.postgres(hostname: "localhost", username: "vapor", password: "vapor", database: "vapor"), as: .psql) +app.databases.use( + .postgres( + configuration: .init( + hostname: "localhost", + username: "vapor", + password: "vapor", + database: "vapor", + tls: .disable + ) + ), + as: .psql +) ``` También se pueden expecificar las credenciales mediante una cadena de texto que defina la conexión a la base de datos. diff --git a/docs/fluent/overview.md b/docs/fluent/overview.md index c8186183b..187098215 100644 --- a/docs/fluent/overview.md +++ b/docs/fluent/overview.md @@ -61,7 +61,18 @@ Once the dependencies are added, configure the database's credentials with Fluen import Fluent import FluentPostgresDriver -app.databases.use(.postgres(hostname: "localhost", username: "vapor", password: "vapor", database: "vapor"), as: .psql) +app.databases.use( + .postgres( + configuration: .init( + hostname: "localhost", + username: "vapor", + password: "vapor", + database: "vapor", + tls: .disable + ) + ), + as: .psql +) ``` You can also parse the credentials from a database connection string. diff --git a/docs/fluent/overview.zh.md b/docs/fluent/overview.zh.md index 818c28499..ce4ac0d66 100644 --- a/docs/fluent/overview.zh.md +++ b/docs/fluent/overview.zh.md @@ -61,7 +61,18 @@ PostgreSQL 是一个开源的、符合标准的 SQL 数据库。 它很容易在 import Fluent import FluentPostgresDriver -app.databases.use(.postgres(hostname: "localhost", username: "vapor", password: "vapor", database: "vapor"), as: .psql) +app.databases.use( + .postgres( + configuration: .init( + hostname: "localhost", + username: "vapor", + password: "vapor", + database: "vapor", + tls: .disable + ) + ), + as: .psql +) ``` 还可以从数据库连接字符串解析凭证。