Skip to content

Commit e86c309

Browse files
authored
Merge branch 'main' into ankur-arch-patch-1
2 parents d729781 + 8439c2b commit e86c309

File tree

4 files changed

+31
-1
lines changed

4 files changed

+31
-1
lines changed

content/200-orm/500-reference/375-supported-databases.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ An asterisk (\*) indicates that the version number is not relevant; either all v
3232
| PostgreSQL | 14 |
3333
| PostgreSQL | 15 |
3434
| PostgreSQL | 16 |
35+
| PostgreSQL | 17 |
3536
| SQLite | \* |
3637

3738
Note that a fixed version of SQLite is shipped with every Prisma ORM release.

content/200-orm/500-reference/380-connection-urls.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The connection URL is provided via the `url` field of a `datasource` block in yo
1717
- **Port**: The port on which your database server is running
1818
- **Database name**: The name of the database you want to use
1919

20-
Make sure you have this information at hand when getting started with Prisma ORM. If you don't have a database server running yet, you can either use a local SQLite database file (see the [Quickstart](/getting-started/quickstart-sqlite)) or [setup a free PostgreSQL database on Supabase](https://dev.to/prisma/set-up-a-free-postgresql-database-on-supabase-to-use-with-prisma-3pk6).
20+
Make sure you have this information at hand when getting started with Prisma ORM. If you don't have a database server running yet, you can either use a local SQLite database file (see the [Quickstart](/getting-started/quickstart-sqlite)) or [setup a free PostgreSQL database with Prisma Postgres](/orm/overview/databases/prisma-postgres).
2121

2222
</TopBlock>
2323

content/700-optimize/300-recordings.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ When a recording session ends, Optimize generates recommendations such as:
4141
- [Queries on unindexed columns](/optimize/recommendations/queries-on-unindexed-columns)
4242
- [Repeated query](/optimize/recommendations/repeated-query)
4343
- [Overfetching](/optimize/recommendations/select-returning)
44+
- [Using `@db.Money`](/optimize/recommendations/avoid-db-money)
4445

4546
:::info
4647
Use [Prisma AI](/optimize/prisma-ai) to ask follow-up questions about a recommendation.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
title: 'Using @db.Money'
3+
metaTitle: 'Optimize Recommendations: Avoid usage of `@db.Money`'
4+
metaDescription: "Learn about the recommendation provided by Optimize for using `@db.Money` native type."
5+
tocDepth: 3
6+
toc: true
7+
---
8+
9+
Optimize provides recommendations to help you identify and resolve performance issues caused by the use of `@db.Money` type.
10+
11+
The following model uses the `@db.Money` native type:
12+
13+
```prisma
14+
model Item {
15+
// ...
16+
price Decimal @db.Money
17+
// ...
18+
}
19+
```
20+
21+
## What is the problem?
22+
23+
The `@db.Money` data type in PostgreSQL is not ideal for storing monetary values. Internally, `@db.Money` is implemented as an integer, which offers speed but lacks flexibility. It handles fractional values and rounding in unexpected ways, which can lead to inaccuracies.
24+
25+
Additionally, the `@db.Money` type does not store any information about the associated currency. Instead, it relies on the global `lc_monetary` locale setting, which may not be suitable for all use cases.
26+
27+
For more information, refer to the [PostgreSQL documentation](https://wiki.postgresql.org/wiki/Don't_Do_This#Don.27t_use_money).
28+

0 commit comments

Comments
 (0)