I need to check if a row exists in a table, is thi...
# orm-help
h
I need to check if a row exists in a table, is this the best way to do that?
Copy code
prisma.arbitrated.count({
        where: {
            id: 100
        }
    }) > 0;
r
You can use
findFirst
as well.
h
and then check if that is not null?
r
Yeah
h
ok thx
Is it possible to use Postgres extension CiText with prisma?
According to this it seems it's not 😞 https://github.com/prisma/prisma/issues/6944
Copy code
Error: P3006

Migration `20210726141108_` failed to apply cleanly to the shadow database. 
Error:
Database error
Error querying the database: db error: ERROR: type "citext" does not exist
   0: sql_migration_connector::flavour::postgres::sql_schema_from_migration_history
             at migration-engine/connectors/sql-migration-connector/src/flavour/postgres.rs:375
   1: sql_migration_connector::validate_migrations
             at migration-engine/connectors/sql-migration-connector/src/lib.rs:323
   2: migration_core::api::DevDiagnostic
             at migration-engine/core/src/api.rs:89
Even though i enabled it with "CREATE EXTENSION IF NOT EXISTS citext WITH SCHEMA public;" and it is installed
r
Yeah it’s not yet supported.
h
ok thx