studio
studio copied to clipboard
Saving new row in empty table
Bug description
It looks like I can't use prisma studio to create the first row in a database since it's trying to query for existing rows but doesn't find any.
- Roughly follow https://www.prisma.io/docs/orm/prisma-client/queries/raw-database-access/custom-and-type-safe-queries
- Create a new row in the table using the stuido UI
How to reproduce
Start Database:
Create a new database: docker run -d --name my_postgis_container -e POSTGRES_USER=$DBUSER -e POSTGRES_PASSWORD=$DBPASSWORD -p 5432:5432 postgis/postgis:15-3.4
Use this schema:
generator client {
provider = "prisma-client-js"
previewFeatures = ["postgresqlExtensions"]
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
extensions = [postgis]
}
model Gauge {
name String
gaugeProvider GaugeProvider
gaugeIdentifier String
location Unsupported("geography(Point, 4326)")
@@unique([gaugeProvider, gaugeIdentifier])
}
/// This table contains check constraints and requires additional setup for migrations. Visit https://pris.ly/d/check-constraints for more info.
model spatial_ref_sys {
srid Int @id
auth_name String? @db.VarChar(256)
auth_srid Int?
srtext String? @db.VarChar(2048)
proj4text String? @db.VarChar(2048)
}
enum GaugeProvider {
USGS
CDEC
}
Expected behavior
When I open prisma studio and add the first row, that data saves. Instead I get an error.
Prisma information
generator client {
provider = "prisma-client-js"
previewFeatures = ["postgresqlExtensions"]
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
extensions = [postgis]
}
model Gauge {
name String
gaugeProvider GaugeProvider
gaugeIdentifier String
location Unsupported("geography(Point, 4326)")
@@unique([gaugeProvider, gaugeIdentifier])
}
/// This table contains check constraints and requires additional setup for migrations. Visit https://pris.ly/d/check-constraints for more info.
model spatial_ref_sys {
srid Int @id
auth_name String? @db.VarChar(256)
auth_srid Int?
srtext String? @db.VarChar(2048)
proj4text String? @db.VarChar(2048)
}
enum GaugeProvider {
USGS
CDEC
}
Environment & setup
- Link to Data Browser instance:
- OS:
- Browser:
- Database:
Screenshot of page where the problem happened (if applicable)
Prisma logs
None in console where I ran npx prisma studio