Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update postgres connect example to non-deprecated #973

Merged
merged 1 commit into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion docs/fluent/overview.es.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
13 changes: 12 additions & 1 deletion docs/fluent/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
13 changes: 12 additions & 1 deletion docs/fluent/overview.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
```

还可以从数据库连接字符串解析凭证。
Expand Down